

void CHC_controllerDlg::OnChangeDevice() 
{
	
	
	UpdateData(TRUE);			// get data from the GUI
	byte byReadData[2];//input array place holder
	for (int i = 0; i < 1; i++)
	{
		byReadData[0] = (byte)strtoul( m_strDeviceAddress, NULL, 16 ) ;;//array variable one
		byReadData[0] = ("%x", byReadData[0]);
	}
	
	for (i = 0; i < 1; i++)
	{
		byReadData[1] = (byte)strtoul( m_strDeviceAddress, NULL, 16 ) ;;//array variable one
		byReadData[1] = ("%x", byReadData[1]);
	}	
	
	
	byte byValue1 = byReadData[0];
	byte byValue2 = byReadData[1];

	//byValue = ((BYTE)strtoul(m_strDeviceAddress, NULL, 16);
   
	
	byte byValue = (byValue2) & (byValue1)  ;

	
	device = byValue;
	//m_strDeviceAddress.FormatMessage("0x%x", device) ;
    m_strDeviceAddress.Empty();
	m_strDeviceAddress.Format("0x", byValue1);
	byte temp = (byte)strtoul( m_strDeviceAddress, NULL, 16 ) ;;//array variable one
	m_strDeviceAddress.FormatMessage("%x", byValue2); 


	allset |=0x8;				// set bit 3 to indicate device is set
	UpdateData(FALSE);

	
	
}

