Network Interface AT Commands#
This section describes AT commands for configuring and controlling network interfaces on the SiWx91x device.
Commands#
oper-mode#
Configure the operation mode of the SiWx91x device.
Command Format#
at+oper-mode=<oper-mode>
Related SDK API
sl_wifi_device_configuration_t->boot_config->oper_mode
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-init
was not sent earlier
Parameters#
oper-mode#
The operation mode of the device. Contains a numeric value that corresponds to one of the values of the enum sl_si91x_operation_mode_t.
Note: The enum values of sl_si91x_operation_mode_t are not in strict numerical order. Refer to sl_wifi_device.h for the actual numeric values in this enum.
Response#
OK
on successERROR 0x0001
in case of failure
Notes#
Enterprise Client Mode, Transceiver Mode, and Transmit Test Mode are not currently supported.
Concurrent Mode is not currently supported, due to the AP related commands not being supported.
The
oper-mode
set by this command will have no effect if the command is sent out of sequence (see Pre-conditions above).This command is optional. If it is not sent, the oper-mode defaults to 0 (client mode), and the Wi-Fi device configuration parameters are set to their default values as described in the table below.
If this command is sent, it must either be the first command in the session or the first command sent after
net-deinit
. An error code will be returned if this command is sent out of sequence.The Wi-Fi device configuration parameters are defaulted based on
oper-mode
(see table below).Other Configuration-related AT commands sent after this (for example,
at+region-code
) will override the specified parameters.
oper-mode | Default Configuration that is set from sl_wifi_device.h |
---|---|
0 |
|
6 |
|
Examples#
// Set the device operation mode to client mode
at+oper-mode=0
mac-addr#
Set the MAC address of the SiWx91x device.
Command Format#
at+mac-addr=<mac-address>
Related SDK API
sl_wifi_device_configuration_t::mac_address
Pre-conditions#
net-deinit if net-init was sent earlier
None if net-init was not sent earlier
Parameters#
mac-address#
The MAC address to be set for the SiWx91x device, represented as a series of characters from a 6 byte MAC Address string with a colon (:) separating each byte (see example below).
Response#
OK
on successERROR 0x0001
in case of failure.
Notes#
The
mac-address
set by this command will have no effect if this command is sent out of sequence (see Pre-conditions above).
Examples#
// Set the MAC address of SiSiWx91x device
at+mac-addr=6c:5c:b1:c7:12:69
region-code#
Set the WLAN region of the SiWx91x device.
Command Format#
at+region-code=<region-code>
Related SDK API
sl_wifi_device_configuration_t::region_code
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-init
was not sent earlieroper-mode=0
(Client)If you do not explicitly send the commands, 'oper-mode' will use default values.
Parameters#
region-code#
Numeric value from enum sl_si91x_region_code_t
Note: Some values are not currently supported, as indicated in the linked documentation.
Response#
OK
on successERROR 0x0001
in case of failure.
Notes#
The
region-code
set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
// Set region to US
at+region-code=1
enable-ssl#
Enable or disable SSL in the network stack.
Command Format#
at+enable-ssl=<enable-ssl>
Related SDK API
SL_SI91X_TCP_IP_FEAT_SSL bit in sl_wifi_device_configuration_t::boot_config->tcp_ip_feature_bit_map
Parameters#
enable-ssl#
Set to 0 to disable or 1 to enable SSL.
Pre-conditions#
net-deinit if net-init was sent earlier
None if net-init was not sent earlier
oper-mode=0
(Client)If you do not explicitly send the commands,
oper-mode
will use default values.
Response#
OK
on successERROR 0x0001
in case of failure.
Notes#
The enable-ssl
flag set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
// Enable SSL
at+enable-ssl=1
// Disable SSL
at+enable-ssl=0
net-init#
Initialize a network interface.
Command Format#
at+net-init=<interface>
Related SDK API
Pre-conditions#
None
Parameters#
interface#
Numeric value from enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
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.
Response#
OK
on successERROR <error code>
in case of failure. Possible error codes are the same as those returned by sl_net_init API.
Notes#
To use non-default values for specific network configuration parameters, send the following optional AT commands before sending sl_net_init:
oper-mode
mac-addr
region-code
enable-ssl
Note:
The nwp_pool and efuse_data_type configuration parameters will be supported in a future cycle.
The band_mode configuration parameter is not currently supported, because 2.4GHz is the only band available on SiWx91x.
TCP/IP bypass mode is not supported for AT commands in SoC mode on the SiWx91x.
Example#
// Initialize the default Wi-Fi client interface
at+net-init=8
net-up#
Bring up a network interface by establishing a connection over the specified interface using the specified networking profile.
Command Format#
at+net-up=<interface>,<profile-id>
Related SDK API
Pre-conditions#
Parameters#
interface#
The network interface for which a network connection is to be established. Contains a numeric value that corresponds to one of the values of the enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
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.
profile-id#
The networking profile that contains saved details, such as the SSID of the Access Point, to use when establishing a connection. Contains a numeric value that corresponds to one of the values of the enum sl_net_profile_id_t.
Response#
OK
on successERROR <error code>
in case of failure. Possible error codes are the same as those returned by sl_net_up API.
Notes#
The
profile-id
should have been previously saved using one of the Network Profile AT commands.
Example#
// Bring up the Wi-Fi interface using profile ID 0
at+net-up=8,0
net-down#
Bring down a network interface by terminating the network connection over the specified interface.
Command Format#
at+net-down=<interface>
Related SDK API
Pre-conditions#
Parameters#
interface#
The network interface for which a network connection is to be terminated. Contains a numeric value that corresponds to one of the values of the enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
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.
Response#
OK
on successERROR <error code>
in case of failure. Possible error codes are the same as those returned by sl_net_down API.
Examples#
// Bring down the Wi-Fi interface
at+net-down=8
net-deinit#
De-initialize a network interface.
Command Format#
at+net-deinit=<interface>
Related SDK API
Pre-conditions#
Parameters#
interface#
The type of network interface to be de-initialized. Contains a numeric value that corresponds to one of the values of the enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
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.
Response#
OK
on successERROR <error code>
in case of failure. Possible error codes are the same as those returned by sl_net_deinit API.
Examples#
// De-initialize the Wi-Fi interface
at+net-deinit=8