-
Couldn't load subscription status.
- Fork 227
Louisza patch phy #405
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
Louisza patch phy #405
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| name=ArduinoBLE | ||
| version=1.4.1 | ||
| name=ArduinoBLE-CodedPHY | ||
| version=1.4.2-custom | ||
| author=Arduino | ||
| maintainer=Arduino <[email protected]> | ||
| sentence=Enables Bluetooth® Low Energy connectivity on the Arduino MKR WiFi 1010, Arduino UNO WiFi Rev2, Arduino Nano 33 IoT, Arduino Nano 33 BLE, Nicla Sense ME and UNO R4 WiFi. | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,10 @@ | |||||||
|
|
||||||||
| #include "BLEDevice.h" | ||||||||
|
|
||||||||
| #include "ble/AdvertisingParameters.h" | ||||||||
| #include "ble/Gap.h" | ||||||||
|
|
||||||||
|
|
||||||||
| extern "C" int strcasecmp(char const *a, char const *b); | ||||||||
|
|
||||||||
| BLEDevice::BLEDevice() : | ||||||||
|
|
@@ -576,3 +580,25 @@ bool BLEDevice::discovered() | |||||||
| return (_advertisementTypeMask & 0x18) != 0; | ||||||||
| } | ||||||||
|
|
||||||||
| void BLEDevice::setTxPower(int8_t dbm) { | ||||||||
| if (!_ble_interface.hasInitialized()) return; | ||||||||
| _ble_interface.gap().setTxPower(dbm); | ||||||||
| } | ||||||||
|
|
||||||||
| void BLEDevice::enableCodedPHYAdvertising(bool enabled) { | ||||||||
| if (!_ble_interface.hasInitialized()) return; | ||||||||
|
|
||||||||
| ble::AdvertisingParameters advParams( | ||||||||
| ble::advertising_type_t::NON_CONNECTABLE_UNDIRECTED, | ||||||||
| ble::adv_interval_t(ble::millisecond_t(200)) | ||||||||
|
||||||||
| ble::adv_interval_t(ble::millisecond_t(200)) | |
| ble::adv_interval_t(ble::millisecond_t(DEFAULT_ADVERTISING_INTERVAL_MS)) |
Copilot
AI
Aug 4, 2025
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 comment is unclear about when this automatic TX power setting occurs versus when setTxPower() should be used. This could confuse users about the intended API usage pattern.
Copilot
AI
Aug 4, 2025
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.
Hardcoded TX power value (4) should be made configurable or removed. This conflicts with the separate setTxPower() method and creates unexpected behavior where enabling Coded PHY always sets power to 4 dBm.
| // Set TX power here if not using setTxPower separately | |
| gap.setTxPower(4); | |
| // TX power should be set via setTxPower() if needed |
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 advertising type is hardcoded to NON_CONNECTABLE_UNDIRECTED, which may not be appropriate for all use cases. Consider making this configurable or using the existing advertising configuration.