<div dir="ltr">Thanks a lot for your patience. It is a lot more clear now.<div>I have a working model now, in which I am able to just start/stop data connection on my modem.</div><div>Kind regards,</div><div>Sai.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 21, 2021 at 10:02 AM Aleksander Morgado <<a href="mailto:aleksander@aleksander.es">aleksander@aleksander.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<br>
<br>
On Fri, Mar 19, 2021 at 12:57 PM Sai Chaitanya <<a href="mailto:msaichaitanya@gmail.com" target="_blank">msaichaitanya@gmail.com</a>> wrote:<br>
><br>
> Thanks for the detailed reply. So I presume that qmi_device_open(), qmi_device_ready() and correspondingly qmi_device_close_async() are not required?<br>
<br>
Looks like l missed the open step, sorry :). You do need the<br>
qmi_device_open() between _new() and _allocate_client():<br>
<br>
* qmi_device_new() --> this just defines how the underlying control<br>
port is accessed, doesn't really do anything else<br>
* qmi_device_open() --> this attempts to establish a new<br>
communication channel with the underlying control port.<br>
* qmi_device_allocate_client (device, WDS)<br>
* qmi_client_wds_set_ip_family(client, ....) --> optional if<br>
ip-type not set in start network<br>
* qmi_client_wds_start_network(client, ...) --> returns packet-data-handle<br>
<br>
And once you want to stop the connection:<br>
* qmi_client_wds_stop_network(client, packet-data-handle)<br>
* qmi_device_release_client(device,client)<br>
<br>
After the release client, you may or may not want to run<br>
qmi_device_close(), depending on your needs. The close() will NOT<br>
release your clients implicitly, it just stops the communication<br>
channel with the underlying control port. If the program exits before<br>
calling close() nothing bad should happen, as the channel is also<br>
stopped in that case.<br>
<br>
Regarding qmi_device_ready(), I think you're missing something. All<br>
the _ready() methods would really be needed because you're running an<br>
async application with async methods scheduled via a main loop. You<br>
would need a ready() method for every async method you call for which<br>
you want to know the response, as you'd be running the associated<br>
finish() method inside the ready() to get the result of the operation.<br>
You could run async methods with a NULL callback if you don't require<br>
to know the result of the operation.<br>
<br>
-- <br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"> </div>