Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SPWF01SA by
Revision 2:40d183d7dc19, committed 2016-06-30
- Comitter:
- mridup
- Date:
- Thu Jun 30 06:59:25 2016 +0000
- Parent:
- 1:becf69a794fb
- Child:
- 3:2af9df1068a5
- Commit message:
- SPWF getMACAddress()
Changed in this revision
| SPWFSA01.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
}
