RedBearLab/nRF51822-Arduino

Does eddystone works for Arduino-SDK?

chenchen-hci opened this issue · 0 comments

I am currently using RedBear BLE to act as an EddyStone beacon with Arduino being used as firmware development platform.

The example code of BLE ibeacon works great on my board, however I don’t know how to enable EddyStone service and EddyStone configure service. After looking through the library code, I can see the provided Arduino SDK has such capabilities. The libraries of eddystone and eddystoneservices can be referred to following file:

~/.arduino15/packages/RedBear/hardware/nRF51822/1.0.8/cores/RBL_nRF51822/ble-master/ble/services/EddystoneService.h

and

~/.arduino15/packages/RedBear/hardware/nRF51822/1.0.8/cores/RBL_nRF51822/ble-master/ble/services/EddystoneConfigService.h

Here are the simple starter code I wrote, could you please indicate where the problems may be:

#include "EddystoneService.h"
BLEDevice ble; 
EddystoneService *eddyServicePtr;

void setup() {
  pinMode(LED, OUTPUT);
  digitalWrite(LED, HIGH);
  ble.init(); 
  eddyServicePtr = new EddystoneService(ble);   // period = 100ms, tx = 0
  eddyServicePtr->start();
  ble.setAdvertisingType(GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED);
  ble.setAdvertisingInterval(160); 
  ble.setAdvertisingTimeout(0);
  ble.startAdvertising();
}

void loop() {}

Also I will be very appreciated if you can indicate me some example codes for different kinds of services.