AT Commands Example Summary
This example demonstrates AT command interface for controlling the extensive networking capabilities of the CC35xx device.
| Module | Description |
|---|---|
| Device | Basic device commands such as help, version, and echo control. |
| WLAN | WiFi link layer functions including scan, connect, role management, and MAC address operations. |
| Socket | Socket APIs for creating connections and sending/receiving data over TCP and UDP. |
| NetCfg | Network configuration including IP settings, DHCP server, and ping utilities. |
| BLE | Bluetooth Low Energy commands for advertising, scanning, and connection management. |
Each module contains several AT commands accessible via the UART interface. Commands follow the standard AT command format: at+<command>=<parameters>. Any events or application output will be displayed on the UART terminal screen. In the Available Commands section, we will discuss each module and its commands in greater detail.
Example Usage
- Build the project and run it. See the Getting Started Guide in the
docsdirectory of your SDK root. - Open a serial port session (e.g., ‘HyperTerminal’, ‘puTTY’, ‘Tera Term’, etc.) to the appropriate COM port, listed as ‘User UART’. The COM port can be determined via Device Manager in Windows or via
ls /dev/tty*in Linux.
The connection should have the following settings:
Baud-rate: 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow Control: None
Once the application completes its initialization and the network processor is up, the application banner will be displayed, showing version details:
******************************************************************
******************* AT Commands ************************
******************* Version x.x.x.x ********************
******************************************************************
At this point, the application is ready to receive AT commands from the user.
Application Overview
AT Commands is an interface application that provides a standard AT command set for controlling the CC35xx device’s networking capabilities. It offers commands that are sent to the application via UART, parsed, and dispatched to the appropriate handlers.
The application operates by continuously monitoring the UART input for AT commands. Commands follow the standard AT command syntax:
- Basic command format:
at+<command> - Command with parameters:
at+<command>=<param1>,<param2>,... - Query command format:
at+<command>?
When a command is received, the application parses the command string and extracts the command name and parameters. It searches for the command in the global command table (ATCmd_list), which stores entries for each command including the command string, a callback handler, and usage information.
If the command matches a table entry, the appropriate handler is dispatched with the parsed parameters. All callback functions follow the naming convention: ATCmd<Module>_<command>Callback and reside in the appropriate module file. For example, WLAN-related callbacks are implemented in atcmd_wlan.c.
The application provides both synchronous responses (command results) and asynchronous events (connection status, scan results, etc.) back to the host via UART. Events are formatted with standard AT event syntax and can be received at any time.
Important Notes
Buffer Limitations: Commands and events buffers in this example are limited to 520 bytes, by design. After typing 520 bytes, the currently typed command will be deleted and a new command prompt will appear.
Command Cancellation: Commands can be cancelled during insertion by pressing “Ctrl+C”. This applies to
at+sendandat+sendtocommands which can prompt for more data if the inserted payload doesn’t match the stated payload length.Command History: Command history navigation using arrow keys in terminal isn’t functioning correctly when using long commands.
Protocol Syntax
Commands
Commands follow the standard AT command syntax:
AT+<command name>=<param1>, <param2>, ...,<paramX>
Command Format Rules:
- Commands with parameters must include an equal sign (=) between the command name and the first parameter.
- Parameters must be separated by comma delimiters (,).
- Empty parameters (defined as “ignore” or “optional”) should be left empty with comma delimiters intact (,,).
- Empty parameters are treated as 0 or NULL (according to parameter type). If not defined as “ignore” or “optional”, an error will be raised.
- String parameters containing spaces must be enclosed with quotes (" “).
- String parameters containing commas must be enclosed with quotes (" “).
- Numeric parameters can be:
- Decimal
- Hexadecimal (with 0x prefix for values, not addresses like MAC)
- Numeric array parameters can be enclosed with square brackets ([ ]) and include:
- IPv4 address: x.x.x.x or [x.x.x.x] (four 8-bit values with . delimiter)
- IPv6 address: x❌x:x or [x❌x:x] (four 32-bit values with : delimiter)
- MAC address: x❌x❌x:x or [x❌x❌x:x] (six 8-bit values with : delimiter)
- Bitmask parameters use vertical bar (|) as delimiter: x|x|x or [x|x|x]
- AT commands can be entered in uppercase or lowercase with spaces between arguments.
- Data parameters can be:
- Binary format
- Base64 format (binary to text encoding)
Command Return Status
Commands return one of the following:
- Success:
OK - Success with values:
<command name>: <value1>, ...,<valueX> - Failure:
<event name>: <event ID>,<value1>,...,<valueX>
Return status includes a colon mark (:) between the command/event name and the first value. List values are separated by semicolon mark (;) between list members.
Asynchronous Events
Events may arrive at any time and follow this format:
<event name>: <event ID>,<value1>,...,<valueX>
The event includes a colon mark (:) between the event name and the event ID.
Available Commands
The AT Commands application supports the following command categories:
Device Commands
Basic device control and information commands.
WLAN Commands
WiFi operations including role management, scanning, connecting, and network configuration.
Socket Commands
Socket creation and data transfer operations for TCP and UDP communications.
Network Configuration Commands
IP configuration, DHCP server setup, and network utilities.
BLE Commands
Bluetooth Low Energy operations for advertising, scanning, and connection management.
Device Commands
at+help
This command displays help information about available AT commands.
Usage:
at+help
Description:
Display list of available commands and their usage.
Response:
OK
at+test
This command tests the AT command interface by returning “OK”.
Usage:
at+test
Description:
Test command to verify AT interface is responsive.
Response:
OK
at+version
This command displays the application version information.
Usage:
at+version
Description:
Display application version details.
Response:
+version:[version]
OK
at+ate1
This command enables echo mode where received characters are echoed back.
Usage:
at+ate1
Description:
Enable echo of received characters.
Response:
OK
at+ate0
This command disables echo mode.
Usage:
at+ate0
Description:
Disable echo of received characters.
Response:
OK
WLAN Commands
- at+wlanstart
- at+wlanstop
- at+wlanstaroleup
- at+wlanaproleup
- at+wlanroledown
- at+wlanscan
- at+wlanconnect
- at+wlandisconnect
- at+wlangetmacaddress
- at+wlansetmacaddress
at+wlanstart
This command initializes and starts the WLAN subsystem. It starts the network processor, enables power management (ELP mode), configures transmission control parameters, and marks the network interface as active.
Usage:
at+wlanstart
Description:
Initialize and start the WLAN subsystem.
Response:
OK
at+wlanstop
This command stops the WLAN subsystem. It automatically brings down any active roles (STA and/or AP) before stopping the network processor and marking the network interface as inactive.
Usage:
at+wlanstop
Description:
Stop the WLAN subsystem and all active roles.
Response:
OK
at+wlanstaroleup
This command adds and starts the station role on the device:
- Adding a new STA netif interface to the network stack.
- Adding a new WLAN role ID by dispatching the appropriate command to the CC35xx device.
Usage:
at+wlanstaroleup
Description:
Start device in station mode.
Response:
OK
Note: This command is used to start the device in station mode after it is powered on and all modules are initialized.
at+wlanaproleup
This command adds and starts the access point role on the device with the specified configuration.
Usage:
at+wlanaproleup=[SSID],[SecurityType],[SecurityKey],[Hidden],[Channel],[StaLimit]
Parameters:
SSID - AP's SSID (max 32 characters)
SecurityType - Security type (OPEN, WPA_WPA2, WPA2_PLUS, WPA3)
WPA2_PLUS enables PMF (Protected Management Frames)
SecurityKey - Password for secured networks (8-63 characters for WPA)
Hidden - Hidden SSID (0=visible, 1=hidden)
Channel - 802.11 WLAN channel
StaLimit - Maximum number of connected stations (1-4)
Description:
Start device as access point with specified settings.
Response:
OK
at+wlanroledown
This command removes and stops a WLAN role on the device.
Usage:
at+wlanroledown=[Role]
Parameters:
Role - Role type (STA or AP)
Description:
Stop and remove specified WLAN role.
Response:
OK
at+wlanscan
This command allows a user to execute a WLAN scan and retrieve scan results from the network processor.
Usage:
at+wlanscan=[count]
Parameters:
count - Maximum number of APs to look for
Description:
Scan for available access points.
Once the scan command has successfully completed, events will be triggered showing the available networks.
Example:
at+wlanscan=20
+eventwlan:scan_result,SSID1,94:10:3e:c6:70:a4,-26,1,WPA_WPA2,disabled,0
+eventwlan:scan_result,SSID2,cc:db:93:43:da:80,-61,1,OPEN,disabled,0
+eventwlan:scan_result,SSID3,34:03:de:10:fc:43,-59,1,WPA3,capable,0
Note: The maximum number to show is 20.
at+wlanconnect
This command allows a user to connect to an AP. It receives the following parameters:
Usage:
at+wlanconnect=[SSID],[BSSID],[SecurityType],[SecurityKey]
For WPS:
at+wlanconnect=[SecurityType],[SecurityKey]
Parameters:
SSID - AP's SSID
BSSID - AP's MAC address (optional)
SecurityType - Security type (OPEN, WPA_WPA2, WPA2_PLUS, WPA3, WPS_PBC, WPS_PIN)
WPA2_PLUS enables PMF (Protected Management Frames)
SecurityKey - Password for secured networks (not needed for WPS_PBC)
Response:
OK
Note: This command is blocking, and the connection process may take several seconds.
Example:
at+wlanconnect="myhome network",WPA_WPA2,password
at+wlandisconnect
This command allows a user to disconnect from an AP, if currently connected to one.
Usage:
at+wlandisconnect
Description:
Disconnect from currently connected AP.
Response:
OK
- Expected Events: Disconnect event will be sent indicating the disconnection status.
at+wlangetmacaddress
This command allows a user to get the device MAC address. It receives the following parameter:
- Role Type: There are two role types available: 0 for Station and 2 for Access Point (AP).
Usage:
at+wlangetmacaddress=[RoleType]
Parameters:
RoleType - Role type (STA or AP)
Description:
Get MAC address for specified role.
Response:
+wlangetmacaddress:[RoleType],[MacAddress]
OK
RoleType - Role type (STA or AP)
MacAddress - MAC address in format AA:BB:CC:DD:EE:FF
Note: We support
STA roleandAP role.
Example:
at+wlangetmacaddress=sta
+wlangetmacaddress:sta,a8:1b:6a:a9:90:f2
OK
at+wlansetmacaddress
This command allows a user to set the device’s MAC address. It receives the following parameters:
- Role Type: There are two role types available: STA or AP.
- MAC Address: The new MAC address in format AA:BB:CC:DD:EE:FF.
Usage:
at+wlansetmacaddress=[RoleType],[MacAddress]
Parameters:
RoleType - Role type (STA or AP)
MacAddress - New MAC address
Description:
Set MAC address for specified role.
Response:
OK
To apply the changes, you must stop and restart the role. The command won’t work if the specified role is already started.
Example:
at+wlansetmacaddress=sta,AA:BB:CC:DD:EE:FF
OK
at+wlanstaroleup
OK
at+wlangetmacaddress=sta
+wlangetmacaddress:sta,aa:bb:cc:dd:ee:ff
OK
Socket Commands
at+socket
This command creates a new socket and returns a socket descriptor.
Usage:
at+socket=[Family],[Type],[Protocol]
Parameters:
Family - Address family (inet=IPv4)
Type - Socket type (stream=TCP, dgram=UDP)
Protocol - Protocol (tcp, udp)
Description:
Create a new socket.
Response:
+socket:[SocketId]
OK
SocketId - Socket descriptor for use in subsequent socket operations
Example:
at+socket=inet,stream,tcp
+socket:0
OK
at+close
This command closes an open socket.
Usage:
at+close=[SocketId]
Parameters:
SocketId - Socket descriptor to close
Description:
Close specified socket.
Response:
OK
at+accept
This command accepts an incoming connection on a listening socket (TCP server).
Usage:
at+accept=[SocketId],[Family]
Parameters:
SocketId - Listening socket descriptor
Family - Specifies the protocol family of the created socket (inet=IPv4)
Description:
Accept incoming connection on server socket.
Response:
OK
+accept:[NewSocket],[Family],[Port],[Address]
NewSocket - New connected socket descriptor
Family - Internet protocol (inet for IPv4)
Port - Remote peer's port number
Address - Remote peer's IP address
at+bind
This command binds a socket to a local address and port.
Usage:
at+bind=[SocketId],[Family],[Port],[IpAddress]
Parameters:
SocketId - Socket descriptor
Family - Address family (inet=IPv4)
Port - Local port number
IpAddress - Local IP address
Description:
Bind socket to local address and port.
Response:
OK
at+listen
This command sets a socket to listen for incoming connections (TCP server).
Usage:
at+listen=[SocketId],[Backlog]
Parameters:
SocketId - Socket descriptor
Backlog - Maximum pending connections
Description:
Set socket to listen for incoming connections.
Response:
OK
at+connect
This command connects a socket to a remote address (TCP client).
Usage:
at+connect=[SocketId],[Family],[Port],[IpAddress]
Parameters:
SocketId - Socket descriptor
Family - Address family (inet=IPv4)
Port - Remote port number
IpAddress - Remote IP address
Description:
Connect socket to remote address.
Response:
OK
Example:
at+connect=0,inet,5001,192.168.1.100
OK
at+send
This command sends data over a connected socket (TCP).
Usage:
at+send=[SocketId],[Length],[Format],[Data]
Parameters:
SocketId - Socket descriptor
Length - Number of bytes to send
Format - Data format (0=Binary, 1=Base64)
Data - Data to send
Description:
Send data over connected socket.
Response:
OK
at+recv
This command receives data from a connected socket (TCP).
Usage:
at+recv=[SocketId],[Format],[Length]
Parameters:
SocketId - Socket descriptor
Format - Data format (0=Binary, 1=Base64)
Length - Maximum number of bytes to receive
Description:
Receive data from connected socket.
Response:
+recv:[SocketId],[Format],[Length],[Data]
OK
SocketId - Socket descriptor from which data was received
Format - Data format (0=Binary, 1=Base64)
Length - Actual number of bytes received
Data - Received data in specified format
Note:
Length units are always bytes, regardless of the format.
Response length is adjusted to the format used in the command invocation.
at+sendto
This command sends data to a specific address (UDP).
Usage:
at+sendto=[SocketId],[Family],[Port],[IpAddress],[Format],[Length],[Data]
Parameters:
SocketId - Socket descriptor
Family - Address family (inet=IPv4)
Port - Destination port number
IpAddress - Destination IP address
Format - Data format (0=Binary, 1=Base64)
Length - Number of bytes to send
Data - Data to send
Description:
Send data to specified address (UDP).
Response:
OK
at+recvfrom
This command receives data and source address (UDP).
Usage:
at+recvfrom=[SocketId],[Format],[Length]
Parameters:
SocketId - Socket descriptor
Format - Data format (0=Binary, 1=Base64)
Length - Maximum number of bytes to receive
Description:
Receive data and source address (UDP).
Response:
+recvfrom:[SocketId],[Format],[Length],[Data]
OK
SocketId - Socket descriptor from which data was received
Format - Data format (0=Binary, 1=Base64)
Length - Actual number of bytes received
Data - Received data in specified format
Note:
Length units are always bytes, regardless of the format.
Response length is adjusted to the format used in the command invocation.
Network Configuration Commands
- at+netcfgsetinterfaceip
- at+netcfggetinterfaceip
- at+netcfgsetdhcpserver
- at+netcfggetdhcpserver
- at+ping
- at+pingstop
at+netcfgsetinterfaceip
This command configures the IP settings for a network interface.
Usage:
at+netcfgsetinterfaceip=[Interface],[DhcpMode]<,[IpAddress],[SubnetMask],[Gateway]>
Parameters:
Interface - Interface ID (sta, ap)
DhcpMode - DHCP mode (static, dhcp)
IpAddress - IP address (use if (DhcpMode==dhcp) && (Interface==ap))
SubnetMask - Subnet mask (use if (DhcpMode==dhcp) && (Interface==ap))
Gateway - Gateway address (use if (DhcpMode==dhcp) && (Interface==ap))
Description:
Set IP configuration for network interface.
Response:
OK
at+netcfggetinterfaceip
This command retrieves the IP settings for a network interface.
Usage:
at+netcfggetinterfaceip=[Interface]
Parameters:
Interface - Interface ID (sta, ap)
Description:
Get IP configuration for network interface.
Response:
+netcfggetinterfaceip:[Interface],[IpAddress],[SubnetMask],[Gateway]
OK
Interface - Interface ID (sta, ap)
IpAddress - IP address of the interface
SubnetMask - Subnet mask
Gateway - Gateway address
Example:
at+netcfggetinterfaceip=sta
+netcfggetinterfaceip:sta,192.168.1.100,255.255.255.0,192.168.1.1
OK
at+netcfgsetdhcpserver
This command configures the DHCP server settings for AP mode.
Usage:
at+netcfgsetdhcpserver=[LeaseTime],[StartAddress],[EndAddress]
Parameters:
LeaseTime - Lease time in seconds
StartAddress - Starting IP address for DHCP pool
EndAddress - Ending IP address for DHCP pool
Description:
Configure DHCP server settings for AP mode.
Response:
OK
Note:
For now the range is limited to 100 adresses only.
For AP role this API can only be used if AP role is up.
at+netcfggetdhcpserver
This command retrieves the DHCP server settings.
Usage:
at+netcfggetdhcpserver
Description:
Get DHCP server settings.
Response:
+netcfggetdhcpserver:[LeaseTime],[StartAddress],[EndAddress]
OK
LeaseTime - Lease time in seconds
StartAddress - Starting IP address of DHCP pool
EndAddress - Ending IP address of DHCP pool
at+ping
This command sends ICMP ping requests to test network connectivity.
Usage:
at+ping=[TargetIp]<,[Interval]><,[Count]><,[PayloadSize]><,[SourceIp]>
Parameters:
TargetIp - Target IP address (required)
Interval - Interval between pings in milliseconds (optional)
Count - Number of ping requests, 0=continuous (optional)
PayloadSize - Ping packet payload size in bytes (optional)
SourceIp - Source IP address (optional)
Description:
Send ping requests to test connectivity.
Response:
OK
Example:
at+ping=192.168.1.1,1000,4,32
OK
at+pingstop
This command stops an ongoing continuous ping operation.
Usage:
at+pingstop=[PingId]
Parameters:
PingId - Ping operation ID to stop
Description:
Stop continuous ping operation.
Response:
OK
BLE Commands
- at+bleinit
- at+blesetmacaddress
- at+blegetmacaddress
- at+blesetdevicename
- at+blegetdevicename
- at+blesetscancfg
- at+blegetscancfg
- at+blescan
- at+bleconnect
- at+bledisconnect
- at+bleconnectedpeers
- at+blesetadvcfg
- at+blegetadvcfg
- at+bleadvstart
- at+bleadvstop
at+bleinit
This command starts or stops the BLE module.
Usage:
at+bleinit=[Mode]
Parameters:
Mode - Operation mode
0: Deinit BLE
1: Init BLE
Description:
Initialize or deinitialize BLE controller and host.
Response:
OK
at+blesetmacaddress
This command sets the BLE MAC address type.
Usage:
at+blesetmacaddress=[AddressType]
Parameters:
AddressType - BLE address type
0: Public Device Address
1: Random Device Address
Description:
Set BLE MAC address type. Every call with Random type generates a new random address.
Response:
+blesetmacaddress:[MacAddress]
OK
MacAddress - The generated BLE MAC address (returned when AddressType=1 for Random Address)
Note:
Up to 31 characters for device name.
Default device name is "TI CC3xxx".
at+blegetmacaddress
This command retrieves the BLE random MAC address.
Usage:
at+blegetmacaddress
Description:
Get BLE MAC address. Returns the current random MAC address if set.
Response:
+blegetmacaddress:[MacAddress]
OK
MacAddress - BLE MAC address (returns random address if previously set with AddressType=1)
at+blesetdevicename
This command sets the BLE device name.
Usage:
at+blesetdevicename=[DeviceName]
Parameters:
DeviceName - BLE device name
Description:
Set BLE device name.
Response:
OK
at+blegetdevicename
This command retrieves the BLE device name.
Usage:
at+blegetdevicename
Description:
Get BLE device name.
Response:
+blegetdevicename:[DeviceName]
OK
DeviceName - BLE device name (up to 32 characters, default: "TI CC3xxx")
at+blesetscancfg
This command configures BLE scan parameters.
Usage:
at+blesetscancfg=[ScanType],[OwnAddressType],[FilterPolicy],[ScanInterval],[ScanWindow]
Parameters:
ScanType - Scan mode
0: Passive Scan
1: Active Scan
OwnAddressType - Own address type
0: Public Device Address
1: Random Device Address
FilterPolicy - Advertisement filter policy
0: Accept all advertisements (except directed not addressed to this device)
1: Accept only from devices in the White List (except directed not addressed to this device)
2: Accept all advertisements (including directed not addressed to this device)
3: Accept only from devices in the White List (including directed not addressed to this device)
ScanInterval - Scan interval in units of 0.625ms
Range: [0x0004,0x4000] or 2.5ms to 10.24s
Must be >= ScanWindow
ScanWindow - Scan window in units of 0.625ms
Range: [0x0004,0x4000] or 2.5ms to 10.24s
Must be <= ScanInterval
Description:
Configure BLE scan parameters.
Response:
OK
at+blegetscancfg
This command retrieves current BLE scan configuration.
Usage:
at+blegetscancfg
Description:
Get BLE scan configuration.
Response:
+blegetscancfg:[ScanType],[OwnAddressType],[FilterPolicy],[ScanInterval],[ScanWindow]
OK
ScanType - Scan mode (0: Passive Scan, 1: Active Scan)
OwnAddressType - Own address type (0: Public Device Address, 1: Random Device Address)
FilterPolicy - Advertisement filter policy (0-3)
ScanInterval - Scan interval in units of 0.625ms (Range: 0x0004-0x4000)
ScanWindow - Scan window in units of 0.625ms (Range: 0x0004-0x4000)
at+blescan
This command starts or stops BLE scanning.
Usage:
at+blescan=[Enable]<,[Duration]>
Parameters:
Enable - Enable or disable scan
0: Disable
1: Enable
Duration - Scan duration in seconds (optional, required if Enable==1)
0: Continuous scanning until disabled
Description:
Start or stop BLE scanning.
Response:
OK
Note:
Scan parameters must be set first using at+blesetscancfg before using this command.
Example:
at+blescan=1,3
OK
+eventble:blescan,0,Simple Peripheral,A4:10:3E:C8:70:17,PUBLIC,-56
+eventble:blescan,1,Device Name,A4:2B:83:43:DA:90,PUBLIC,-70
+eventble:blescandone
at+bleconnect
This command connects to a BLE peer device.
Usage:
at+bleconnect=[PeerAddress],[PeerAddressType]<,[Timeout]>
Parameters:
PeerAddress - Bluetooth device MAC address
PeerAddressType - Peer address type
0: Public Device Address
1: Random Device Address
Timeout - Connection timeout (optional)
Description:
Connect to BLE peer device.
Response:
OK
Example:
at+bleconnect=A4:38:25:11:53:18,0
OK
+eventble:bleconnect,[ConnectionHandle],[PeerAddress],[PeerAddressType]
at+bledisconnect
This command disconnects from a BLE peer device.
Usage:
at+bledisconnect
Description:
Disconnect from BLE peer device.
Response:
OK
at+bleconnectedpeers
This command displays all connected BLE peer devices.
Usage:
at+bleconnectedpeers
Description:
Display list of connected BLE peers.
Response:
+bleconnectedpeers:[PeerAddress1];[PeerAddress2];...
OK
PeerAddress1, PeerAddress2, ... - MAC addresses of connected BLE peers (semicolon-separated)
at+blesetadvcfg
This command configures BLE advertising parameters.
Usage:
at+blesetadvcfg=[MinInterval],[MaxInterval],[AdvType],[OwnAddressType],[ChannelMap]<,[FilterPolicy]><,[PeerAddressType],[PeerAddress]><,[PrimaryPhy],[SecondaryPhy]>
Parameters:
MinInterval - Minimum advertising interval in 0.625ms units
Range: [0x0020,0x4000] or [20,10240] milliseconds
If 0, stack uses default
MaxInterval - Maximum advertising interval in 0.625ms units
Range: [0x0020,0x4000] or [20,10240] milliseconds
If 0, stack uses default
AdvType - Advertising type
0: BLE_ADV_TYPE_IND
1: BLE_ADV_TYPE_DIRECT_IND_HIGH
2: BLE_ADV_TYPE_SCAN_IND
3: BLE_ADV_TYPE_NONCONN_IND
4: BLE_ADV_TYPE_DIRECT_IND_LOW
5: BLE_ADV_TYPE_EXT_NOSCANNABLE_IND
6: BLE_ADV_TYPE_EXT_CONNECTABLE_IND
7: BLE_ADV_TYPE_EXT_SCANNABLE_IND
OwnAddressType - Own address type
0: Public Device Address
1: Random Device Address
ChannelMap - Advertising channel map (if 0, stack uses default)
1: Channel 37
2: Channel 38
3: Channel 39
7: All channels
FilterPolicy - Advertising filter policy (optional)
0: NONE - no filtering, no whitelist (default)
1: SCAN - process all connection requests but only scans from white list
2: CONN - process all scan requests but only connection requests from white list
3: BOTH - ignore all scan and connection requests unless in white list
PeerAddressType - Peer address type for directed advertising (optional, valid only if directed)
0: Public Device Address
1: Random Device Address
PeerAddress - Peer address for directed advertising (optional, valid only if directed)
PrimaryPhy - Primary advertising PHY (optional)
1: 1M Phy
3: Coded Phy
SecondaryPhy - Secondary advertising PHY (optional)
1: 1M Phy
2: 2M Phy
3: Coded Phy
Description:
Configure BLE advertising parameters.
Response:
OK
Note:
BLE_ADV_TYPE_DIRECT_IND_HIGH is limited to a duration of 1280 milliseconds.
at+blegetadvcfg
This command retrieves current BLE advertising configuration.
Usage:
at+blegetadvcfg
Description:
Get BLE advertising configuration. Returns all parameters as set by at+blesetadvcfg.
Response:
+blegetadvcfg:[MinInterval],[MaxInterval],[AdvType],[OwnAddressType],[ChannelMap],[FilterPolicy],[PeerAddressType],[PeerAddress],[PrimaryPhy],[SecondaryPhy]
OK
MinInterval - Minimum advertising interval in 0.625ms units
MaxInterval - Maximum advertising interval in 0.625ms units
AdvType - Advertising type (0-7)
OwnAddressType - Own address type (0: Public, 1: Random)
ChannelMap - Advertising channel map (1: Ch37, 2: Ch38, 4: Ch39, 7: All)
FilterPolicy - Advertising filter policy (0-3, optional)
PeerAddressType - Peer address type (0: Public, 1: Random, optional)
PeerAddress - Peer address for directed advertising (optional)
PrimaryPhy - Primary advertising PHY (1: 1M, 3: Coded, optional)
SecondaryPhy - Secondary advertising PHY (1: 1M, 2: 2M, 3: Coded, optional)
at+bleadvstart
This command starts BLE advertising.
Usage:
at+bleadvstart
Description:
Start BLE advertising with previously configured parameters.
Response:
OK
Note:
Advertising configuration must be set first using at+blesetadvcfg.
at+bleadvstop
This command stops BLE advertising.
Usage:
at+bleadvstop
Description:
Stop BLE advertising.
Response:
OK
Events
Asynchronous events can be triggered at any time and are displayed on the UART terminal. Events follow the format: +Event<Type>:<EventID>,<Value1>,...,<ValueX>
WLAN Events
WLAN events are triggered during WiFi operations and indicate connection status, scan results, and AP client management.
+EventWlan:CONNECT
Triggered when STA successfully connects to an AP or when connection fails.
Format: +EventWlan:CONNECT,<SSID>,<BSSID>
Values:
SSID - AP's SSID
BSSID - AP's MAC address
"-1" - Indicates connection failure
+EventWlan:DISCONNECT
Triggered when STA disconnects from an AP.
Format: +EventWlan:DISCONNECT,<SSID>,<BSSID>,<ReasonCode>
Values:
SSID - AP's SSID
BSSID - AP's MAC address
ReasonCode - Disconnection reason code
+EventWlan:SCAN_RESULTS
Triggered after scan command completion. Multiple events are sent, one per discovered network, separated by semicolons.
Format: +EventWlan:SCAN_RESULTS,<SSID>,<BSSID>,<RSSI>,<Channel>,<SecurityType>,<Key>,<Hidden>
Values:
SSID - Network SSID
BSSID - AP MAC address
RSSI - Signal strength in dBm
Channel - WiFi channel number
SecurityType - OPEN, WPA, WPA2, WPA_WPA2, WPA3
PMF - Required, Capable, Disabled
Hidden - 0: Not hidden, 1: Hidden SSID
+EventWlan:STA_ADDED
Triggered when a station connects to the operating AP (AP mode).
Format: +EventWlan:STA_ADDED,<MACAddress>
Values:
MACAddress - Connected station's MAC address
+EventWlan:STA_REMOVED
Triggered when a station disconnects from the operating AP (AP mode).
Format: +EventWlan:STA_REMOVED,<MACAddress>
Values:
MACAddress - Disconnected station's MAC address
Network Events
Network events indicate IP configuration changes and network layer status.
+EventNetwork:IPv4_ACQUIRED
Triggered when a network interface acquires an IPv4 address (STA mode).
Format: +EventNetwork:IPv4_ACQUIRED,<IPAddress>,<Netmask>,<Gateway>
Values:
IPAddress - Assigned IP address
Netmask - Subnet mask
Gateway - Gateway address
BLE Events
BLE events are triggered during Bluetooth Low Energy operations including scanning, connections, and advertising.
+EventBle:BLESCAN
Triggered during BLE scanning when a device is discovered.
Format: +EventBle:BLESCAN,<MACAddress>,<RSSI>,<OwnAddressType>,<DeviceName>
Values:
MACAddress - Discovered device MAC address
RSSI - Signal strength in dBm
OwnAddressType - PUBLIC or RANDOM
DeviceName - Device name ("Unnamed" if not available)
+EventBle:BLESCANDONE
Triggered when BLE scan completes or is stopped.
Format: +EventBle:BLESCANDONE
No additional values.
+EventBle:BLECONNECT
Triggered when BLE connection is established.
Format: +EventBle:BLECONNECT,<ConnectionHandle>,<MACAddress>,<PeerAddressType>
Values:
ConnectionHandle - Connection handle ID
MACAddress - Peer device MAC address
PeerAddressType - PUBLIC or RANDOM
+EventBle:BLEDISCONNECT
Triggered when BLE connection is terminated.
Format: +EventBle:BLEDISCONNECT,<ConnectionHandle>,<MACAddress>,<AddressType>
Values:
ConnectionHandle - Connection handle ID
MACAddress - Peer device MAC address
AddressType - PUBLIC or RANDOM
+EventBle:BLEADVCOMPLETE
Triggered when BLE advertising operation completes.
Format: +EventBle:BLEADVCOMPLETE,<TerminationCode>
Values:
TerminationCode - Reason for advertising termination