Exporting an Interface

Florence Chan florencewchan at google.com
Sat Nov 13 00:39:10 UTC 2021


Hey Aleksander,

I was able to find the problem! It turns out I was silly and forgot to
set GError*
error = NULL initially. 😅

Thanks for all the help and explanation :)
- Florence


On Fri, Nov 12, 2021 at 12:30 AM Aleksander Morgado <
aleksander at aleksander.es> wrote:

> Hey Florence,
>
> >
> > Ah, I see, thanks for the explanation! However the command below still
> returns FALSE for me unfortunately...
> >  g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (skeleton),
> >                                    connection,
> >                                    path,
> >                                    &error))
> > As mentioned before the skeleton is the MmGdbusSimEap* created by the
> command mm_gdbus_sim_eap_skeleton_new () command. I have checked that
> G_DBUS_INTERFACE_SKELETON (skeleton) correctly returns a
> GDBusInterfaceSkeleton type as well.
> >
>
> And in this time it also doesn't set the GError?
>
> If the export() method returns FALSE without error set, it can only be
> due to a g_return_if_fail() check. The ones done in this method,
> according to the glib sources, would be:
>
>   g_return_val_if_fail (G_IS_DBUS_INTERFACE_SKELETON (interface_), FALSE);
>
> Is the input object a valid GDBusInterfaceSkeleton?
>
>   g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), FALSE);
>
> Is the connection a valid GDBusConnection?
>
>   g_return_val_if_fail (g_variant_is_object_path (object_path), FALSE);
>
> Is the given path a valid DBus object path?
>
>   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
>
> Is error not required, and if it is, is it not initialized already?
>
>   /* Assert that the object path is the same for multiple connections here
> */
>   g_return_val_if_fail (interface_->priv->object_path == NULL ||
>                         g_strcmp0 (interface_->priv->object_path,
> object_path) == 0, FALSE);
>
> If the export() has been done already in a different connection, is
> this new export still for the same object path as before?
>
> You'll need to reply to those questions above.
>
> If the export() method returns FALSE but with error set, then please
> print what the actual error->message is.
>
> Cheers!
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20211112/4ea17483/attachment.htm>


More information about the ModemManager-devel mailing list