Wi-Fi Common AT Commands#
Overview#
This section describes common AT commands for managing Wi-Fi functionality on SiWx91x devices.
Commands#
wifi-get-mac#
Retrieve the MAC address of a given Wi-Fi interface.
Command Format#
at+wifi-get-mac=<interface>
Related SDK API:
Pre-conditions#
Parameters#
interface#
Numeric value from enum sl_wifi_interface_t.
Note: The enum values of sl_wifi_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 <MAC Address>
in case of success, represented as a series of characters from a 6-byte MAC Address string with each byte separated by a colon (:) (see example below).ERROR <Error Code>
in case of failure. Possible error codes are the same as those returned by the sl_wifi_get_mac_address API.
Examples#
// Return MAC address for client interface
at+wifi-get-mac=1
OK 00:B0:D0:63:C2:26
wifi-net-info?#
Returns information about the Wi-Fi network in either client or Access Point mode.
Command Format#
at+wifi-net-info?
Related SDK API
Pre-conditions#
Parameters#
None
Response#
OK <wlan-state> <channel-number> <ssid> <mac-address> <sec-type> <psk-pmk> <ipv4-address> <ipv6-address>
in case of success, where:wlan-state
is sent asCONNECTED
orDISCONNECTED
channel-number
is the channel over which the Access Point is connectedssid
is the SSID of the connected Access Point enclosed in quotesmac-address
is the MAC Address assigned to the SiWx91x device, represented as a series of characters from a 6 byte MAC Address string with a colon (:) separating every byte (see example below).sec-type
is the Wi-Fi authentication type in use. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_security_t.psk-pmk
is sent as the PMK string of the Wi-Fi clientipv4-address
is the human readable IPv4 address of the SiWx91x device, or 0 if there is none (in case only IPv6 is enabled).ipv6-address
is the human readable IPv6 address of the SiWx91x device, or 0 if there is none (in case only IPv4 is enabled).
ERROR <error code>
in case of failure. Possible error codes are the same as those returned by the sl_wifi_get_wireless_info API.
Examples#
// In Wi-Fi client mode
at+wifi-net-info?
OK CONNECTED 4 "Silabs_AP" 00:B0:D0:63:C2:26 7 "Silabs1234" 192.168.12.1 ff06::c3
wifi-is-ifup#
Returns the current "up" or "down" state of a Wi-Fi interface.
Command Format#
at+wifi-is-ifup=<wifi-interface>
Related SDK API
Pre-conditions#
Parameters#
wifi-interface#
Numeric value set to one of the values of the enum sl_wifi_interface_t.
Note: The enum values of sl_wifi_interface_t are not in the default numerical order of an enum. See sl_wifi_constants.h for the actual numeric values in this enum.
Response#
OK <status>
in case of success, where thestatus
is sent as1
if the interface is up, or0
if the interface is down.
Examples#
// Query the up/down state of the Wi-Fi client interface
at+wifi-is-ifup=1
OK 1