Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cellular_CommonGetRegisteredNetwork API return undefined value #149

Closed
KeitaKashima opened this issue Oct 2, 2023 · 3 comments
Closed
Assignees

Comments

@KeitaKashima
Copy link

Hi, I called the Cellular_CommonGetRegisteredNetwork API to test MCC when disconnecting the PDN of the network of cellular.

Then I found the API got the undefined value of MCC.

The reason is that the below pOperatorInfo value is not zero clear after getting Malloc.

cellularOperatorInfo_t * pOperatorInfo = ( cellularOperatorInfo_t * ) Platform_Malloc( sizeof( cellularOperatorInfo_t ) );

cellularOperatorInfo_t * pOperatorInfo = ( cellularOperatorInfo_t * ) Platform_Malloc( sizeof( cellularOperatorInfo_t ) );

The *pOperatorInfo value is copied undefined value below the lines.

( void ) memcpy( pNetworkInfo->mcc, pOperatorInfo->plmnInfo.mcc, CELLULAR_MCC_MAX_SIZE );

@chinglee-iot chinglee-iot self-assigned this Oct 2, 2023
@chinglee-iot
Copy link
Member

@KeitaKashima
Thank your for reporting this problem. We will look into the problem and discuss with you in this thread.

@chinglee-iot
Copy link
Member

@KeitaKashima
Cellular_CommonGetRegisteredNetwork requires the port to set to the numeric format in Cellular_ModuleEnableUrc. If the format is set to other format, for example long or short format, the MCC and MNC won't be updated and the value is undefined. This is probably the problem you encountered.

We address this issue in #161 to set the format in atcmdUpdateMccMnc in order not to rely on the port initialization code.

@chinglee-iot
Copy link
Member

PR #161 is merged. Thank you for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants