mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 02:43:33 +08:00
Change all occurrences of CONFIG_EXAMPLE_ to CONFIG_EXAMPLES_ for consistency; fleshed out a few more Kconfig files
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5211 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -6,8 +6,32 @@
|
||||
config EXAMPLES_WGET
|
||||
bool "wget example"
|
||||
default n
|
||||
depends on NET_TCP && !NSH_BUILTIN_APPS
|
||||
---help---
|
||||
Enable the wget example
|
||||
|
||||
if EXAMPLES_WGET
|
||||
|
||||
config EXAMPLES_WGET_URL
|
||||
string "File URL"
|
||||
default ""
|
||||
---help---
|
||||
The URL of the file to get
|
||||
|
||||
config EXAMPLES_WGET_NOMAC
|
||||
bool "Use Canned MAC Address"
|
||||
default n
|
||||
|
||||
config EXAMPLES_WGET_IPADDR
|
||||
hex "Target IP address"
|
||||
default 0x0a000002
|
||||
|
||||
config EXAMPLES_WGET_DRIPADDR
|
||||
hex "Default Router IP address (Gateway)"
|
||||
default 0x0a000001
|
||||
|
||||
config EXAMPLES_WGET_NETMASK
|
||||
hex "Network Mask"
|
||||
default 0xffffff00
|
||||
|
||||
endif
|
||||
|
||||
+12
-12
@@ -62,16 +62,16 @@
|
||||
* but there are default values for those so we cannot check them here.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_EXAMPLE_WGET_IPADDR
|
||||
# error "You must define CONFIG_EXAMPLE_WGET_IPADDR"
|
||||
#ifndef CONFIG_EXAMPLES_WGET_IPADDR
|
||||
# error "You must define CONFIG_EXAMPLES_WGET_IPADDR"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_EXAMPLE_WGET_DRIPADDR
|
||||
# error "You must define CONFIG_EXAMPLE_WGET_DRIPADDR"
|
||||
#ifndef CONFIG_EXAMPLES_WGET_DRIPADDR
|
||||
# error "You must define CONFIG_EXAMPLES_WGET_DRIPADDR"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_EXAMPLE_WGET_NETMASK
|
||||
# error "You must define CONFIG_EXAMPLE_WGET_NETMASK"
|
||||
#ifndef CONFIG_EXAMPLES_WGET_NETMASK
|
||||
# error "You must define CONFIG_EXAMPLES_WGET_NETMASK"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NET
|
||||
@@ -112,13 +112,13 @@ static void callback(FAR char **buffer, int offset, int datend,
|
||||
int wget_main(int argc, char *argv[])
|
||||
{
|
||||
struct in_addr addr;
|
||||
#if defined(CONFIG_EXAMPLE_WGET_NOMAC)
|
||||
#if defined(CONFIG_EXAMPLES_WGET_NOMAC)
|
||||
uint8_t mac[IFHWADDRLEN];
|
||||
#endif
|
||||
|
||||
/* Many embedded network interfaces must have a software assigned MAC */
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_WGET_NOMAC
|
||||
#ifdef CONFIG_EXAMPLES_WGET_NOMAC
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xe0;
|
||||
mac[2] = 0xde;
|
||||
@@ -130,21 +130,21 @@ int wget_main(int argc, char *argv[])
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLE_WGET_IPADDR);
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_WGET_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLE_WGET_DRIPADDR);
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_WGET_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLE_WGET_NETMASK);
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_WGET_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
|
||||
/* Then start the server */
|
||||
|
||||
wget(CONFIG_EXAMPLE_WGET_URL, g_iobuffer, 512, callback, NULL);
|
||||
wget(CONFIG_EXAMPLES_WGET_URL, g_iobuffer, 512, callback, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user