Bluetooth LE (BLE)
BleAdvertisingParams
To set the parameters for advertising, you can use the BleAdvertisingParams structure:
// PROTOTYPE
uint16_t version;
uint16_t size;
uint16_t interval;
uint16_t timeout;
hal_ble_adv_evt_type_t type;
uint8_t filter_policy;
uint8_t inc_tx_power;
uint8_t reserved;
// EXAMPLE
BleAdvertisingParams param;
param.version = BLE_API_VERSION;
param.size = sizeof(BleAdvertisingParams);
int res = BLE.getAdvertisingParameters(¶m);
version
Always set toBLE_API_VERSION
.size
Always set tosizeof(BleAdvertisingParams)
.interval
Advertising interval in 0.625 ms units. Default is 160.timeout
Advertising timeout in 10 ms units. Default is 0.type
SeeBleAdvertisingEventType
. Default isCONNECTABLE_SCANNABLE_UNDIRECTED
(0).filter_policy
Default is 0.inc_tx_power
Default is 0.