Hi Martin,
Yes because the current behaviour in my opinion doesn't make any sense :-)

Currently ofono creates an invalid empty internet context with no apn at all

[ /telit_0 ]
    [ /telit_0/context1 ]
        Name = Internet
        Active = 0
        Type = internet
        Protocol = ip
        AccessPointName =
        Username =
        Password =
        AuthenticationMethod = chap
        Settings = { }
        IPv6.Settings = { }

[ /stktest ]

instead of

nlunghiadm@nick-bbestie:~/tmp/modem/ofono$ test/list-contexts
[ /telit_0 ]
    [ /telit_0/context1 ]
        Name = Internet
        Active = 0
        Type = internet
        Protocol = ip
        AccessPointName = hs.vodafone.ie
        Username = vodafone
        Password = vodafone
        AuthenticationMethod = chap
        Settings = { }
        IPv6.Settings = { }

    [ /telit_0/context2 ]
        Name = Old
        Active = 0
        Type = internet
        Protocol = ip
        AccessPointName = isp.vodafone.ie
        Username = vodafone
        Password = vodafone
        AuthenticationMethod = chap
        Settings = { }
        IPv6.Settings = { }

    [ /telit_0/context3 ]
        Name = Prepaid
        Active = 0
        Type = internet
        Protocol = ip
        AccessPointName = live.vodafone.com
        Username = vodafone
        Password = vodafone
        AuthenticationMethod = chap
        Settings = { }
        IPv6.Settings = { }
[ /stktest ]

I'll test if connman handles this and then I will resubmit your patch

the alternative could be to provide a DBus Interface to query the apn
from mbpi and then set it via DBus would be better??

Cheers
Nicola Lunghi

On Mon, 2 Mar 2020 at 13:56, Martin Hundebøll <[email protected]> wrote:
>
> Hi,
>
> On 02/03/2020 14.49, nick83ola wrote:
> > Hi all,
> > In regarding to this I found the provision plugin and at line 53 it
> > uses the mbpi lookup to provision for the default apns but at line 53
> > it does
> >
> > apns = mbpi_lookup_apn(mcc, mnc, FALSE, &error);
> >
> > that gives an error in case of multiple providers. -> but if I change
> > it to gboolean allow_duplicates=TRUE
> > It works and it creates multiple contexts
> >
> > ap_count = g_slist_length(apns);
> > .....
> > for (l = apns, i = 0; l; l = l->next, i++) {
> > struct ofono_gprs_provision_data *ap = l->data;
> >
> > memcpy(*settings + i, ap,
> > sizeof(struct ofono_gprs_provision_data));
> >
> > g_free(ap);
> > }
> >
> > What's the issue in setting mbpi_lookup_apn(mcc, mnc, TRUE, &error); ?????
>
> You're not the first:
> https://lists.ofono.org/hyperkitty/list/[email protected]/thread/2SC46PH5CWT3A3HTHGUKUUVI3QDYIL73/#7B6CPARJQMZUBQUPXBJMAOXZY4RW2L3D
>
> :)
>
> // Martin
_______________________________________________
ofono mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to