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

Documentation to support PR #2287, Add Support for Advertising and Scanning for BLE 5 PHY_CODED #1144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/content/reference/device-os/firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -8394,7 +8394,7 @@ See [`BleScanParams`](/reference/device-os/firmware/#blescanparams) for more inf

#### BLE.setScanParameters()

Sets the parameters used for scanning. Typically you will only ever need to change the scan timeout, but if you need finer control you can use this function.
Sets the parameters used for scanning. Typically you will only ever need to change the scan timeout, but if you need finer control you can use this function. Also used to set up scanning for devices advertising in BLE 5 Coded Phy mode.

```cpp
// PROTOTYPE
Expand Down Expand Up @@ -9662,6 +9662,7 @@ uint16_t timeout;
hal_ble_adv_evt_type_t type;
uint8_t filter_policy;
uint8_t inc_tx_power;
uint8_t primary_phy;
uint8_t reserved;

// EXAMPLE
Expand All @@ -9677,6 +9678,7 @@ int res = BLE.getAdvertisingParameters(&param);
- `timeout` Advertising timeout in 10 ms units. Default is 0.
- `type` See [`BleAdvertisingEventType`](/reference/device-os/firmware/#bleadvertisingeventtype). Default is `CONNECTABLE_SCANNABLE_UNDIRECTED` (0).
- `filter_policy` Default is 0.
- `primary_phy` Default is BLE_PHY_1MBPS (standard). Set to BLE_PHY_CODED for BLE 5 Coded Phy (long range).
- `inc_tx_power` Default is 0.

### BleScanParams
Expand All @@ -9691,6 +9693,7 @@ uint16_t interval;
uint16_t window;
uint16_t timeout; uint8_t active;
uint8_t filter_policy;
uint8_t scan_phys;

// EXAMPLE
BleScanParams scanParams;
Expand All @@ -9706,6 +9709,7 @@ int res = BLE.getScanParameters(&scanParams);
- `timeout` Scan timeout in 10 ms units. Default value is 500.
- `active` Boolean value, typically 1.
- `filter_policy` Default is 0.
- `scan_phys` Default is BLE_PHYS_1MBPS. Use BLE_PHYS_CODED to scan for Coded Phy, or (BLE_PHYS_1MBPS | BLE_PHYS_CODED) to scan for both.

### iBeacon

Expand Down