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

IPV6 for PDP Context (IDFGH-12084) #508

Closed
3 tasks done
yanmartins opened this issue Feb 8, 2024 · 2 comments
Closed
3 tasks done

IPV6 for PDP Context (IDFGH-12084) #508

yanmartins opened this issue Feb 8, 2024 · 2 comments
Assignees

Comments

@yanmartins
Copy link

Answers checklist.

  • I have read the documentation for esp-protocols components and the issue is not addressed there.
  • I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello,

I use the esp-modem library to create a class for a generic DCE modem.

The function present in esp_modem_command_library uses the global PDP context.

command_result set_pdp_context(CommandableIf *t, PdpContext &pdp, uint32_t timeout_ms)
{
     ESP_LOGV(TAG, "%s", __func__ );
     std::string pdp_command = "AT+CGDCONT=" + std::to_string(pdp.context_id) +
                               ",\"" + pdp.protocol_type + "\",\"" + pdp.apn + "\"\r";
     return generic_command_common(t, pdp_command, timeout_ms);
}

My generic class also has an implementation of the CGDCONT command, but at some point, the above function is invoked and uses the global pdp struct from the ESP library.

Is there any way for me to set this PDP value? Because the protocol_type value is fixed to "IP" within the struct. And I want to change it to support IPV6.

Also, is there any other configuration I should do to accept IPV6?

Thanks

@github-actions github-actions bot changed the title IPV6 for PDP Context IPV6 for PDP Context (IDFGH-12084) Feb 8, 2024
@david-cermak
Copy link
Collaborator

Hi @yanmartins

Yes, this API uses pre-configured PDP context. To update it, you can call configure_pdp_context() instead:

            auto new_pdp = std::make_unique<PdpContext>("APN");
            new_pdp->protocol_type = "IP6";
            dce->get_module()->configure_pdp_context(std::move(new_pdp));

Unfortunately, we don't have an explicit constructor with the protocol, so you'll to update it after creating.

To enable IPv6 protocol in PPP session, you'd have enable: CONFIG_LWIP_PPP_ENABLE_IPV6 (off by default).

@david-cermak
Copy link
Collaborator

@yanmartins I think this can be closed (please reopen if any other question or request)

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

No branches or pull requests

3 participants