sandeepmistry / arduino-BLEPeripheral

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

Transmite Eddystone URI and UID data simultaneously #80

Closed danielcbit closed 8 years ago

danielcbit commented 8 years ago

Hi, I'm playing with Eddystone examples for nRF 8001 and I saw that in the current code you can transmit only one type of payload. How would I accomplish transmitting them "simultaneously"(change the advertising payload at each publish)?

sandeepmistry commented 8 years ago

Hi @danielcbit,

I think you can try modifying the Eddystone beacon code to call toggle between the following

after calling begin.

Since the advertising interval is 100ms, you'll have to toggle at a less frequent interval than this.

I'm closing this for now, feel free to continue the discussion though. Pull request welcome for the new example along with setUid API to make things cleaner.

danielcbit commented 8 years ago

Hi @sandeepmistry. I would have to toggle between those in the loop method, right?

sandeepmistry commented 8 years ago

I would recommend it, two options for delaying are using:

danielcbit commented 8 years ago

Only mils() actually, since delay() stops the code execution so it is not a good idea.

Nice, I'll work on these patchs. I will add support for ESP8266 as well, I have a patch already. This is my current platform.

sandeepmistry commented 8 years ago

@danielcbit sounds good, looking forward to seeing your patches.