File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,13 @@ namespace arduino { namespace hex {
2828 }
2929
3030 bool decode (const String in, uint8_t * out, uint32_t size) {
31+ return decode (in.c_str (), out, size);
32+ }
33+
34+ bool decode (const char *in, uint8_t * out, uint32_t size) {
3135 unsigned int byteNumber;
32- byteNumber = chex_decode (out, size, in. begin (), in. length ( ));
33- return byteNumber * 2 == in. length ( );
36+ byteNumber = chex_decode (out, size, in, strlen (in ));
37+ return byteNumber * 2 == strlen (in );
3438 }
3539
3640}} // arduino::hex
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ namespace arduino { namespace hex {
2020
2121 String encode (const uint8_t * in, uint32_t size);
2222 String encodeUpper (const uint8_t * in, uint32_t size);
23-
23+ bool decode ( const char *in, uint8_t * out, uint32_t size);
2424 bool decode (const String in, uint8_t * out, uint32_t size);
2525}} // arduino::hex
2626
@@ -37,4 +37,7 @@ class THEXT {
3737 return arduino::hex::decode (in, out, size);
3838 }
3939
40+ static inline bool decode (const char *in, uint8_t * out, uint32_t size) {
41+ return arduino::hex::decode (in, out, size);
42+ }
4043};
You can’t perform that action at this time.
0 commit comments