Skip to content
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

BLE upgrades #8724

Merged
merged 18 commits into from
Oct 6, 2023
Merged

BLE upgrades #8724

merged 18 commits into from
Oct 6, 2023

Conversation

me-no-dev
Copy link
Member

Redo of: #7867

General:

BREAKING CHANGE! Changed API return and parameter type from std::tring to Arduino style String.
Renamed library name from ESP32 BLE Arduino to simple BLE.
Created a new function getFrame which returns complete data for BLEAdvertisementData::addData().
Renamed example files - removed prefix BLE_ - BLE5_ is left unchanged.
Beacon_Scanner example updated to reflect changes in API - shortened by 28 lines on TLM and URL part.
Changed UUID data type from uint16_t to BLEUUID class

Eddysstone URL:

Created a new constructor which takes as an argument a BLEAdvertisedDevice object and initializes URL data from the payload.
Created a new function BLEEddystoneURL::setSmartURL which encodes the full URL structure.

Static frame data no longer needs to be written by the user - they are initialized by the constructor.
Function BLEEddystoneURL::setPower now accepts esp_power_level_t.
Updated EddystoneURL_Beacon example to reflect changes in API - shortened by 83 lines.
Added comments with explanations to functions setData and setURL.

Tests:
EddystoneURL_Beacon with the following URLs and read them in Beacon_Scanner example and using an Android app nRF Connect for Mobile.

char unprintable[] = {0x01, 0xFF, 0xDE, 0xAD};
String URL[] = {
"http://www.espressif.com/", // prefix 0x00, suffix 0x00
"https://www.texas.gov",     // prefix 0x01, suffix 0x0D
"http://en.mapy.cz",         // prefix 0x02, no valid suffix
"https://arduino.cc",        // prefix 0x03, no valid suffix
"google.com",                // URL without specified prefix - the function will assume default prefix "http://www." = 0x00
"diginfo.tv",                // URL without specified prefix - the function will assume default prefix "http://www." = 0x00
"http://www.URLsAbove17BytesAreNotAllowed.com", // Too long URL - setSmartURL() will return 0 = ERR
String(unprintable) // Unprintable characters - setSmartURL() will return 0 = ERR

Eddystone TLM:

Created a new constructor which takes as an argument a BLEAdvertisedDevice object and initializes TLM data from the payload.
Added comments with explanations to functions setData and setVolt

TODO: test all examples if they are properly working - changes related to the String might have broken something!

Related task: #7841

@me-no-dev me-no-dev mentioned this pull request Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants