What API can be used to query the state (connected/unconnected) of a peripheral? I see the state change callback where i could keep track of it with a global variable, but was wondering if there is an API in BLE stack where this could be queried from different tasks.
Thanks.