Exporting an Interface
aleksander at aleksander.es
Tue Nov 30 08:57:21 UTC 2021
> I have another question regarding my SIM-EAP interface. Testing has been going well however I noticed one of the methods of my interface has an invalid address (i.e. either (nil) or 0x2) despite having implementation. I noticed I'm getting this warning which may be responsible for this bug:
> (ModemManager:4486): GLib-GObject-WARNING **: 17:07:38.068: invalid cast from 'MMSimMbim' to 'MMIfaceSimEap'
> I was wondering if you would know if there is anything else involved in providing a valid cast from these two, other than what I have here (in mm-sim-mbim.c):
> G_DEFINE_TYPE_EXTENDED(MMSimMbim, mm_sim_mbim, MM_TYPE_BASE_SIM, 0, G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_SIM_EAP, iface_sim_eap_init))
Hum... I don't think I can say of anything else that would be strictly
required. In the modem interfaces I explicitly add MM_TYPE_BASE_MODEM
as a prerequisite for the interfaces in the get_type() method, with
g_type_interface_add_prerequisite(). But I'm not completely sure
that's a strict requirement. Do you also add that prerequisite for the
MM_TYPE_BASE_SIM object in your new SIM interface?
More information about the ModemManager-devel