diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-04 22:59:30 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-04 22:59:30 +0000 |
commit | 83705d736e7e957752226de8c2165aa9ff4deeaa (patch) | |
tree | 35763ac9f5bbba31583e967fb7e199f854b50928 /nuttx/examples | |
parent | d71296f49b301d3ca8edcc6e9b79dd6b23a01c31 (diff) | |
download | px4-nuttx-83705d736e7e957752226de8c2165aa9ff4deeaa.tar.gz px4-nuttx-83705d736e7e957752226de8c2165aa9ff4deeaa.tar.bz2 px4-nuttx-83705d736e7e957752226de8c2165aa9ff4deeaa.zip |
Integrating with DM320
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@368 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples')
-rw-r--r-- | nuttx/examples/nettest/nettest-client.c | 2 | ||||
-rw-r--r-- | nuttx/examples/nettest/nettest.c | 7 | ||||
-rw-r--r-- | nuttx/examples/uip/main.c | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/nuttx/examples/nettest/nettest-client.c b/nuttx/examples/nettest/nettest-client.c index 38f98875e..98080d0c2 100644 --- a/nuttx/examples/nettest/nettest-client.c +++ b/nuttx/examples/nettest/nettest-client.c @@ -84,7 +84,7 @@ void send_client(void) #if 0 myaddr.sin_addr.s_addr = HTONL(INADDR_LOOPBACK); #else - myaddr.sin_addr.s_addr = HTONL(192 << 24 | 168 << 16 | 0 << 8 |106); + myaddr.sin_addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_CLIENTIP); #endif printf("client: Connecting...\n"); diff --git a/nuttx/examples/nettest/nettest.c b/nuttx/examples/nettest/nettest.c index 1afa21182..9bcee01ff 100644 --- a/nuttx/examples/nettest/nettest.c +++ b/nuttx/examples/nettest/nettest.c @@ -39,6 +39,7 @@ #include <nuttx/config.h> #include <stdio.h> +#include <debug.h> #include <net/uip/uip.h> #include <net/uip/uip-lib.h> @@ -80,17 +81,17 @@ int user_start(int argc, char *argv[]) /* Set up our host address */ - uip_ipaddr(addr.s_addr, 192, 168, 0, 128 ); + addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_IPADDR); uip_sethostaddr("eth0", &addr); /* Set up the default router address */ - uip_ipaddr(addr.s_addr, 192, 168, 0, 1); + addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_DRIPADDR); uip_setdraddr("eth0", &addr); /* Setup the subnet mask */ - uip_ipaddr(addr.s_addr, 255, 255, 255, 0); + addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_NETMASK); uip_setnetmask("eth0", &addr); #ifdef CONFIG_NETTEST_SERVER diff --git a/nuttx/examples/uip/main.c b/nuttx/examples/uip/main.c index ded7bca20..eaac73a99 100644 --- a/nuttx/examples/uip/main.c +++ b/nuttx/examples/uip/main.c @@ -49,6 +49,7 @@ #include <string.h> #include <unistd.h> #include <time.h> +#include <debug.h> #include <net/uip/uip.h> #include <net/uip/uip-arp.h> @@ -140,17 +141,17 @@ int user_start(int argc, char *argv[]) #if !defined(CONFIG_EXAMPLE_UIP_DHCPC) /* Set up our host address */ - uip_ipaddr(addr.s_addr, 192, 168, 0, 128 ); + addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_IPADDR); uip_sethostaddr("eth0", &addr); /* Set up the default router address */ - uip_ipaddr(addr.s_addr, 192, 168, 0, 1); + addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_DRIPADDR); uip_setdraddr("eth0", &addr); /* Setup the subnet mask */ - uip_ipaddr(addr.s_addr, 255, 255, 255, 0); + addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_NETMASK); uip_setnetmask("eth0", &addr); #endif |