Unexpected COPS format
Colin Helliwell
colin.helliwell at ln-systems.com
Fri Mar 17 16:13:37 UTC 2017
> On 17 March 2017 at 15:02 Colin Helliwell <colin.helliwell at ln-systems.com> wrote:
>
> > On 17 March 2017 at 14:16 colin.helliwell at ln-systems.com wrote:
> >
> > I’m reviewing the info fetched on my modems, and one of them is giving an unusual format for “AT+COPS=3,2;+COPS?” :
> >
> > +COPS: 0,2,"00320033003400310035",0
> >
> > This seems to be some sort of ‘wide char’ hex representation of “23415” [which is what I’d expect].
> >
> > The modem’s AT spec doesn’t say anything about it coming back in the form, but I just wondered if it was a format anyone had encountered elsewhere?
>
> Doing a bit of comparison between them:
>
> BGS2 -
> [src/mm-broadband-modem.c:3496] modem_3gpp_load_operator_code(): loading Operator Code...
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): --> 'AT+COPS=3,2;+COPS?'
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): <-- '+COPS: 0,2,"23415"OK'
> [src/mm-broadband-modem.c:3487] modem_3gpp_load_operator_code_finish(): loaded Operator Code: 23415
> [src/mm-broadband-modem.c:3539] modem_3gpp_load_operator_name(): loading Operator Name...
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): --> 'AT+COPS=3,0;+COPS?'
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): <-- '+COPS: 0,0,"vodafone UK"OK'
> [src/mm-broadband-modem.c:3530] modem_3gpp_load_operator_name_finish(): loaded Operator Name: vodafone UK
>
> EHS5 -
>
> [src/mm-broadband-modem.c:3496] modem_3gpp_load_operator_code(): loading Operator Code...
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): --> 'AT+COPS=3,2;+COPS?'
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): <-- '+COPS: 0,2,"00320033003400310035",0'
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): <-- 'OK'
> [src/mm-broadband-modem.c:3487] modem_3gpp_load_operator_code_finish(): loaded Operator Code: 00320033003400310035
> [src/mm-iface-modem-3gpp.c:874] parse_mcc_mnc(): Unexpected MCC/MNC string '00320033003400310035'
> [src/mm-broadband-modem.c:3539] modem_3gpp_load_operator_name(): loading Operator Name...
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): --> 'AT+COPS=3,0;+COPS?'
> [src/mm-port-serial-at.c:459] debug_log(): (ttyMux1): <-- '+COPS: 0,0,"0076006F006400610066006F006E006500200055004B",0OK'
> [src/mm-broadband-modem.c:3530] modem_3gpp_load_operator_name_finish(): loaded Operator Name: vodafone UK
>
> I notice that modem_3gpp_load_operator_name_finish() has a 'mm_3gpp_normalize_operator_name()' step; maybe same needed on modem_3gpp_load_operator_code_finish()?
>
As a quick test, utilizing that function appears to work with the above case. A neater patch would be to refactor it a bit more generically - e.g. "mm_3gpp_normalize_operator_string". Any objections/issues (or, more importantly, risk of adverse consequences) with me submitting such a patch?
More information about the ModemManager-devel
mailing list