refreshCache
Refreshes the cached GATT database associated with the peripheral and starts new service discovery automatically.
All observers subscribed to invalidated attributes will be cancelled. The flows returned by services will emit an empty list of services following by updated list of services when the new service discovery is complete.
The peripheral must be in any state other then ConnectionState.Closed. It is safe to call this method when the peripheral is connected, connecting, or disconnecting. It may be called when the device is disconnected but only when the connection was made using AutoConnect option in which case the system is trying to reconnect.
A connection made using Direct option closes automatically immediately after disconnection.
When invoked when closed the method throws PeripheralClosedException.
Throws
If the peripheral is in Closed state.
If cache could not be refreshed.
If BLUETOOTH_CONNECT permission is denied.