Exporting an Interface

Florence Chan florencewchan at google.com
Thu Nov 11 00:25:07 UTC 2021


Hey Aleksander,

Previously you mentioned the g_dbus_interface_skeleton_export() method to
export my SIM interface, which I've been attempting to use. However I've
been running with some issues with it. Currently I call this in my
mm_iface_sim_eap_initialize method, like so:
g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self),
                                  connection,
                                  path,
                                  &error)
self is a pointer to my interface The connection and path are properties
are the base sim's connection and path, retrieved like this:
  g_object_get (MM_BASE_SIM(self),
                MM_BASE_SIM_CONNECTION, &connection,
                MM_BASE_SIM_PATH,       &path,
                NULL);
>From the debug statements the connection is non-null, the path matches with
the base sim's path, and a skeleton for my interface was created
successfully (and overridden accordingly in the base sim class)

However looking at my debug statements my interface fails to be exported
, and error->message and error->code were (NULL) and 0 respectively, so I
am unsure of what the issue is here. Do you know how to fix this?

Thank you for the time and help!
- Florence


On Thu, Oct 14, 2021 at 12:52 PM Florence Chan <florencewchan at google.com>
wrote:

> Hey Aleksander,
>
> Ah yes, that makes sense! Yes I do have a skeleton type corresponding to
> my interface.
>
> Thanks so much for the help!
> - Florence
>
>
> On Wed, Oct 13, 2021 at 1:50 PM Aleksander Morgado <
> aleksander at aleksander.es> wrote:
>
>> Hey Florence!
>>
>> >
>> > I've been creating a DBus interface for the MM SIM object and I have
>> been having issues specifically when it comes to exporting the interface.
>> From the examples in other files it looks like there is a
>> "mm_gdbus_object_skeleton_set_modem_*" generated export function that
>> corresponds with the interface, however there is none that corresponds with
>> my SIM interface. How would I go about exporting my interface?
>> >
>>
>> I think that the issue you're having is because the mm-gdbus-sim.[c|h]
>> files are NOT generated with the --c-generate-object-manager option in
>> gdbus-codegen. That option is only used in the "modem" object, because
>> that is the only type of object listed by the "ObjectManagerInterface"
>> that the daemon manager object exports. So, for the modem object we
>> can have a "MmGdbusObjectSkeleton" associated to the object path,
>> which can then have multiple interfaces exposed in the same path via
>> the mm_gdbus_object_skeleton_set_modem_XXX() calls.
>>
>> The case for the SIM object is different; we're only generating code
>> for the interface support, not as part of any object manager. I guess
>> we could have each modem object implement the object manager interface
>> themselves, but that could be a bit of a mess, and don't think
>> gdbus-codegen supports that. So, for the SIM object (and any other
>> object; e.g. bearer, call, sms...) we export the interfaces
>> independently with g_dbus_interface_skeleton_export(). E.g. for the
>> Sim interface we get a MmGdbusSimSkeleton that we can export in DBus
>> whenever we want. I would assume you'll get a different skeleton type
>> for your new interface; is that so?
>>
>> --
>> Aleksander
>> https://aleksander.es
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20211110/b7c8c818/attachment.htm>


More information about the ModemManager-devel mailing list