char *stringbuf;
char *temp;
char seps[]=" ";
char sndBuf[8]={0};
int hexA,hexB;
for(int i=0;i<8;i++)
{
temp=sendBuf;
stringbuf=strtok(temp,seps);
sendBuf=sendBuf+3;
hexA=ConvertHexChar(*stringbuf);
stringbuf++;
hexB=ConvertHexChar(*stringbuf);
stringbuf++;
sndBuf[i]=hexA*16+hexB;
}
char ConvertHexChar(char ch)
{
if((ch>='0')&&(ch <='9'))
return ch-0x30;
else if((ch>='A')&&(ch <='F'))
return ch-'A'+10;
else if((ch>='a')&&(ch <='f'))
return ch-'a'+10;
else return (-1);
}