Ok. My idea was to connect to the ::connected signals of each bearer to monitor 
their state.
To do so, I'm going to keep a list of bearers I am managing, and in my case i 
would like them to be ideally all of the bearers of a modem.
To keep GSignals connected, I need to keep an object reference infact.
But this way I will need to scan the entire list everytime.
Am I missing something big?



On Mon, 4 Oct 2021, Aleksander Morgado wrote:

Date: Mon, 4 Oct 2021 12:57:07
From: Aleksander Morgado <aleksan...@aleksander.es>
To: Enrico Mioso <mrkiko...@gmail.com>
Cc: "ModemManager (development)" <modemmanager-devel@lists.freedesktop.org>
Subject: Re: GSignals for bearers addition/removal

Hey!


Thanks a lot for your (as always) kind answer. I am using libmm-glib! :)
I am putting some code togeter but I haven't found the "proper" way to do so, 
at least not so far.


static void
bearers_updated (MMModem *modem,
                            GParamSpec *pspec,
                            gpointer user_data)
{
   GList *list;

   // When this callback is called, the property in the MMModem
already has the latest value
   list = mm_modem_list_bearers_sync (...)
}

g_signal_connect (modem, "notify::bearers", G_CALLBACK
(bearers_updated), some_user_data);

--
Aleksander
https://aleksander.es

Reply via email to