zephyr: Use CONFIG_NET_APP_SETTINGS to setup initial network addresses.

Ideally, these should be configurable from Python (using network module),
but as that doesn't exist, we better off using Zephyr's native bootstrap
configuration facility.
crypto-aes
Paul Sokolovsky 5 years ago
parent 6f1a615427
commit 58ea239510

@ -60,7 +60,9 @@ static char *stack_top;
static char heap[MICROPY_HEAP_SIZE];
void init_zephyr(void) {
// TODO: Make addresses configurable
// We now rely on CONFIG_NET_APP_SETTINGS to set up bootstrap
// network addresses.
#if 0
#ifdef CONFIG_NETWORKING
if (net_if_get_default() == NULL) {
// If there's no default networking interface,
@ -81,6 +83,7 @@ void init_zephyr(void) {
static struct in6_addr in6addr_my = {{{0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}};
net_if_ipv6_addr_add(net_if_get_default(), &in6addr_my, NET_ADDR_MANUAL, 0);
#endif
#endif
}
int real_main(void) {

@ -18,6 +18,14 @@ CONFIG_NET_SOCKETS=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NET_NBUF_RX_COUNT=5
CONFIG_NET_APP_SETTINGS=y
CONFIG_NET_APP_INIT_TIMEOUT=3
CONFIG_NET_APP_NEED_IPV6=y
CONFIG_NET_APP_NEED_IPV4=y
CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1"
CONFIG_NET_APP_MY_IPV4_ADDR="192.0.2.1"
CONFIG_NET_APP_MY_IPV4_GW="192.0.2.2"
# DNS
CONFIG_DNS_RESOLVER=y
CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES=2

Loading…
Cancel
Save