aidanReceiver

Dependencies:   mbed BLE_API nRF51822

Revision:
5:45c48a82f202
Parent:
4:25c53ae0ae04
Child:
6:55c87c9bc90e
--- a/receiver_main.cpp	Wed Apr 17 21:18:08 2019 +0000
+++ b/receiver_main.cpp	Wed Apr 17 21:42:16 2019 +0000
@@ -26,18 +26,20 @@
 void scanCallback(const Gap::AdvertisementCallbackParams_t *params)
 {
     if (*(params->Gap::AdvertisementCallbackParams_t::peerAddr) == (std::uint8_t)0xF34F887FED4E) {
-        char * buf = (char*) params->advertisingData;
+        uint8_t * buf = (uint8_t *) params->advertisingData;
         
         if (buf[0] == GapAdvertisingData::COMPLETE_LOCAL_NAME) {
             blueLed = 0;
         }
+//        pc.printf("Hello\n");
         
         for (int i=0; i < params->advertisingDataLen; i++) {
             //if ( i >= params->advertisingDataLen-2 && buf[i] == 'n' ) {
 //                blueLed = 0;
 //            }
-            pc.printf("byte %d: %c\n", i, buf[i]);
+            pc.printf("%02x ", buf[i]);
         }
+        pc.printf("\n");
         
         led1 = 0;
     }
@@ -72,7 +74,7 @@
     BLE& ble = BLE::Instance(BLE::DEFAULT_INSTANCE);
     ble.init(bleInitComplete);
     
-    pc.printf("Hello World!\n");
+//    pc.printf("Hello World!\n");
     
     /* SpinWait for initialization to complete. This is necessary because the
      * BLE object is used in the main loop below. */