问题
What happens to connection with BLE device connection when Android goes in sleep mode? So if application establishes a connection with BLE device and then Android goes sleep, will the connection be maintained? Will the application be informed about disconnects or re-connection?
回答1:
BLE is devided in two parts,
- physical layer and link layer implemented in the BLE controller (frontend)
- upper layers implemented on host side (Android system)
both parts connect via the HCI interface. (Which you by the way can sniff using the developer options).
So that means that while the host is in sleep mode the BLE frontend can still maintain connections and wake the host in case it needs some reactions from it (e.g. connection has dropped or some data packet for higher layers came in).
This allows a very energy efficient implementation.
来源:https://stackoverflow.com/questions/29118771/what-happens-to-connection-with-ble-device-when-android-goes-in-sleep-mode