IP Management AT Commands#
This section describes AT commands for DHCP and static IP configuration.
Commands#
net-dhcp-conf#
Configure the DHCP retry interval and retry count settings to use during DHCP IPv4 configuration.
Command Format#
at+net-dhcp-conf=<min-discover-retry-interval>,<max-discover-retry-interval>,<min-request-retry-interval>,<max-request-retry-interval>,<max-discover-retries>,<max-request-retries>
Related SDK API
Pre-conditions#
Parameters#
min-discover-retry-interval#
The minimum interval (in seconds) at which to retry discovery during DHCP IPv4 configuration.
max-discover-retry-interval#
The maximum interval (in seconds) at which to retry discovery during DHCP IPv4 configuration.
min-request-retry-interval#
The minimum interval (in seconds) at which to retry the IP request during DHCP IPv4 configuration.
max-request-retry-interval#
The maximum interval (in seconds) at which to retry the IP request during DHCP IPv4 configuration.
max-discover-retries#
The maximum number of retries to perform for discovery during DHCP IPv4 configuration.
max-request-retries#
The maximum number of retries to perform for the IP request during DHCP IPv4 configuration.
Response#
OK
on successERROR 0x0001
in case of failure
Notes#
This command is optional. If you do not set these configuration values, they use default values.
The net-conf-ip command uses the configurations set with the net-dhcp-conf command.
Examples#
at+net-dhcp-conf=100,200,200,400,2,3
net-conf-ip#
Performs IP address configuration for a connected SiWx91x device.
Command Format#
at+net-conf-ip=<interface>,<mode>,<type>,<host-name>,<ipv4-address>,<ipv4-gateway>,<ipv4-netmask>,<ipv6-link-local-address>,<ipv6-global-address>,<ipv6-gateway>,<timeout>
Related SDK API
Pre-conditions#
Parameters#
interface#
The network interface for which IP configuration is to be performed. This is a numeric value corresponding to one of the values of the enum sl_net_interface_t. Some enum values may not be supported; refer to the linked documentation for details.
Note: The enum values of sl_net_interface_t are not in the default numerical order of an enum. See sl_net_constants.h for the actual numeric values in this enum.
mode#
The method to be used for IP configuration (for example, DHCP). Contains a numeric value that corresponds to one of the values of the enum sl_net_ip_management_t in the file sl_ip_types.h.
type#
The type of IP address to be configured (for example, IPv4). Contains a numeric value that corresponds to one of the values of the enum sl_ip_address_type_t
in the file sl_ip_types.h. You can combine multiple values by using a bitwise or (|)
operator (for example, (1<<2) | (1<<3) (= 12)
specifies both IPv4 and IPv6 address configurations).
host-name#
Optional. A string specifying the network host name to be set for the SiWx91x device. Set to an empty value if a host name is not specified.
ipv4-address#
Specified if the type
bitmap includes IPv4 configuration and mode
is set to static. The static IPv4 address to be configured for the SiWx91x device.
ipv4-gateway#
Specified if the type
bitmap includes IPv4 configuration and mode
is set to static. The static IPv4 gateway address to be configured for the SiWx91x device.
ipv4-netmask#
Specified if the type
bitmap includes IPv4 configuration and mode
is set to static. The static IPv4 subnet mask to be configured for the SiWx91x device.
ipv6-link-local-address#
Reserved for future use (currently not supported). Specified if the type
bitmap includes IPv6 configuration and mode
is set to static. The static IPv6 link-local address to be configured for the SiWx91x device.
ipv6-global-address#
Specified if the type
bitmap includes IPv6 configuration and mode
is set to static. The static IPv6 global address to be configured for the SiWx91x device.
ipv6-gateway#
Specified if the type
bitmap includes IPv6 configuration and mode
is set to static. The static IPv6 gateway address to be configured for the SiWx91x device.
timeout#
The amount of time in milliseconds after which the IP address configuration is aborted.
Response#
OK
on successERROR <error code>
in case of failure. Possible error codes are same as those returned by the sl_net_configure_ip API.
Examples#
// Perform IPv4 configuration using DHCP for the Wi-Fi client interface with timeout of 60 seconds
at+net-conf-ip=8,2,4,,,,,,,60000