Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API nRF51822
Fork of Puck by
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
--- 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
--- 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);
--- 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
