About LIBQMI APIs

Sai Chaitanya msaichaitanya at gmail.com
Fri Mar 19 11:56:50 UTC 2021


Thanks for the detailed reply. So I presume that qmi_device_open(),
qmi_device_ready() and correspondingly qmi_device_close_async() are not
required?
If yes, then it would be interesting to know when they would be needed.

Kindly share your thoughts.

Regards,
Sai.

On Thu, Mar 18, 2021 at 11:58 AM Aleksander Morgado <
aleksander at aleksander.es> wrote:

> Hey,
>
> >
> > I am looking at QMI APIs, specially interested in
> >
> > qmi_client_wds_start_network ()
> >
> > The references that I could find for the usage of this are only in
> qmicli and modem manager. Initially I thought that the API can be used
> directly, but looking at the approach followed in QMICLI, it looks like
> there is a need for a set of APIs to be called in a specific sequence,
> before the start API can be used. Is that correct? And for someone new to
> libqmi and wondering if the modem can be enabled with use of QMI APIs
> included in build, instead of using QMICLI or QMI-NETWORK, is there any
> other simpler approach than that is followed in QMICLI?
> >
> > In short, lets say I don't want anything other than just to start/stop
> the data connection on the modem with a simple set of QMI APIs, is that
> possible?
> >
> > Any inputs are greatly appreciated.
> >
>
> Before using qmi_client_wds_start_network() you need to allocate a
> "WDS QMI client". All the WDS operations require a client to be
> allocated in advance; the same way as all operations in other services
> like DMS or NAS also require a client of the specific service to be
> allocated in advance.
>
> The client allocation procedure is done using the CTL service (the
> only service for which no specific client needs to be allocated), but
> this service is "hidden" to the libqmi API user behind QmiDevice
> operations; e.g. in your case you need qmi_device_allocate_client().
>
> So, if you want to write an application using libqmi and the minimal
> number of steps required to call the WDS start network operation,
> you'll need to:
>  * qmi_device_new()
>  * qmi_device_allocate_client (device, WDS)
>  * qmi_client_wds_set_ip_family(client, ....)     --> optional if
> ip-type not set in start network
>  * qmi_client_wds_start_network(client, ...)    --> returns
> packet-data-handle
>
> And once you want to stop the connection:
>  * qmi_client_wds_stop_network(client, packet-data-handle)
>  * qmi_device_release_client(device,client)
>
> --
> Aleksander
> https://aleksander.es
>


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20210319/b8750e5a/attachment.htm>


More information about the libqmi-devel mailing list