Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Revision:
24:e27e23297f02
Parent:
22:2d7ef60a9f2a
Child:
25:70903e533fc3
--- a/StringUtil.h	Sat Sep 06 14:24:03 2014 -0700
+++ b/StringUtil.h	Sat Sep 06 20:34:01 2014 -0700
@@ -298,7 +298,7 @@
     static bool strToUint32(const char *str, uint32_t *uint32Ptr)
     {
         intmax_t r;
-        bool result = StringUtil::parseInt(str, &r, 0, UINT_MAX);
+        bool result = (str[0] == '0' && str[1] == 'x') ? StringUtil::parseHex(&str[2], &r, 0, UINT32_MAX): StringUtil::parseInt(str, &r, 0, UINT32_MAX);
         *uint32Ptr = (uint32_t)r;
         return result;
     }
@@ -307,7 +307,7 @@
     static bool strToUint16(const char *str, uint16_t *uint16Ptr)
     {
         intmax_t r;
-        bool result = StringUtil::parseInt(str, &r, 0, USHRT_MAX);
+        bool result = StringUtil::parseInt(str, &r, 0, UINT16_MAX);
         *uint16Ptr = (uint16_t)r;
         return result;
     }
@@ -316,7 +316,7 @@
     static bool strToInt32(const char *str, int32_t *int32Ptr)
     {
         intmax_t r;
-        bool result = StringUtil::parseInt(str, &r, INT_MIN, INT_MAX);
+        bool result = StringUtil::parseInt(str, &r, INT32_MIN, INT32_MAX);
         *int32Ptr = (int32_t)r;
         return result;
     }
@@ -326,7 +326,7 @@
     static bool strHexToUint32(const char *strHex, uint32_t *uint32Ptr)
     {
         intmax_t r;
-        bool result = StringUtil::parseHex(strHex, &r, 0, UINT_MAX);
+        bool result = StringUtil::parseHex(strHex, &r, 0, UINT32_MAX);
         *uint32Ptr = (uint32_t)r;
         return result;
     }