Bluetooth LE (BLE)


To set the parameters for advertising, you can use the BleAdvertisingParams structure:

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;

BleAdvertisingParams param;
param.version = BLE_API_VERSION;
param.size = sizeof(BleAdvertisingParams);
int res = BLE.getAdvertisingParameters(&param);
  • version Always set to BLE_API_VERSION.
  • size Always set to sizeof(BleAdvertisingParams).
  • interval Advertising interval in 0.625 ms units. Default is 160.
  • timeout Advertising timeout in 10 ms units. Default is 0.
  • type See BleAdvertisingEventType. Default is CONNECTABLE_SCANNABLE_UNDIRECTED (0).
  • filter_policy Default is 0.
  • inc_tx_power Default is 0.