完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
相关推荐
|
|
//字符串转十六进制 //typeFlag 0为串口 ,1为TCP SENDBUFFER* TMYCLASS::StringToHex(String Str,byte typeFlag) { int const Len = Str.Length(); char *p = &Str[1]; unsigned long int index = 0; unsigned long int ArrIndex=0; this->SendBuffer[typeFlag].Count = 0; for (index=0;index < Len;index++) { if ( ((p[index] >= '0')&&(p[index] <= '9')) || ((p[index] >= 'a')&&(p[index] <= 'f')) || ((p[index] >= 'A')&&(p[index] <= 'F'))) { if ((p[index+1] != ' |