Matthew Chan / Mbed 2 deprecated BLE_GAP_Acceleration_Matt_Correlation_Test

Dependencies:   ADXL345_nRF51 BLE_API advertiser_data mbed nRF51822

Fork of BLE_GAP_Acceleration_Trial by Ames HCI IoT

Files at this revision

API Documentation at this revision

Comitter:
mchan
Date:
Thu Jul 30 16:40:03 2015 +0000
Parent:
18:bb0566d76c27
Commit message:
correlation test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Jul 29 22:42:50 2015 +0000
+++ b/main.cpp	Thu Jul 30 16:40:03 2015 +0000
@@ -29,6 +29,7 @@
 static advertiser_data advertisers[MAX_ADVERTISERS];
 static uint8_t advertiser_index[MAX_ADVERTISERS];
 static uint8_t advertiser_count = 0;
+static uint8_t currently_picked_up = 0;
 
 uint8_t get_index(uint8_t address)
 {
@@ -123,7 +124,15 @@
         advertiser_data_update(pdata, manData, manDataLen);
 
         // TODO: implement the rest of the algorithms
-        advertiser_data_print(pdata,params->peerAddr[2]);
+        //advertiser_data_print(pdata,params->peerAddr[2]);
+        
+        if(pdata->picked_up){
+            uint8_t temp = params->peerAddr[2];
+            if(currently_picked_up!=temp){
+                currently_picked_up = temp;
+                pc.printf("CURRENTLY PICKING UP DEVICE %i\n\r",currently_picked_up);
+            }
+        }
     }
 }