not able to receive any indications using libqmi on Linaro
Shilpa Velamuri
shilpa.vel at gmail.com
Tue Nov 29 03:30:51 UTC 2016
Code is :
init():
pthread_create(&mthread, NULL, InitializeDevice, this);
InitializeDevice():
mainLoop = g_main_loop_new(NULL, false);
qmi_device_new(file,
cancellable,
(GAsyncReadyCallback) FileReadyCallback,
gpointer(user_data));
g_main_loop_run(mainLoop);
FileReadyCallback():
qmi_device_open(device,
flags,
timeout,
cancellable,
(GAsyncReadyCallback) DeviceCallback,
user_data);
DeviceCallback():
qmi_device_allocate_client(device,
QMI_SERVICE_NAS,
cid,
timeout,
cancellable,
(GAsyncReadyCallback)NasClientCallback,
(gpointer)this);
NasClientCallback():
input = qmi_message_nas_register_indications_input_new();
qmi_message_nas_register_indications_input_set_serving_system_events(input,
true, &error);
qmi_client_nas_register_indications(QMI_CLIENT_NAS(nasClient),
input,
timeout,
cancellable,
RegIndCallback,
(gpointer)this);
qmi_message_nas_register_indications_input_unref(input);
RegIndCallback():
g_signal_connect(nasClient,
"serving-system",
G_CALLBACK (SrvSysIndCallback),
user_data);
Problem : SrvSysIndCallback is never invoked.
Thank You.
On Thu, Nov 17, 2016 at 1:10 AM, Aleksander Morgado <
aleksander at aleksander.es> wrote:
> Hey,
>
> On Wed, Nov 16, 2016 at 11:29 PM, Shilpa Velamuri <shilpa.vel at gmail.com>
> wrote:
> > The libqmi interaction/WWAN code is all running in a separate thread
> being
> > part of a bigger application. The g_main_loop is running in this thread.
> I
> > am receiving responses to requests but no indications from libqmi. Code
> is
> > using proxy to talk to LE910 modem.
> >
>
> It is usually much simpler if you provide e.g. a working minimal
> example showing the issue, instead of explaining what the code does.
>
> > In the callback of Nas Client allocation, i invoke:
> > qmi_client_nas_register_indications(...)
> >
> > In the callback to the above qmi_client_nas_register_indications:
> >
> > i register for NAS serving-system indication as :
> > g_signal_connect(nasClient,
> > "serving-system",
> > G_CALLBACK (SrvSysIndCallback),
> > callback_data);
> >
> > The callback is never invoked even though the modem is registered and has
> > service.
> >
> > what am i doing wrong? Could you help?
>
> Maybe you need to define which is the thread-default main context as
> soon as you create the new thread where the libqmi main loop is
> supposed to run? See g_main_context_push_thread_default(). Otherwise,
> the g_signal_connect() you run may schedule the signal events in the
> main context of the main thread, but you don't have a main loop
> running there, right?
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20161128/1e88dc70/attachment.html>
More information about the libqmi-devel
mailing list