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.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_URIBeacon by
Revision 21:3c518a637de6, committed 2015-04-16
- Comitter:
- mbedAustin
- Date:
- Thu Apr 16 20:27:05 2015 +0000
- Parent:
- 20:8f63cbf19f7f
- Commit message:
- Fixed mac address conversion issue
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 8f63cbf19f7f -r 3c518a637de6 main.cpp --- a/main.cpp Thu Apr 16 05:30:24 2015 +0000 +++ b/main.cpp Thu Apr 16 20:27:05 2015 +0000 @@ -74,17 +74,21 @@ } printf("\n\r"); -// string url = "http://snurl.com/29ukhla" ; - string url = "http://snurl.com/ub?q=" ; - url += (mac[0]%(122-32))+32; - url += (mac[1]%(122-32))+32; - url += (mac[2]%(122-32))+32; - url += (mac[3]%(122-32))+32; - url += (mac[4]%(122-32))+32; - url += ((mac[5]%(122-32))+32); - +// string url = "http://snurl.com/ub?q=" ; + string url = "http://snurl.com/u6?q=" ; + url += ((mac[0] & 0xF0) >> 4) + 'A'; + url += ((mac[0] & 0x0F) >> 0) + 'A'; + url += ((mac[1] & 0xF0) >> 4) + 'A'; + url += ((mac[1] & 0x0F) >> 0) + 'A'; + url += ((mac[2] & 0xF0) >> 4) + 'A'; + url += ((mac[2] & 0x0F) >> 0) + 'A'; + url += ((mac[3] & 0xF0) >> 4) + 'A'; + url += ((mac[3] & 0x0F) >> 0) + 'A'; + url += ((mac[4] & 0xF0) >> 4) + 'A'; + url += ((mac[4] & 0x0F) >> 0) + 'A'; + for(int y=0; y<6; y++) { - printf("\n\rmac[%d]=0x%x, d%d, c%c,mod=%c",y,mac[y],mac[y],mac[y],((mac[y]%(122-32))+32)); + printf("\n\rmac[%d]=0x%x, d%d, c%c,modH=%c, modL=%c",y,mac[y],mac[y],mac[y],((mac[y] & 0xF0) >> 4) + 'A',((mac[y] & 0x0F) >> 0) + 'A'); } // printf("\n\r0x%x->%c, 0x%x->%c\n\r%s\n\r",mac[4],(mac[4]%(122-32))+32,mac[5],(mac[5]%(122-32))+32,url); printf("\n\rurl = %s\n\r",url);