Fork of Nordic's 'Puck' library
Dependencies: BLE_API nRF51822
Fork of Puck by
Fixes for changes in BLE_API. Affects only `Puck.h`. Don't use this if fixed upstream.
Revision 25:831f72375d05, committed 2015-06-29
- Comitter:
- OJFord
- Date:
- Mon Jun 29 18:59:40 2015 +0000
- Parent:
- 24:cd6703df9501
- Commit message:
- Fixes for name changes affecting `Puck.h`
Changed in this revision
diff -r cd6703df9501 -r 831f72375d05 BLE_API.lib --- a/BLE_API.lib Mon Mar 09 13:38:22 2015 +0000 +++ b/BLE_API.lib Mon Jun 29 18:59:40 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#1956023d42fb +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#9f4251b3355c
diff -r cd6703df9501 -r 831f72375d05 Puck.h --- a/Puck.h Mon Mar 09 13:38:22 2015 +0000 +++ b/Puck.h Mon Jun 29 18:59:40 2015 +0000 @@ -18,7 +18,7 @@ #ifndef __PUCK_HPP__ #define __PUCK_HPP__ -#include "BLEDevice.h" +#include "BLE.h" #include "mbed.h" #include "Log.h" #include <vector> @@ -49,7 +49,7 @@ Puck(const Puck&); Puck& operator=(const Puck&); - BLEDevice ble; + BLE ble; uint8_t beaconPayload[25]; PuckState state; std::vector<GattService*> services; @@ -64,7 +64,7 @@ public: static Puck &getPuck(); - BLEDevice &getBle() { return ble; } + BLE &getBle() { return ble; } PuckState getState() { return state; } void setState(PuckState state); void init(uint16_t minor); @@ -97,16 +97,13 @@ Puck::getPuck().setState(DISCONNECTED); } -void onConnection(Gap::Handle_t handle, - Gap::addr_type_t peerAddrType, - const Gap::address_t peerAddr, - const Gap::ConnectionParams_t * connectionParams) { +void onConnection(const Gap::ConnectionCallbackParams_t*) { LOG_INFO("Connected.\n"); Puck::getPuck().setState(CONNECTED); } -void onDataWrittenCallback(const GattCharacteristicWriteCBParams *context) { - Puck::getPuck().onDataWritten(context->charHandle, context->data, context->len); +void onDataWrittenCallback(const GattWriteCallbackParams *context) { + Puck::getPuck().onDataWritten(context->handle, context->data, context->len); } bool isEqualUUID(const UUID* uuidA, const UUID uuidB) { @@ -203,7 +200,7 @@ } ble.init(); - LOG_DEBUG("Inited BLEDevice.\n"); + LOG_DEBUG("Inited BLE.\n"); setState(DISCONNECTED); char deviceName[10]; @@ -231,7 +228,7 @@ for(int i = 0; i < services.size(); i++) { ble.addService(*services[i]); - LOG_DEBUG("Added service %x to BLEDevice\n", services[i]); + LOG_DEBUG("Added service %x to BLE\n", services[i]); } LOG_INFO("Inited puck as 0x%X.\n", minor);
diff -r cd6703df9501 -r 831f72375d05 nRF51822.lib --- a/nRF51822.lib Mon Mar 09 13:38:22 2015 +0000 +++ b/nRF51822.lib Mon Jun 29 18:59:40 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#0e7a9efee6d7 +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#7c68c8d67e1f