Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for the nRF51-dk example #162

Open
ghost opened this issue Jul 9, 2015 · 0 comments
Open

Patch for the nRF51-dk example #162

ghost opened this issue Jul 9, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 9, 2015

Here is a patch from Aaron for the nRF51-dk example, which we have bundled in Evothings Studio.

Related posts:

http://evothings.com/how-to-turn-a-nordic-semiconductor-nrf51-dk-into-a-discoverable-beacon-using-mbed/
http://evothings.com/forum/viewtopic.php?f=8&t=1468
http://evothings.com/forum/viewtopic.php?f=8&t=1448

Original blog post updated by Aaron.

Here is the patch:

===
$ diff -ruN main.cpp.orig main.cpp
--- main.cpp.orig   2015-07-09 08:42:00.000000000 +0800
+++ main.cpp   2015-07-09 08:43:19.000000000 +0800
@@ -6,7 +6,7 @@
 #define CONSOLE_LOG 

 #include "mbed.h"
-#include "BLEDevice.h"
+#include "BLE.h"

 //-------------------------------------------------------------------------

@@ -116,10 +116,7 @@

 //-------------------------------------------------------------------------

-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 *params)
 {
   INFO_NL(">> connected");

@@ -128,10 +125,10 @@
   onLedDataWritten(&led_value, 1); // force LED's to be in off state
 }

-void onDataWritten(const GattCharacteristicWriteCBParams *context) 
+void onDataWritten(const GattWriteCallbackParams *context) 
 {
   // was the characteristic being written to nRF51_GATT_CHAR_LED? 
-  if (context -> charHandle == 
+  if (context -> handle == 
       gatt_characteristics[CHARACTERISTIC_LED] -> getValueHandle())
   {
     onLedDataWritten(context -> data, context -> len);
===
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants