leaps_inet_cfg_set

This call is available only on the ethernet gateway. It sets the local network interface mode (DHCP or static IP) and selects Ethernet or WiFi as the active interface. The configuration is stored in non-volatile memory. Call leaps_reset to apply changes. See also the shell command ipv4.


Input
  • is_static: ‘0’ | ‘1’ (‘0’ = DHCP, addr/netmask/gw are ignored; ‘1’ = static IP)

  • use_wifi: ‘0’ | ‘1’ (‘0’ = Ethernet, ‘1’ = WiFi)

  • addr: IPv4 address as little-endian uint32 (used only when is_static = ‘1’, e.g. 192.168.1.10)

  • netmask: IPv4 netmask as little-endian uint32 (used only when is_static = ‘1’, e.g. 255.255.255.0)

  • gw: IPv4 gateway as little-endian uint32 (used only when is_static = ‘1’, e.g. 192.168.1.1)


Example

Static IP 192.168.1.10/24, gateway 192.168.1.1, via Ethernet (is_static=1, use_wifi=0):

TLV Request

Type

Length

Value

byte 0: flags

  • Bit 0: is_static

  • Bit 1: use_wifi

  • Bits [7:2]: reserved

bytes 1–3: reserved (0x00 0x00 0x00)
bytes 4–7: addr (IPv4, little-endian uint32)
bytes 8–11: netmask (IPv4, little-endian uint32)
bytes 12–15: gw (IPv4, little-endian uint32)

0x98

0x10

0x01 0x00 0x00 0x00 0x0A 0x01 0xA8 0xC0 0x00 0xFF 0xFF 0xFF 0x01 0x01 0xA8 0xC0

In this example:

  • Static IP is 192.168.1.10/24

  • Gateway is 192.168.1.1

  • via Ethernet (is_static=1, use_wifi=0)

Type 0x98 (152 dec) means command leaps_inet_cfg_set

TLV response

Type

Length

Value

0x40

0x01

0x00

Type 0x40 means status code