Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return IP address list in Cellular_CommonGetIPAddress #142

Merged

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.
@KeitaKashima
Copy link

@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
8 checks passed
@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.

None yet

4 participants