Retrieving dynamic IP using DHCP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Retrieving dynamic IP using DHCP

1,058 Views
panpwr
Contributor IV

Hello,

I am kinda new with MQX. I am trying to retrieve an IP dynamically for my TWR-K60D100M board, using the RTCS DHCP.

I've found that there are 3 methods to do so, and I would like to know what are the differences/cons/pros of each method:

1. Using RTCS_if_bind_DHCP_timed().

2. Using ipcfg_bind_dhcp_wait().

3. Using ipcfg_bind_dhcp()  followed by  ipcfg_poll_dhcp().

Also, what is generally the difference between the RTCS functions and the ipcfg functions?

Thanks,
Lior.

Labels (1)
Tags (4)
0 Kudos
3 Replies

483 Views
butok
NXP Employee
NXP Employee

Hi Lior,


Look at ipcfg_xxx as at the application library which is actually calls RTCS functions/services.

Usually ipcfg_ xxx functions call RTCS_xxx functions.

Thanks,

Andrey Butok

483 Views
panpwr
Contributor IV

Hey Andrey, Thank you for replying.

However, I am still missing something: why would I want to use ipcfg functions, rather than RTCS functions? What is the recommended usage for each? While I choose one service, can I also use the 2nd one, or should I be consistent?

I ask that because I've seen a few methods to init services & modules (i.e. DHCP), and I am a bit confused.

Thanks again,

Lior.

0 Kudos

483 Views
butok
NXP Employee
NXP Employee

Hi Lior,

I suggest using of ipcfg_xxx() where it is possible, just to be consistent.

You can look at ipcfg.c, to understand its internals/functionality.

Also look at sh_ipconfig.c as its usage example.

Regards,

                Andrey Butok

0 Kudos