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

allow advertising updates at runtime #198

Open floe opened 6 years ago

floe commented 6 years ago

I have a usecase where I want to update the advertisement data while the system is running. A hacky solution is to simply call begin() again, but that essentially resets the SoC and also leaks memory. I've refactored the advertisement code so it can be called independently using startAdvertising().

Best, Florian

sandeepmistry commented 6 years ago

@floe thanks for submitting, I'll leave this open for now. I'd like to ensure it's doable and compatible on nRF8001 as well.

floe commented 6 years ago

OK, thanks. I don't have access to an nRF8001 at the moment, and the code looks quite ... involved ;-), so I'll leave this as-is at the moment.