Hi maverick447,
- Can i connect the RCM to a router port ?
Yes…
- Do i have to implement a DHCP client ?
No…
You can manually assign you IP address, subnet, gateway etc as follows…
#define TCPCONFIG 1
#define _PRIMARY_STATIC_IP "192.168.0.50"
#define _PRIMARY_NETMASK "255.255.255.0"
#define MY_GATEWAY "192.168.0.1"
#define MY_NAMESERVER "192.168.0.1"
In Dynamic C, try pressing CRTL-H when on the TCPCONFIG for more information… TCPCONFIG allows you to specify compile time settings, you can also specify these settings at runtime by setting TCPCONFIG to 0 (zero) and using ifconfig in your main(), for example…
ifconfig(IF_ETH0,
IFS_DOWN,
IFS_IPADDR, aton("10.10.6.100"),
IFS_NETMASK, 0xFFFFFF00uL,
IFS_ROUTER_SET, aton("10.10.6.1"),
IFS_NAMESERVER_SET, aton("192.68.1.123"),
IFS_NAMESERVER_ADD, aton("192.68.1.124"),
IFS_UP,
IFS_END);
When you asked about your router port, assuming you meant the outgoing or listening port for the socket, try looking up ‘tcp_open’, ‘tcp_listen’, ‘tcp_clearreserve’ and ‘tcp_reserveport’ (CTRL-H)… (Obvisously for external access you will need to setup port forwarding on your router)
Also, check out the sample TCP/IP code found under…
C:\DCRABBIT_10.21\Samples cpip
and
C:\DCRABBIT_10.21\Samples\RCM4000\TCPIP
Hope this helps to get you started…
Dave 