FreeRTOS / FreeRTOS-Cellular-Interface

FreeRTOS Cellular Interface implementation of the 3GPP TS v27.007 standard.
MIT License
85 stars 59 forks source link

Return IP address list in Cellular_CommonGetIPAddress #142

Closed chinglee-iot closed 1 year ago

chinglee-iot commented 1 year ago

AT+CGPADDR returns a list of IPV4 and IPV6 address when PDP_type is set to IPV4V6. Update the implementation to return a list of IP addresses.

AT+CGDCONT=1,"IPV4V6",""
OK
AT+CGPADDR=1
+CGPADDR: 1,10.174.245.251,2001:B400:E23D:9ADF:9059:ED92:B26E:9C1C   #  <IPv4>,<IPv6> addresses are returned by modem

Description

Test Steps

/* Set the PDP_type to IPV4V6. */
CellularPdnConfig_t pdnConfig = { CELLULAR_PDN_CONTEXT_IPV4V6, CELLULAR_PDN_AUTH_NONE, CELLULAR_APN, "", "" };
...
cellularStatus = Cellular_SetPdnConfig( CellularHandle, CellularSocketPdnContextId, &pdnConfig );
...
cellularStatus = Cellular_GetIPAddress( CellularHandle, CellularSocketPdnContextId, localIP, sizeof( localIP ) );
...
configPRINTF( ( ">>>  Cellular_GetIPAddress %s  <<<\r\n", localIP ) );

localIP should contain a list of IP addresses.

>>>  Cellular_GetIPAddress 10.175.162.95,2001:B400:E23D:EA13:434B:9420:30EC:5246  <<<

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

KeitaKashima commented 1 year ago

@chinglee-iot

I also checked the fixed code. It works fine as getting , addresses.