Skip to content

Commit 6ea7919

Browse files
authored
Return IP address list in Cellular_CommonGetIPAddress (#142)
* Return IP address list in Cellular_CommonGetIPAddress when PDP_type is set to IPV4V6.
1 parent bfe3f48 commit 6ea7919

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lexicon.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ checkcrsmreadstatus
147147
checklibrarystatus
148148
chk
149149
ci
150+
cid
150151
ciev
151152
clearbits
152153
closedcallback

source/cellular_3gpp_api.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,25 +1210,19 @@ static CellularPktStatus_t _Cellular_RecvFuncIpAddress( CellularContext_t * pCon
12101210

12111211
if( atCoreStatus == CELLULAR_AT_SUCCESS )
12121212
{
1213-
LogDebug( ( "Recv IP address: Context id: %s", pToken ) );
1213+
LogDebug( ( "Recv IP address: Context id: %s, Address %s", pToken, pInputLine ) );
12141214

12151215
if( pInputLine[ 0 ] != '\0' )
12161216
{
1217-
atCoreStatus = Cellular_ATGetNextTok( &pInputLine, &pToken );
1217+
( void ) strncpy( pData, pInputLine, dataLen );
12181218
}
12191219
else
12201220
{
1221-
/* This is the case "+CGPADDR: 1". Return "0.0.0.0" in this case.*/
1222-
( void ) strncpy( pData, "0,0,0,0", dataLen );
1221+
/* This is the case "+CGPADDR: <cid>". Return empty string. */
1222+
( void ) memset( pData, 0, dataLen );
12231223
}
12241224
}
12251225

1226-
if( atCoreStatus == CELLULAR_AT_SUCCESS )
1227-
{
1228-
LogDebug( ( "Recv IP address: Ip Addr: %s", pToken ) );
1229-
( void ) strncpy( pData, pToken, dataLen );
1230-
}
1231-
12321226
pktStatus = _Cellular_TranslateAtCoreStatus( atCoreStatus );
12331227
}
12341228

0 commit comments

Comments
 (0)