Test for export ti uv2/emblocks
Dependencies: BLE_API mbed-src nRF51822
Fork of BLE_HTM_by_InTempSensr by
Revision 2:97bfd761b6c3, committed 2015-10-07
- Comitter:
- rapzak
- Date:
- Wed Oct 07 19:45:13 2015 +0000
- Parent:
- 1:ed4b9dcade96
- Commit message:
- Test for export to uv2/emblocks
Changed in this revision
--- a/BLE_API.lib Fri Jan 30 07:54:51 2015 +0000 +++ b/BLE_API.lib Wed Oct 07 19:45:13 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#1407d2f1ce3c +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#d494ad3e87bd
--- a/main.cpp Fri Jan 30 07:54:51 2015 +0000 +++ b/main.cpp Wed Oct 07 19:45:13 2015 +0000 @@ -15,14 +15,14 @@ */ #include "mbed.h" -#include "BLEDevice.h" -#include "ble_hrs.h" -#include "ble_hts.h" +#include "BLE.h" +#include "HeartRateService.h" //ble_hrs.h +#include "HealthThermometerService.h" //ble_hts.h #include "nrf_soc.h" // for internal Thermo sensoer // nRF51822n nrf; /* BLE radio driver */ -BLEDevice ble; +BLE ble; DigitalOut led1(LED1); DigitalOut led2(LED2); uint8_t cnt; @@ -70,24 +70,24 @@ void Update_Values(); -void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason) // Mod +void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params) // Mod { - DEBUG("Disconnected handle %u!\n\r", handle); + //DEBUG("Disconnected handle %u!\n\r", handle); DEBUG("Restarting the advertising process\n\r"); led2 = 0; ble.startAdvertising(); } -void onConnectionCallback(Gap::Handle_t handle,Gap::addr_type_t peerAddrType, const Gap::address_t peerAddr, const Gap::ConnectionParams_t *params) //Mod +void onConnectionCallback(const Gap::ConnectionCallbackParams_t *params) //Mod { - DEBUG("connected. Got handle %u\r\n", handle); + //DEBUG("connected. Got handle %u\r\n", handle); connectionParams.slaveLatency = 1; led2 = 1; - if (ble.updateConnectionParams(handle, &connectionParams) != BLE_ERROR_NONE) { - DEBUG("failed to update connection paramter\r\n"); - } + //if (ble.updateConnectionParams(const Gap::ConnectionCallbackParams_t *params) { + // DEBUG("failed to update connection paramter\r\n"); + //} } @@ -118,8 +118,8 @@ ticker.attach(periodicCallback, 1.0 ); DEBUG("Initialising the nRF51822\n\r"); ble.init(); - ble.onDisconnection(disconnectionCallback); - ble.onConnection(onConnectionCallback); + ble.gap().onDisconnection(disconnectionCallback); + ble.gap().onConnection(onConnectionCallback); ble.getPreferredConnectionParams(&connectionParams);
--- a/mbed-src.lib Fri Jan 30 07:54:51 2015 +0000 +++ b/mbed-src.lib Wed Oct 07 19:45:13 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-src/#84b15e04105a +http://mbed.org/users/mbed_official/code/mbed-src/#a11c0372f0ba
--- a/nRF51822.lib Fri Jan 30 07:54:51 2015 +0000 +++ b/nRF51822.lib Wed Oct 07 19:45:13 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#0e7a9efee6d7 +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#088f5738bf18