void TelMsgRepetThread::Changeover( unsigned m ) {
unsigned b = m;
unsigned char i = 0;
char s[] = "0123456789ABCDEF";
char num[10],t;
while(b >= 16l) {
num[i++] = s[b % 16l]; // 求出目标进制数的一位
b = b / 16l; // 从原数中去掉上面求出的数
}
if(b > 0) num[i++] = s[b];
num[i] = '\0';
for(b = 0;b < i/2;b++) {
t = num[b];
num[b] = num[i - b - 1];
num[i - b - 1] = t;
}
char ar[2];
memset(ar,0x00,2);
if (strlen(num)>2)
{
memcpy(ar,num,1);
m_iHex1 = strtol(ar, NULL, 16);
}
else
{
m_iHex1 = 0;
}
char br[3];
memset(br,0x00,3);
if(strlen(num)>2)
{
memcpy(br, num+1, 2);
}
else
{
memcpy(br, num, 2);
}
m_iHex2 = strtol(br, NULL, 16);
}