services
Returns a flow emitting RemoteServices events.
State machine
Initially, the state is Unknown. Shortly after calling services the flow will emit Discovering state, followed by Discovered state, or (unlikely) Failed state, where the reason of the failure is given as a parameter Failed.reason.
When in Discovered or Failed, and the service will get invalidated, either due to a disconnection or Service Change indication sent from the remote peripheral, the state will transition to Unknown.
Service change will automatically request service discovery, which, when complete, will emit Discovered state with new set of services.
(Initial state)
│
┌───────────────> Unknown <────────────────┐
│ │ │
(disconnection) (service discovery started) (disconnection)
│ ↓ │
Failed <── (failure) ─── Discovering ─── (done) ──> DiscoveredReturn
A state flow with the current state of service discovery process. If the method was called with a uuids filter, the RemoteServices.Discovered state will contain only services with given UUIDs, otherwise it will contain all services returned by the system. If the returned list is empty, the service was not found on the peripheral.
Parameters
An optional list of service UUID to filter the results. If empty, all services will be returned. Some platforms may do partial service discovery and return only services with given UUIDs.