[PATCH] Core logic to support SIM hot swap
Aleksander Morgado
aleksander at aleksander.es
Thu Jun 30 15:26:13 UTC 2016
> > > + if (!is_sim_hot_swap_supported) {
> > > + ctx->self->priv->sim_hot_swap_ports_ctx = NULL;
> > > + } else {
> > > + PortsContext *ports;
> > > + GError *error = NULL;
> > > +
> > > + mm_dbg ("Modem supports SIM hot swap. Opening dedicated ports.");
> > > +
> > > + ports = g_new0 (PortsContext, 1);
> > > + ports->ref_count = 1;
> > > +
> > > + if (!open_ports_enabling (ctx->self, ports, FALSE, &error)) {
> > > + g_prefix_error (&error, "Couldn't open ports during Modem SIM hot swap enabling: ");
> > > + g_simple_async_result_take_error (ctx->result, error);
> >
> > Shouldn't the context be finished here? You're setting the error in
> > the GSimpleAsyncResult, but it is not being completed anywhere.
> > _
>
> Uhm, you're right. So, basically unref PortsContext and leave a log about the error would be enough?
>
I guess so, yes.
> > I see that the property defined in the mm-iface-modem isn't
> > implemented by any of the base objects, and that is not right. The
> > property must be implemented by MMBroadbandModem, so that getting the
> > property doesn't fail (it likely doesn't fail for you in your tests
> > because you implemented the property in the telit plugin in the next
> > patch).
> >
>
> I did tried without the plugin part, but I didn't see that problem.
> To implement the property in MMBroadbandModem, do you mean like PROP_MODEM_SIM? I can use that as example?
>
Yes, it would be the same idea, the only difference is that your
property is a boolean.
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list