Synchronous client request
A client creates a handle, connects to a service, and sends a request. The client waits for the response up to a timeout. The caller owns the request and response storage for the duration of the call. A successful transport return means that a response was received and decoded; service-level result fields still need to be checked. The flow is:- Create a QMI handle with a callback for service events.
- Connect the handle to a service by service ID and instance ID.
- Send a request and wait for the response (up to a timeout).
- Check the response for success or failure.
- Destroy the handle when done.
Asynchronous client request
A client sends a request without waiting for the response. The response callback is called when the response arrives. The callback context should contain all state needed to complete the request. It must be released only after the callback runs or the request is cancelled according to the interface’s lifetime rules. The flow is:- Create a QMI handle with a callback for service events.
- Connect the handle to a service by service ID and instance ID.
- Send a request with a response callback and private context.
- The callback is invoked when the response arrives.
- The callback processes the response and cleans up the context.
- Destroy the handle when done.
Service request handling
A service receives a request from a client. The service can process the request synchronously or save the request context and complete it later. The service must retain the request handle, client reference, and any decoded request state required to construct the response. Disconnect handling must cancel deferred work safely. The flow is:- A client sends a request to the service.
- The service receives the request with a message ID and decoded data.
- The service processes the request (or saves it for later processing).
- The service sends a response using the request handle.
- The response is delivered to the client.
Indication delivery
A service sends an unsolicited event to a client. Indications do not consume a request transaction ID, and clients should be prepared to receive them between normal request/response operations. The flow is:- A client registers to receive indications from a service.
- When an event occurs, the service sends an indication.
- The client receives the indication and processes it.
- The client can continue sending requests and receiving responses.

