This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[NRF51822] How to set device to Non-discovery Mode?

I have 3 questions: 1. How to set device to non-discovery mode? 2. Once the device is in non-discovery mode, How can host connect to it? 3. Can I use Master Control Panel to connect device which is in non-discovery mode?

Parents
  • What exactly do you mean by "non-discovery mode"?

    If you just mean to send advertising packets, but not be neither General Discoverable nor Limited Discoverable, this is done just by not using those flags when setting the advertising data, i.e. using BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED and not BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE or BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.

    However, if you mean to not send advertisement packets at all, you'll have to either explicitly stop advertising using sd_ble_gap_adv_stop() or wait for a timeout, and in this case, no device will be able to connect to you.

Reply
  • What exactly do you mean by "non-discovery mode"?

    If you just mean to send advertising packets, but not be neither General Discoverable nor Limited Discoverable, this is done just by not using those flags when setting the advertising data, i.e. using BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED and not BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE or BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.

    However, if you mean to not send advertisement packets at all, you'll have to either explicitly stop advertising using sd_ble_gap_adv_stop() or wait for a timeout, and in this case, no device will be able to connect to you.

Children
  • Thank you for your reply. I mean, if there's a way to make host can connect to my nrf51822 device, and also to make nrf51822 device not be displayed in the ble device list of host? BTW, if I use BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED to set advertising data, what mode is my device actually in? I try to do this, It can still be displayed in MCP.

  • All advertising packets can be received by any scanner, and it is hence up to the filtering done on the scanner to decide whether or not a device is shown. Even when advertising with just BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (neither Limited nor General discoverable), some scanners may choose to show this device when scanning, and there isn't anything you can do to avoid this. This is what's called "Non-discoverable Mode" in section 9.2.2 in Volume 3, Part C of the Core Specification.

  • A general question? What is the use-case where a BLE device will send an advertisement packet when in non-discoverable mode? I.e what is the point in doing this since technically there is no discovery procedure to look for advertisements in which limited discoverable mode is not set and general discoverable mode is not set.

Related