diff --git a/TinyGsmCommon.h b/TinyGsmCommon.h index 96207a9..234f47e 100644 --- a/TinyGsmCommon.h +++ b/TinyGsmCommon.h @@ -93,6 +93,7 @@ uint32_t TinyGsmAutoBaud(T& SerialAT) return 0; } +static inline IPAddress TinyGsmIpFromString(const String& strIP) { int Parts[4] = {0,0,0,0}; int Part = 0; @@ -108,4 +109,63 @@ IPAddress TinyGsmIpFromString(const String& strIP) { return IPAddress(Parts[0], Parts[1], Parts[2], Parts[3]); } +static inline +String TinyGsmDecodeHex7bit(String &instr) { + String result; + byte reminder = 0; + int bitstate = 7; + for (unsigned i=0; i> bitstate; + bitstate--; + if (bitstate == 0) { + char c = reminder; + result += c; + reminder = 0; + bitstate = 7; + } + } + return result; +} + +static inline +String TinyGsmDecodeHex8bit(String &instr) { + String result; + for (unsigned i=0; i