This is boring
Diff: SPWFSA01.cpp
- Revision:
- 2:40d183d7dc19
- Parent:
- 1:becf69a794fb
- Child:
- 3:2af9df1068a5
--- a/SPWFSA01.cpp Thu Jun 30 06:31:09 2016 +0000 +++ b/SPWFSA01.cpp Thu Jun 30 06:59:25 2016 +0000 @@ -205,7 +205,7 @@ printf("\r\ngetIPAddress error\n"); return 0; } - //printf("\r\nip address:%u.%u.%u.%u\n",n1, n2, n3, n4); + sprintf((char*)_ip_buffer,"%u.%u.%u.%u", n1, n2, n3, n4); return _ip_buffer; @@ -213,17 +213,16 @@ const char *SPWFSA01::getMACAddress(void) { - uint32_t n1, n2, n3, n4; + uint32_t n1, n2, n3, n4, n5, n6; if (!(_parser.send("AT+S.GCFG=nv_wifi_macaddr") - && _parser.recv("# nv_wifi_macaddr = %u.%u.%u.%u", &n1, &n2, &n3, &n4) + && _parser.recv("# nv_wifi_macaddr = %x:%x:%x:%x:%x:%x", &n1, &n2, &n3, &n4, &n5, &n6) && _parser.recv("OK"))) { printf("\r\ngetMACAddress error\n"); return 0; } - - printf("\r\nip address:%u.%u.%u.%u\n",n1, n2, n3, n4); - sprintf((char*)_mac_buffer,"%u.%u.%u.%u", n1, n2, n3, n4); + + sprintf((char*)_mac_buffer,"%02X:%02X:%02X:%02X:%02X:%02X", n1, n2, n3, n4, n5, n6); return _mac_buffer; } @@ -235,8 +234,8 @@ bool SPWFSA01::open(const char *type, int id, const char* addr, int port) { - //IDs only 0-4 - if(id > 4) { + //IDs only 0-7 + if(id > 7) { return false; }