66 char hex_lut[] =
"0123456789abcdef";
72 for (
uint16_t i = 0; i < length; i++)
76 outbuf[(i*2)] = hex_lut[(inbuf[i] & 0xF0) >> 4 ];
77 outbuf[(i*2)+1] = hex_lut[(inbuf[i] & 0x0F) ];
80 outbuf[length*2] =
'\0';
105 char backwardsBuf[10];
116 backwardsBuf[length] =
'0' + rem;
119 calcval = calcval - rem;
120 calcval = calcval / 10;
124 lengthCounter = length;
127 for (
uint8_t i = 0; i < length; i++)
129 outbuf[i] = backwardsBuf[lengthCounter-1];
134 outbuf[length] =
'\0';
153 char hex_lut[] =
"0123456789abcdef";
160 outbuf[0] = hex_lut[(value & 0xF000) >> 12];
161 outbuf[1] = hex_lut[(value & 0x0F00) >> 8 ];
162 outbuf[2] = hex_lut[(value & 0x00F0) >> 4 ];
163 outbuf[3] = hex_lut[(value & 0x000F) ];
172 outbuf[0] = hex_lut[(value & 0xF0000000) >> 28];
173 outbuf[1] = hex_lut[(value & 0x0F000000) >> 24];
174 outbuf[2] = hex_lut[(value & 0x00F00000) >> 20];
175 outbuf[3] = hex_lut[(value & 0x000F0000) >> 16];
176 outbuf[4] = hex_lut[(value & 0x0000F000) >> 12];
177 outbuf[5] = hex_lut[(value & 0x00000F00) >> 8 ];
178 outbuf[6] = hex_lut[(value & 0x000000F0) >> 4 ];
179 outbuf[7] = hex_lut[(value & 0x0000000F) ];
210 if (*(inbuf+i) != *(sequence+i))
return (
false);
229 while (inbuf[length] !=
'\0') length++;
uint8_t stringLength(char *inbuf)
Returns the length of the given null-terminated byte string.
void charASCII_to_charHex(char *inbuf, char *outbuf)
Convert an ASCII char array (string) to a hexadecimal char array.
void uint32_to_charHex(uint32_t value, char *outbuf)
Convert a uint32_t value to a hexadecimal char array (string).
String (char array) conversion functionality.
bool stringStartsWith(char *inbuf, char *sequence)
Check if a given char array (string) starts with a given sequence.
void uint32_to_charDec(uint32_t value, char *outbuf)
Convert a uint32_t value to a decimal char array (string).
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
unsigned int uint32_t
Typedef defining 32 bit unsigned int type. The developer should modify this to suit the platform bein...