Skip to content

Conversation

@chinglee-iot
Copy link
Member

@chinglee-iot chinglee-iot commented Jul 31, 2023

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

  • Two IP addresses may be returned when PDP_type is set to IPV4V6. A list of IP addresses should be returned.

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:

  • I have tested my changes. No regression in existing tests.

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.

* Two IP addresses may be returned when PDP_type is set to IPV4V6. A
  list of IP addresses should be returned.
@chinglee-iot chinglee-iot requested a review from ActoryOu July 31, 2023 09:25
@ghost
Copy link

ghost commented Aug 1, 2023

@chinglee-iot

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

@chinglee-iot chinglee-iot merged commit 6ea7919 into FreeRTOS:main Aug 1, 2023
@chinglee-iot chinglee-iot deleted the getipaddress-return-ipaddress-list branch August 1, 2023 04:20
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

Successfully merging this pull request may close these issues.

3 participants