Skip to content

Commit

Permalink
Return IP address list in Cellular_CommonGetIPAddress (#142)
Browse files Browse the repository at this point in the history
* Return IP address list in Cellular_CommonGetIPAddress when PDP_type is set to IPV4V6.
  • Loading branch information
chinglee-iot committed Aug 1, 2023
1 parent bfe3f48 commit 6ea7919
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ checkcrsmreadstatus
checklibrarystatus
chk
ci
cid
ciev
clearbits
closedcallback
Expand Down
14 changes: 4 additions & 10 deletions source/cellular_3gpp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,25 +1210,19 @@ static CellularPktStatus_t _Cellular_RecvFuncIpAddress( CellularContext_t * pCon

if( atCoreStatus == CELLULAR_AT_SUCCESS )
{
LogDebug( ( "Recv IP address: Context id: %s", pToken ) );
LogDebug( ( "Recv IP address: Context id: %s, Address %s", pToken, pInputLine ) );

if( pInputLine[ 0 ] != '\0' )
{
atCoreStatus = Cellular_ATGetNextTok( &pInputLine, &pToken );
( void ) strncpy( pData, pInputLine, dataLen );
}
else
{
/* This is the case "+CGPADDR: 1". Return "0.0.0.0" in this case.*/
( void ) strncpy( pData, "0,0,0,0", dataLen );
/* This is the case "+CGPADDR: <cid>". Return empty string. */
( void ) memset( pData, 0, dataLen );
}
}

if( atCoreStatus == CELLULAR_AT_SUCCESS )
{
LogDebug( ( "Recv IP address: Ip Addr: %s", pToken ) );
( void ) strncpy( pData, pToken, dataLen );
}

pktStatus = _Cellular_TranslateAtCoreStatus( atCoreStatus );
}

Expand Down

0 comments on commit 6ea7919

Please sign in to comment.