From 6ea791909476a31291984f4f5d7a9940b2ca2cc2 Mon Sep 17 00:00:00 2001 From: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:20:04 +0800 Subject: [PATCH] Return IP address list in Cellular_CommonGetIPAddress (#142) * Return IP address list in Cellular_CommonGetIPAddress when PDP_type is set to IPV4V6. --- lexicon.txt | 1 + source/cellular_3gpp_api.c | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lexicon.txt b/lexicon.txt index dfe99513..e67044d8 100644 --- a/lexicon.txt +++ b/lexicon.txt @@ -147,6 +147,7 @@ checkcrsmreadstatus checklibrarystatus chk ci +cid ciev clearbits closedcallback diff --git a/source/cellular_3gpp_api.c b/source/cellular_3gpp_api.c index c668f149..4247bd32 100644 --- a/source/cellular_3gpp_api.c +++ b/source/cellular_3gpp_api.c @@ -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: ". 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 ); }