Add TINYGSM_UNICODE_TO_HEX

This commit is contained in:
Volodymyr Shymanskyy
2017-09-28 02:13:15 +03:00
parent 77c5109f9e
commit 2b233936b0

View File

@@ -157,14 +157,19 @@ String TinyGsmDecodeHex16bit(String &instr) {
buf[1] = instr[i+1];
char b = strtol(buf, NULL, 16);
if (b) { // If high byte is non-zero, we can't handle it ;(
b = '?';
#if defined(TINY_GSM_UNICODE_TO_HEX)
result += "\\x";
result += instr.substring(i, i+4);
#else
result += "?";
#endif
} else {
buf[0] = instr[i+2];
buf[1] = instr[i+3];
b = strtol(buf, NULL, 16);
}
result += b;
}
}
return result;
}