Hi Denis,

Den fre 2 aug. 2019 kl 13:39 skrev Denis Kenzior <denk...@gmail.com>:

> Hi Richard,
>
> >      > +     gprs->netreg_status = -1;
> >      >       gprs->used_pids = l_uintset_new(MAX_CONTEXTS);
> >      >
> >
> >     Wouldn't changes to gprs.c be sufficient, without touching netreg.c?
> >
> >
> > No unfortunately not. gprs reads the netreg status when it attaches to
> > the atom. Which would be unknown if we do not touch netreg.c.
> > .. and unknown is a valid status which can not be distinguished from
> > "not yet updated".
>
> Hmm, okay. But then, can't you set gprs->netreg_status to -1 inside
> netreg_watch and just wait until netreg_status_changed to get it set
> properly?
>

That would work in my case.

I was just worried in case any driver would have
updated netreg with status before calling ofono_netreg_register, then
we would not get the status since there wont be any initial callback.
But if that is not allowed/happens anywhere I agree that its better.


>
> That seems to be your real culprit, the gprs->netreg_status assignment
> from ofono_netreg_get_status()
>
> >
> >
> >      >       return gprs;
> >      > diff --git a/src/network.c b/src/network.c
> >      > index 2824eae6..1db01bcf 100644
> >      > --- a/src/network.c
> >      > +++ b/src/network.c
> >      > @@ -1874,7 +1874,7 @@ struct ofono_netreg
> >     *ofono_netreg_create(struct ofono_modem *modem,
> >      >       if (netreg == NULL)
> >      >               return NULL;
> >      >
> >      > -     netreg->status = NETWORK_REGISTRATION_STATUS_UNKNOWN;
> >      > +     netreg->status = -1;
> >
> >     Okay, but a minor problem with this is that there now exists a brief
> >     moment in type where the Status property has a weird value...
> >
> >
> > I looked at this, and most statuses, even some defined results as
> > unknown. Any unhandled values as negative would do that too.
> > If you are refering to the D-Bus property?
>
> Yes.  Most of the time -1 simply means the property is omitted.  In this
> case that is not actually what happens.  Refer to src/common.c
> registration_status_to_string()
>
>
--Richard
_______________________________________________
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to