
 1  void CHC_controllerDlg::OnChangeDevice() 
 2  {
 3      UpdateData(TRUE);
 4      byte byReadData[2];
 5      for (int i = 0; i < 1; i++)
 6      {
 7          byReadData[0] = (byte)strtoul( m_strDeviceAddress, NULL, 16 )
 8          byReadData[0] = ("%x", byReadData[0]);
 9      }
10      
11      for (i = 0; i < 1; i++)
12      {
13          byReadData[1] = (byte)strtoul( m_strDeviceAddress, NULL, 16 )
14          byReadData[1] = ("%x", byReadData[1]);
15      }   
16      
17      byte byValue1 = byReadData[0];
18      byte byValue2 = byReadData[1];
19  
20      byte byValue = (byValue2) & (byValue1)  ;
21      
22      device = byValue;
23      m_strDeviceAddress.Empty();
24      m_strDeviceAddress.Format("0x", byValue1);
25      byte temp = (byte)strtoul( m_strDeviceAddress, NULL, 16 )
26      m_strDeviceAddress.FormatMessage("%x", byValue2); 
27  
28      allset |=0x8;
29      UpdateData(FALSE);
30  }
