nrf51-dk compile error

Ask, and ye shall receive.
RichardF
Posts: 2
Joined: 13:59, 24 Jun 2015

nrf51-dk compile error

Postby RichardF » 14:28, 24 Jun 2015

Hi all,

Richard is the name, playing with hardware is my game :-)

got an nrf51-dk board, and tried the tutorial on how to turn this board into a discoverable beacon through mbed,
followed all the steps mentioned in the tut, but when trying to compile, I am getting an error that BLEDevice.h could
not be found, is there some additional action needed? Please help me, this is very interesting stuff.

Richard

Amman
Posts: 14
Joined: 21:42, 19 Feb 2015

Re: nrf51-dk compile error

Postby Amman » 18:36, 04 Jul 2015

I have been working with Arduinos and as you described it seems
the BLEDevice.h is completely missing from your folder structure or misplaced.

As an example:

Code: Select all

Arduino
   -->Libraries  folder
       --> NRF51-DK folder
            => examples folder  (contains other example subfolders  and .ino)
            => BLEDevice.h


If that helps.

ardiri
Posts: 58
Joined: 16:13, 28 May 2014

Re: nrf51-dk compile error

Postby ardiri » 22:55, 08 Jul 2015

did you include the BLE libraries within the mbed compiler?

you may also want to take a look at the following post; there are some changes made to the API's which make the examples break.

viewtopic.php?f=8&t=1448&p=3802&hilit=nrf51+dk#p3802
// Aaron
Chief Technology Officer
Evothings AB http://www.evothings.com/

ardiri
Posts: 58
Joined: 16:13, 28 May 2014

Re: nrf51-dk compile error

Postby ardiri » 01:45, 09 Jul 2015

here is a patch to apply against the original source code that was available in the blog post

http://evothings.com/how-to-turn-a-nord ... sing-mbed/

as i mention in the other thread; ARM has changed the SDK slightly and BLEDevice.h has been renamed to BLE.h. i will be updating the zip file we have on the blog post and we will also need to reflect this as an update to our examples in the evothings studio download. for now; you will need to apply the patch yourself.

Code: Select all

$ 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);
// Aaron
Chief Technology Officer
Evothings AB http://www.evothings.com/

RichardF
Posts: 2
Joined: 13:59, 24 Jun 2015

Re: nrf51-dk compile error

Postby RichardF » 12:07, 20 Jul 2015

Back from holiday, tried the patch, and indeed, it is working now.

thanx !

ardiri
Posts: 58
Joined: 16:13, 28 May 2014

Re: nrf51-dk compile error

Postby ardiri » 01:06, 21 Jul 2015

great - i have since updated the blog post and asked the boys to update the examples repository.
// Aaron
Chief Technology Officer
Evothings AB http://www.evothings.com/


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 21 guests