This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

modem_info_short_get fails

Calling modem_info_short_get for the parameters MODEM_INFO_MCC, MODEM_INFO_MNC, MODEM_INFO_AREA_CODE and MODEM_INFO_CELLID fail. Call to modem_info_short_get works with MODEM_INFO_CUR_BAND.

I suspect the problem is in code. Tracing the MCC call shows that the call makes the correct AT query to the modem. However, the parameter returned is (rightly) a string. However the value expected for that parameter is a short so the call fails. Trying to call modem_info_string_get fails because the value is typed as a short in the parameter array.

I believe the answer is to pull the string then convert into a short. Or retype as a string and pull the first 3 characters of the string parameter.

Doug

Parents
  • I have the same problem with NCS 1.1.0 and modem firmware 1.1.0.

    modem_info.c contains:

    static const struct modem_info_data mcc_data = {
    	.cmd		= AT_CMD_CURRENT_OP,
    	.data_name	= MCC_DATA_NAME,
    	.param_index	= OPERATOR_PARAM_INDEX,
    	.param_count	= OPERATOR_PARAM_COUNT,
    	.data_type	= AT_PARAM_TYPE_NUM_SHORT,
    };

    The modem reports a string:

    +COPS: 0,2,"23410",7

Reply
  • I have the same problem with NCS 1.1.0 and modem firmware 1.1.0.

    modem_info.c contains:

    static const struct modem_info_data mcc_data = {
    	.cmd		= AT_CMD_CURRENT_OP,
    	.data_name	= MCC_DATA_NAME,
    	.param_index	= OPERATOR_PARAM_INDEX,
    	.param_count	= OPERATOR_PARAM_COUNT,
    	.data_type	= AT_PARAM_TYPE_NUM_SHORT,
    };

    The modem reports a string:

    +COPS: 0,2,"23410",7

Children
Related