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

Temporaily Stopping Advertising

Our product has a legacy interface and for security reasons I want to allow users to disable or enable the BLE via this legacy interface.

My approach to this was to disable or enable advertising. Is this the correct approach? What happens if a connection is active?

Parents
  • Peripherals stop advertising on a connection and under 4.0 of the spec a peripheral could only have one master. I'm not sure where the spec is at at the moment, it may have eased (or be easing) up where a peripheral could have more than one master and so would be allowed to continue advertising even in a connection. But it would be application controlled anyway. With Nordic's BLE UART example, on connection the peripheral stops advertising. So if you were to disable advertising in a connection so it wouldn't restart upon the connection closing it wouldn't affect the connection. If you wanted to also disable any connections while at the same time as disabling advertising you could call sd_ble_gap_disconnect() which should close out the connection. Your peripheral wouldn't be discoverable/connectable until it recommenced advertising again which sounds like what you are after.

Reply
  • Peripherals stop advertising on a connection and under 4.0 of the spec a peripheral could only have one master. I'm not sure where the spec is at at the moment, it may have eased (or be easing) up where a peripheral could have more than one master and so would be allowed to continue advertising even in a connection. But it would be application controlled anyway. With Nordic's BLE UART example, on connection the peripheral stops advertising. So if you were to disable advertising in a connection so it wouldn't restart upon the connection closing it wouldn't affect the connection. If you wanted to also disable any connections while at the same time as disabling advertising you could call sd_ble_gap_disconnect() which should close out the connection. Your peripheral wouldn't be discoverable/connectable until it recommenced advertising again which sounds like what you are after.

Children
Related