This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DHCP Enable/Disable during Run-time in NDK

MCU: TM4C1294NCPDT

TI-RTOS: v2.01.00.03

NDK: v2.23.01.01

CCS: v6.0.1.0040

Hello,

    How do we enable & disable DHCP during run time in the httpServer example http://processors.wiki.ti.com/index.php/TI-RTOS_HTTP_Example

Following (http://e2e.ti.com/support/embedded/tirtos/f/355/p/383828/1354237.aspx#1354237), I am able to change IP address, subnet mask during run time but not DHCP!!

Thanks

Regards

Soumyajit

  • Did you find a solution to your problem?

  • No,

        I still haven't got any solution on how to change DHCP mode (from enabled to disabled or vice versa) during run-time. It would be better if you can point me something in this matter.

    Thanks

    Regards

    Soumyajit

  • Hi Judahvang,
    Found the following code chunk on google.... Hope it will enable DCHP during runtime if initially NDK is running in DHCP disabled mode.... Have to test the code though!!
    //--------------------------------------------------------------------------------------
    CI_SERVICE_DHCPC dhcpc;

    platform_write("Configuring DHCP client\n");

    // Specify DHCP Service on IF-1
    bzero( &dhcpc, sizeof(dhcpc) );
    dhcpc.cisargs.Mode = CIS_FLG_IFIDXVALID;
    dhcpc.cisargs.IfIdx = 0; // emac0
    dhcpc.cisargs.pCbSrv = &ServiceReport;
    dhcpc.param.pOptions = DHCP_OPTIONS;
    dhcpc.param.len = 2;

    CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_DHCPCLIENT, 0,
    sizeof(dhcpc), (UINT8 *)&dhcpc, 0 );

    //--------------------------------------------------------------------------------------

    Regards
    Soumyajit