FreeRTOS-Plus-TCP Echo Posix demo application does not work on Ubuntu Host Machine

@tony-josi-aws Thank you for your inputs.

Using the patch shared I was able to communicate with Remote TCP server (tcpbin.com) and verify it using the PCAP. For static as you mentioned you set the value of xEndPoints[ 0 ].bits.bWantDHCP = pdFALSE and with that I used the IP as 10.0.2.15 which automatically gets set in application when ipconfigUSE_DHCP is used. But as per the description mentioned in the document as well in FreeRTOSIPConfig.h for ipconfigUSE_DHCP; this flag is to be set only when using DHCP server. So just wanted to understand the purpose of this flag because on setting xEndPoints[ 0 ].bits.bWantDHCP as False it works as Static and still ipconfigUSE_DHCP has to be configured as 1. Please correct me if my understanding is wrong.

Hi @PA_adas

Your understanding is mostly correct.

ipconfigUSE_DHCP is a global build time flag that enable or disable DHCP support. If it is set to 0, DHCP code is not compiled at all and all endpoints must be static.

Where as when ipconfigUSE_DHCP is set to 1, stack supports DHCP but whether a given endpoint supports static or dynamic ip is controlled at runtime by xEndPoints[].bits.bWantDHCP flag.
So this gives you flexibility to use both DHCP & static IP per interface at runtime.

1 Like