-
-
Notifications
You must be signed in to change notification settings - Fork 284
CurieBLE: add broadcast property to characteristic #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, Don: I have not use the broadcast() API before in the previous library. However, I have used the BLENotify option in a Characteristic in one of my Peripheral sketches. To notify the connected Central for data ready, my sketch just need to use the setValue() API to set the local buffer with the data. The BLE library takes care of the notification process. There is no specific API to call to prompt the library to perform a notification. I would think the broadcast option to be similar. |
@SidLeung BLENotify requires a connection between the client and the server. BLEBroadcast allows me to send data without a connection. I created a demo sketch for you. I ran it on a RFduino, but it'll work on RedBear Nano or other boards supported by BLEPeripheral. The peripheral increments a counter and sets the characteristic value. Since the characteristic is marked as broadcast, the advertising data is updated whenever the value changes. This allows a my phone to get the counter value when scanning. I don't need to connect to get the data.
https://gist.github.com/don/536d9f1d605d9bfffcd99b5716a72cb4 |
Have created a Jira ticket internally to look into BLE broadcasting in the 101 stack. Will post any result here. |
@SidLeung thanks! |
@don Please change this line The sketch can works. |
@don , is it possible to use your sketch as an example as part of the coreLibs release? If so, please add an licensing header and we will pull it into the next release. Thanks. |
Hi @don. Thank you for your contribution. We love your sample code and have created a PR #437 with it. We need your written approval that we can include your code in our package, in the form of a software license. Arduino 101 CoreLibs is distributed under LGPLv2.1+ license and you can choose any software license that is compatible with LGPLv2.1+. According to Wikiepedia, it can be
Please let me know once you've decided on a license. I can help you apply it onto the code. Thank you. |
EddystoneURL sample with Curie 2.0.2: |
I was porting some BLEPeripheral code to the Arduino 101 and noticed that BLEBroadcast is missing from CurieBLE.
I'd like to be able to add the BLEBroadcast property to a Characteristic. setValue should update the advertising data when the characteristic's value changes.
The text was updated successfully, but these errors were encountered: