Bluetooth LE (BLE)

BleAdvertisingDataType::FLAGS

The valid values for advertising data type flags are:

  • BLE_SIG_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01)
  • BLE_SIG_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02)
  • BLE_SIG_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04)
  • BLE_SIG_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08)
  • BLE_SIG_ADV_FLAG_LE_BR_EDR_HOST (0x10)
  • BLE_SIG_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (0x05)
  • BLE_SIG_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (0x06)

The most commonly used is BLE_SIG_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE: supports Bluetooth LE only in general discovery mode. Any nearby device can discover it by scanning. Bluetooth Basic Rate/Enhanced Data Rate (BR/EDT) is not supported.

You normally don't need to include BleAdvertisingDataType::FLAGS, however. If you do not include it, one will be inserted automatically.

// EXAMPLE

// In setup():
BleAdvertisingData advData;

uint8_t flagsValue = BLE_SIG_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
advData.append(BleAdvertisingDataType::FLAGS, &flagsValue, sizeof(flagsValue));

advData.appendServiceUUID(healthThermometerService);

BLE.advertise(&advData);