sandeepmistry / arduino-BLEPeripheral

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

BLEHIDPeripheral setBondStore #132

Open llemtt opened 7 years ago

llemtt commented 7 years ago

Hi,

how can I correctly set the BondStore of a BLEHIDPeripheral?

If I call bleHIDPeripheral.setBondStore(...) the BLEPeripheral class method gets called which doesn't update the _bleBondStore private field. Calling bleHIDPeripheral.setup() then overrides my previous call...

Thanks

sandeepmistry commented 7 years ago

@llemtt why do you need to override the BondStore?

llemtt commented 7 years ago

My current project runs on a BLE Nano and requires a different flash page for the BondStore because offset=0 overwrites the bootloader!

I managed this modifying the library source code, definitely not the right way to do it.

Besides that, if I understood correctly, setBondStore(...) purpose is to let the developer supply even a completely different store location like for instance an external eeprom.

sandeepmistry commented 7 years ago

Oh got it, why don't we just change the default offset on the BLE Nano to be non-zero?

What do you think? Do you have time to submit a pull request?

sandeepmistry commented 7 years ago

@llemtt ping ...