sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
463 stars 180 forks source link

offset = offset?? #116

Closed MarqueIV closed 7 years ago

MarqueIV commented 7 years ago

Trying to figure out why I can't get my iPhone to reconnect to my RedBearLabs devices (Blend Micro, BLE Shield, BLE Nano) when they power-cycle using your INCS example script. Started to dig around in your BLEBondStore code and I saw something odd...

offset = offset;

Is there some reason that exists? Did you forget an underscore (I also see _offset in the code so I'm not sure.)

More importantly, how can one use the BLEBondStore (or whatever you're supposed to) with the RBL boards and have them remember the connection when the boards are power-cycled? (note: not re-flashed... simply power-cycled.)

sandeepmistry commented 7 years ago

@MarqueIV

Is there some reason that exists? Did you forget an underscore (I also see _offset in the code so I'm not sure.)

That is to prevent a compiler warning.

Please try changing:

BLEBondStore                     bleBondStore;

to

BLEBondStore                     bleBondStore(1);