<div dir="ltr">Code is :<div>init():</div><div> pthread_create(&mthread, NULL, InitializeDevice, this);<br></div><div> </div><div> InitializeDevice():<br></div><div> mainLoop = g_main_loop_new(NULL, false);</div><div> qmi_device_new(file,</div><div> cancellable,</div><div> (GAsyncReadyCallback) FileReadyCallback,</div><div> gpointer(user_data));</div><div> </div><div> g_main_loop_run(mainLoop);<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">FileReadyCallback():<br></div><div class="gmail_extra"> qmi_device_open(device,</div><div class="gmail_extra"> flags,</div><div class="gmail_extra"> timeout,</div><div class="gmail_extra"> cancellable,</div><div class="gmail_extra"> (GAsyncReadyCallback) DeviceCallback,</div><div class="gmail_extra"> user_data); </div><div class="gmail_extra"><br></div><div class="gmail_extra">DeviceCallback():<br></div><div class="gmail_extra"> qmi_device_allocate_client(device,</div><div class="gmail_extra"> QMI_SERVICE_NAS,</div><div class="gmail_extra"> cid,</div><div class="gmail_extra"> timeout,</div><div class="gmail_extra"> cancellable,</div><div class="gmail_extra"> (GAsyncReadyCallback)NasClientCallback,</div><div class="gmail_extra"> (gpointer)this);</div><div class="gmail_extra"><br></div><div class="gmail_extra">NasClientCallback():<br></div><div class="gmail_extra"> input = qmi_message_nas_register_indications_input_new();</div><div class="gmail_extra"> </div><div class="gmail_extra"> qmi_message_nas_register_indications_input_set_serving_system_events(input, true, &error);</div><div class="gmail_extra"><br></div><div class="gmail_extra"> qmi_client_nas_register_indications(QMI_CLIENT_NAS(nasClient),<br></div><div class="gmail_extra"> input,</div><div class="gmail_extra"> timeout,</div><div class="gmail_extra"> cancellable,</div><div class="gmail_extra"> RegIndCallback,</div><div class="gmail_extra"> (gpointer)this);</div><div class="gmail_extra"><br></div><div class="gmail_extra"> qmi_message_nas_register_indications_input_unref(input);</div><div class="gmail_extra"><br></div><div class="gmail_extra">RegIndCallback():<br></div><div class="gmail_extra"><div class="gmail_extra"> g_signal_connect(nasClient,</div><div class="gmail_extra"> "serving-system",</div><div class="gmail_extra"> G_CALLBACK (SrvSysIndCallback),</div><div class="gmail_extra"> user_data);</div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Problem : SrvSysIndCallback is never invoked.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thank You.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 17, 2016 at 1:10 AM, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<br>
<span class="gmail-"><br>
On Wed, Nov 16, 2016 at 11:29 PM, Shilpa Velamuri <<a href="mailto:shilpa.vel@gmail.com">shilpa.vel@gmail.com</a>> wrote:<br>
> The libqmi interaction/WWAN code is all running in a separate thread being<br>
> part of a bigger application. The g_main_loop is running in this thread. I<br>
> am receiving responses to requests but no indications from libqmi. Code is<br>
> using proxy to talk to LE910 modem.<br>
><br>
<br>
</span>It is usually much simpler if you provide e.g. a working minimal<br>
example showing the issue, instead of explaining what the code does.<br>
<span class="gmail-"><br>
> In the callback of Nas Client allocation, i invoke:<br>
> qmi_client_nas_register_<wbr>indications(...)<br>
><br>
> In the callback to the above qmi_client_nas_register_<wbr>indications:<br>
><br>
> i register for NAS serving-system indication as :<br>
> g_signal_connect(nasClient,<br>
> "serving-system",<br>
> G_CALLBACK (SrvSysIndCallback),<br>
> callback_data);<br>
><br>
> The callback is never invoked even though the modem is registered and has<br>
> service.<br>
><br>
> what am i doing wrong? Could you help?<br>
<br>
</span>Maybe you need to define which is the thread-default main context as<br>
soon as you create the new thread where the libqmi main loop is<br>
supposed to run? See g_main_context_push_thread_<wbr>default(). Otherwise,<br>
the g_signal_connect() you run may schedule the signal events in the<br>
main context of the main thread, but you don't have a main loop<br>
running there, right?<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
--<br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</font></span></blockquote></div><br></div></div>