testing for double to float
Dependencies: ADXL345_nRF51 BLE_API advertiser_data mbed nRF51822
Fork of BLE_GAP_Acceleration_Observer_2_Advertisers by
Revision 17:d0e05234fd95, committed 2015-07-29
- Comitter:
- mchan
- Date:
- Wed Jul 29 21:34:18 2015 +0000
- Parent:
- 16:7593fe102c55
- Commit message:
- took out ghetto advertiser identifier
Changed in this revision
diff -r 7593fe102c55 -r d0e05234fd95 ADXL345_nRF51.lib --- a/ADXL345_nRF51.lib Wed Jul 29 17:14:40 2015 +0000 +++ b/ADXL345_nRF51.lib Wed Jul 29 21:34:18 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/Ames-HCI-IoT/code/ADXL345_nRF51/#5727ecf6b6b2 +http://developer.mbed.org/teams/Ames-HCI-IoT/code/ADXL345_nRF51/#da8b0276cdc6
diff -r 7593fe102c55 -r d0e05234fd95 BLE_API.lib --- a/BLE_API.lib Wed Jul 29 17:14:40 2015 +0000 +++ b/BLE_API.lib Wed Jul 29 21:34:18 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#9c2edf20ea56 +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#4cd3b18607ec
diff -r 7593fe102c55 -r d0e05234fd95 main.cpp --- a/main.cpp Wed Jul 29 17:14:40 2015 +0000 +++ b/main.cpp Wed Jul 29 21:34:18 2015 +0000 @@ -79,54 +79,6 @@ //pc.printf("Found device...\n\r"); #endif if (params->peerAddr[5] == 0xe5 && params->peerAddr[4] == 0x4f) { - pc.printf("ADVERTISER 1\n\r"); -#ifdef DEBUG - for (unsigned index = 0; index < params->advertisingDataLen; index++) { - pc.printf("%02x ", params->advertisingData[index]); - } - pc.printf("\n\r"); -#endif - /* Using only the 3rd part of address for indexing the stored data for now */ - advertiser_data *pdata = get_advertiser_data(params->peerAddr[3]); - if (!pdata) { -#ifdef DEBUG - pc.printf("Too many advertisers!\n\r"); -#endif - return; - } - - /* Always update the rssi */ - uint8_t passdat = (uint8_t)(abs(params->rssi)); - advertiser_data_update_rssi(pdata, passdat); - - /* Find the manufacturers data */ - const uint8_t *manData = NULL; - uint8_t manDataLen = 0; - get_manufacturer_data(params->advertisingData, params->advertisingDataLen, manData, manDataLen); - - /* If the data is empty, skip the counter check */ - if (!advertiser_data_is_empty(pdata)) { - uint8_t diff = advertiser_data_counter_difference(pdata, manData, manDataLen); - if (diff == 0) { - /* Quit early if we've seen this packet */ - return; - } else if (diff > 1) { -#ifdef DEBUG - pc.printf("resetting: diff is %d\n\r", diff); -#endif - /* Reset the data if we missed a packet (likely lost signal for a while) */ - advertiser_data_reset(pdata); - advertiser_data_update_rssi(pdata, passdat); - } - } - - /* Update everything from the manufacturer data */ - advertiser_data_update(pdata, manData, manDataLen); - - // TODO: implement the rest of the algorithms - advertiser_data_print(pdata); - }else if(params->peerAddr[5] == 0xe6 && params->peerAddr[4] == 0x4f) { - pc.printf("ADVERTISER 2\n\r"); #ifdef DEBUG for (unsigned index = 0; index < params->advertisingDataLen; index++) { pc.printf("%02x ", params->advertisingData[index]);
diff -r 7593fe102c55 -r d0e05234fd95 mbed.bld --- a/mbed.bld Wed Jul 29 17:14:40 2015 +0000 +++ b/mbed.bld Wed Jul 29 21:34:18 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/da0ca467f8b5 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81 \ No newline at end of file
diff -r 7593fe102c55 -r d0e05234fd95 nRF51822.lib --- a/nRF51822.lib Wed Jul 29 17:14:40 2015 +0000 +++ b/nRF51822.lib Wed Jul 29 21:34:18 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#6c82f06746bb +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#c7adea3c1e37