If the BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE is not set successfully in the broadcast settings, it will result in an error of NRF_ERROR_INVALID_FLAGS when calling sd_ble_gap_adv_data_set. What should I do?
If the BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE is not set successfully in the broadcast settings, it will result in an error of NRF_ERROR_INVALID_FLAGS when calling sd_ble_gap_adv_data_set. What should I do?
Hi,
The issue here seems to be that the advertising flags you set are forming an invalid combination which is why you are seeing that error. Nordic recommends using predefined valid combinations. The flags field must use a valid combination of bits. Currently, you are using a single flag. Try using:
BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.
This is a combination of:
BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE and BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED.
Let me know if you have any further questions.
Best Regards,
Samruddhi
Hi
This is a combination of:
BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE and BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED,
This combination setting is fine.But I need that using a single flag BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE,Is this not allowed? Why? Is it due to the limitations of the Bluetooth protocol stack?
Best Regards,
zhg77
Hi,
BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE is 1 bit which has the value 0x02. On the other hand, BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE is a combination of 2 bits which gives the value of 0x06. The Bluetooth stack or SoftDevice only accepts certain flag values such as 0x06 or 0x05. If you try to use only BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE which has the value of 0x02, then it isn't an allowed combination and you will therefore receive that error.
Best Regards,
Samruddhi
Hi ,
OK,Thank you.
Best Regards,
zhg77
Hi ,
OK,Thank you.
Best Regards,
zhg77