-
Notifications
You must be signed in to change notification settings - Fork 3
💚 (GitHub): compile PlatformIO with C++17 #12
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
113a1f3
💚 (GitHub): compile PlatformIO with C++17
leon0399 a44b061
📝 Add Microchip Transparent UART
leon0399 53ed609
🐛 Fix NimBLE ^2 compatibility
leon0399 68d4f4d
👷 (GitHub): test PlatformIO with different NimBLE versions
leon0399 042e31f
👷 (GitHub): test Arduino CI with different NimBLE versions
leon0399 15d6b24
✏️ Update typos and docs
leon0399 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...les/SerialToSerialBLE_TransparentUART-NimBLE/SerialToSerialBLE_TransparentUART-NimBLE.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #include <BLESerial.h> | ||
|
|
||
| // FOR ETL: Uncomment the following lines | ||
| // #include <Embedded_Template_Library.h> | ||
| // #include <etl/queue.h> | ||
| // #include <etl/circular_buffer.h> | ||
|
|
||
| BLESerial SerialBLE; | ||
| // If you are using an older version of Arduino IDE or C++ compiler, you may need to use | ||
| // an empty template argument (<>), as Class Template Argument Deduction (CTAD) is not | ||
| // supported in C++ versions older than C++17. For more details, see: | ||
| // https://www.cppreference.com/w/cpp/language/ctad.html | ||
| // | ||
| // Uncomment the line below if you are using an older version of Arduino IDE/C++ compiler | ||
| // BLESerial<> SerialBLE; | ||
|
|
||
| // FOR ETL: Uncomment one of the following lines | ||
| // BLESerial<etl::queue<uint8_t, 255, etl::memory_model::MEMORY_MODEL_SMALL>> SerialBLE; | ||
| // OR | ||
| // BLESerial<etl::circular_buffer<uint8_t, 255>> SerialBLE; | ||
|
|
||
| void setup() { | ||
| BLEDevice::init("ESP32-BLE-Slave"); | ||
|
|
||
| BLEServer* pServer = BLEDevice::createServer(); | ||
|
|
||
| // Transparent UART Service | ||
| // https://developerhelp.microchip.com/xwiki/bin/view/applications/ble/android-development-for-bm70rn4870/transparent-uart-service-for-bm70rn4870/ | ||
| auto pService = pServer->createService("49535343-FE7D-4AE5-8FA9-9FAFD205E455"); | ||
|
|
||
| auto pRxCharacteristic = pService->createCharacteristic("49535343-1E4D-4BD9-BA61-23C647249616", NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::WRITE_NR | NIMBLE_PROPERTY::NOTIFY); | ||
| auto pTxCharacteristic = pService->createCharacteristic("49535343-8841-43F4-A8D4-ECBE34729BB3", NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY); | ||
|
|
||
| SerialBLE.begin(pRxCharacteristic, pTxCharacteristic); | ||
|
|
||
| BLEAdvertising* pAdvertising = pServer->getAdvertising(); | ||
| pAdvertising->start(); | ||
| } | ||
|
|
||
| void loop() { | ||
| if (Serial.available()) { | ||
| SerialBLE.write(Serial.read()); | ||
| SerialBLE.flush(); | ||
| } | ||
| if (SerialBLE.available()) { | ||
| Serial.write(SerialBLE.read()); | ||
| } | ||
| } |
48 changes: 48 additions & 0 deletions
48
examples/SerialToSerialBLE_TransparentUART/SerialToSerialBLE_TransparentUART.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #include <BLESerial.h> | ||
|
|
||
| // FOR ETL: Uncomment the following lines | ||
| // #include <Embedded_Template_Library.h> | ||
| // #include <etl/queue.h> | ||
| // #include <etl/circular_buffer.h> | ||
|
|
||
| BLESerial SerialBLE; | ||
| // If you are using an older version of Arduino IDE or C++ compiler, you may need to use | ||
| // an empty template argument (<>), as Class Template Argument Deduction (CTAD) is not | ||
| // supported in C++ versions older than C++17. For more details, see: | ||
| // https://www.cppreference.com/w/cpp/language/ctad.html | ||
| // | ||
| // Uncomment the line below if you are using an older version of Arduino IDE/C++ compiler | ||
| // BLESerial<> SerialBLE; | ||
|
|
||
| // FOR ETL: Uncomment one of the following lines | ||
| // BLESerial<etl::queue<uint8_t, 255, etl::memory_model::MEMORY_MODEL_SMALL>> SerialBLE; | ||
| // OR | ||
| // BLESerial<etl::circular_buffer<uint8_t, 255>> SerialBLE; | ||
|
|
||
| void setup() { | ||
| BLEDevice::init("ESP32-BLE-Slave"); | ||
|
|
||
| BLEServer* pServer = BLEDevice::createServer(); | ||
|
|
||
| // Transparent UART Service | ||
| // https://developerhelp.microchip.com/xwiki/bin/view/applications/ble/android-development-for-bm70rn4870/transparent-uart-service-for-bm70rn4870/ | ||
| auto pService = pServer->createService("49535343-FE7D-4AE5-8FA9-9FAFD205E455"); | ||
|
|
||
| auto pRxCharacteristic = pService->createCharacteristic("49535343-1E4D-4BD9-BA61-23C647249616", BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY); | ||
| auto pTxCharacteristic = pService->createCharacteristic("49535343-8841-43F4-A8D4-ECBE34729BB3", BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY); | ||
|
|
||
| SerialBLE.begin(pRxCharacteristic, pTxCharacteristic); | ||
|
|
||
| BLEAdvertising* pAdvertising = pServer->getAdvertising(); | ||
| pAdvertising->start(); | ||
| } | ||
|
|
||
| void loop() { | ||
| if (Serial.available()) { | ||
| SerialBLE.write(Serial.read()); | ||
| SerialBLE.flush(); | ||
| } | ||
| if (SerialBLE.available()) { | ||
| Serial.write(SerialBLE.read()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| { | ||||||
| "$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json", | ||||||
| "name": "Serial_BLE", | ||||||
| "version": "1.1.3", | ||||||
| "version": "1.2.0", | ||||||
| "description": "Customizable Arduino and ESP32 BLE Serial library, compliant with Nordic UART Service and others.", | ||||||
| "keywords": [ | ||||||
| "serial", | ||||||
|
|
@@ -46,6 +46,6 @@ | |||||
| "srcDir": "src" | ||||||
| }, | ||||||
| "dependencies": { | ||||||
| "ESP32 BLE Arduino": "^2.0.0" | ||||||
| "BLE": "^2.0.0" | ||||||
|
||||||
| "BLE": "^2.0.0" | |
| "ESP32 BLE Arduino": "^2.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| name=Serial_BLE | ||
| version=1.1.3 | ||
| version=1.2.0 | ||
| author=Leonid Meleshin <[email protected]> | ||
| maintainer=Leonid Meleshin <[email protected]> | ||
| sentence=Customizable BLE Serial (UART) library. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PLATFORMIO_BUILD_UNFLAGS environment variable appears to be incorrectly indented and may not be properly associated with the build step. It should be indented at the same level as PLATFORMIO_CI_SRC.