2021-06-09 11:09 PM
I have one more confusion regarding BLE connection.
For the case in low power mode,
If device is already paired and connection is established, do we need to continuously advertise packets at regular intervals for connection to keep intact and to provide BLE service? The purpose of this question is to know if I can completely put the device into sleep for few minutes (let's say 15 mins) without sending advertising packets ?
Solved! Go to Solution.
2021-06-14 06:33 AM
Advertising packets are for the advertising phase assuming you are a peripheral. During this phase, the peripheral device is listening for any connection request coming from another device in between 2 advertising activity on 2 different advertising channels. As long as no other device sends a connection request, the peripheral device keeps on advertising.
After a connection request, the peripheral device starts the connection process. Once connected, the connection is based on regular data exchanges defined at the time the communication is established. You do not have to care about keeping the connection active anymore. This is managed by the RF block with the BLE stack.
Note that the device enters low power mode in between each data exchanges.
If you want to stop the connection, just issue a ACI_GAP_TERMINATE function (see AN5270).
If the device you were connected with stops the connection , you will get an event informing your application that the connection with this device is stopped/lost.
Regarding your use case, you can decide to stop the connection and enter low power mode for such long duration (15mn) if your device is not doing anything else.
Or uou can also play with the slave latency which defines the number of connection intervals during which the peripheral device wont exchange data (so wont exit from low power mode).
Note that a peripheral device cannot initiate a connection. Only the device having a central role can request for a connection.
2021-06-14 06:33 AM
Advertising packets are for the advertising phase assuming you are a peripheral. During this phase, the peripheral device is listening for any connection request coming from another device in between 2 advertising activity on 2 different advertising channels. As long as no other device sends a connection request, the peripheral device keeps on advertising.
After a connection request, the peripheral device starts the connection process. Once connected, the connection is based on regular data exchanges defined at the time the communication is established. You do not have to care about keeping the connection active anymore. This is managed by the RF block with the BLE stack.
Note that the device enters low power mode in between each data exchanges.
If you want to stop the connection, just issue a ACI_GAP_TERMINATE function (see AN5270).
If the device you were connected with stops the connection , you will get an event informing your application that the connection with this device is stopped/lost.
Regarding your use case, you can decide to stop the connection and enter low power mode for such long duration (15mn) if your device is not doing anything else.
Or uou can also play with the slave latency which defines the number of connection intervals during which the peripheral device wont exchange data (so wont exit from low power mode).
Note that a peripheral device cannot initiate a connection. Only the device having a central role can request for a connection.