9. AT Commands

This section provides the list of Hardware and Software AT commands.

This section contains all AT commands along with their syntax, comments, returns, and examples. In case an error occurs during runtime, an error reporting mechanism exists. A user can view all possible error index that might be reported and the reason in Table 8.

9.1. AT

Basic AT command.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT

Return:

OK

9.2. ATI

Device information query. Returns firmware version, hardware type, and unique organization identifier

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

ATI

Return:

CodeLess DA14531 v_6.380.x.x

OK

Example:

ATI


CodeLess DA14531 v_6.380.9.10
OK

9.3. ATE

Turns UART echo on/off.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

ATE=<0:off / 1:on>

Return:

OK

9.4. ATZ

Sets IO configuration back to default.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

ATZ

Return:

OK

9.5. ATF

Turns error reporting on/off.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

ATF=<0:off / 1:on>

Return:

OK

9.6. ATR

Triggers a platform reset.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

ATR

Return:

READY

9.7. AT+TMRSTART

There are four timers that when expire after delay X10msec time will trigger command sequence stored in specified command slot. Refer to AT+CMDSTORE command.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+TMRSTART=<timer index 0-3>,<command slot index 0-3>,delay.

Return:

OK

Example:

AT+TMRSTART=0,0,100  [timer 0 will expire after 1 sec and will trigger command sequence stored
in command slot 0]
OK

9.8. AT+TMRSTOP

Stops specified timer if not already expired.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+TMRSTOP=<timer index 0-3>

Return:

OK

Example:

AT+TMRSTOP=0
OK

9.9. AT+CURSOR

Places a time cursor in a SmartSnippetspower profiler plot.

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+CURSOR

Return:

OK

9.10. AT+RANDOM

Returns a random 32bit number (hexadecimal).

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+RANDOM

Return:

0xXXXXXXXX OK

Example:

AT+RANDOM


0x00234112
OK

9.11. AT+BATT

Returns the battery capacity in the percentage of full capacity. Assumes CR2032.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+BATT

Return:

XXX OK

Example:

AT+BATT


100
OK

9.12. AT+BDADDR

Queries the Bluetooth device address.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+BDADDR

Return:

XX:XX:XX:XX:XX:XX OK

Example:

AT+BDADDR


CA:D2:BE:0E:9F:E0
OK

9.13. AT+SLEEP

Uses the designated mode to instruct the controller to enter sleep mode. If the command is issued without any parameters, the current applied value is returned. This command has an effect only for command mode.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+SLEEP= [<slp_mode>]

Return:

OK

[<slp_mode>] - 0 = Disable Controller sleep (Default) 1 = Controller will go to sleep and will be woken by a high to low condition on <cts_pin> as defined by the AT+FLOWCONTROL command

9.14. AT+HOSTSLP

Uses the designated mode to inform the controller of the sleep of the external host and the wake-up condition. If the command is issued without any parameters, the current applied value is returned. This command has an effect only for Command mode.

<hst_slp_mode> - 0 = Host will go to sleep and will not be able to be woken from controller. Controller will not act to wake up to host. 1 = Host will go to sleep and will be able to be woken using a method depending on the flow control method (AT+FLOWCONTROL). If the hardware flow control is disabled, the host may be woken from an UART byte reception (<wkup_byte>). The host should acknowledge by issuing an AT command. If the hardware flow control is enabled, the host may be woken from a high to low transition of controller RTS signal. The host should acknowledge by issuing an AT command.

<wkup_byte> - If <hst_slp_mode> = 1, this byte will be used to wake up the host every <wkup_retry_interval> for <wkup_retry_times>. This parameter is effective only if the hardware flow control is disabled.

<wkup_retry_interval> - The time between wake-up retry times in milliseconds. Default value is 1000.

<wkup_retry_times> - The wake-up retry times, default value is 10 times.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+HOSTSLP=[<host_slp_mode> , <wkup_byte>, <wkup_retry_interval>, <wkup_retry_times>]

Return:

OK

<hst_slp_mode>, <wkup_byte>, <wkup_retry_interval>,<wkup_retry_times>

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

Return:

9.15. AT+IOCFG

Sets the functionality of a specified IO pin. Lists all pin configurations if no arguments are provided.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+IOCFG[=<pin#>,<IO functionality>,<Optinal level to drive after configuration, default 0 for low>] Refer to Table 9 for the IO functionality inputs

Return:

OK

Example:

AT+IOCFG=10,4


OK

[Configuring P1_0 as IO Output (‘4’)]

9.16. AT+IO

Reads the specified pin status if one argument provided. Sets an Output if two arguments are provided.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+IO=<pin#>[,<0:low / 1:high>]

Return:

X, OK or OK

Example:

ATr+IO=10,1  [Switch ON remote LED – D3]


OK


AT+IO=10,1   [Switch ON local LED – D3]


OK

9.17. AT+ADC

Reads an analog input pin. Result provided as decimal (10bit ADC). Only pins P0_0 to P0_3 can be analog inputs.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+ADC=<pin#>

Return:

XXXX OK

Example:

AT+ADC=2 (on P0_2)


1019
OK

9.18. AT+I2CSCAN

Scans the I2C bus for devices. Returns the address of the detected devices and the content of register 0x00 where present.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+I2CSCAN

Return:

0xXX,0xXX OK

Example:

AT+I2CSCAN


0x18,0x00
OK

9.19. AT+I2CCFG

Configures the I2C bus for devices.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+I2CCFG=<slave_Addressing_Bitcount>,<bit_rate>,<slave_register_width>

Return:

OK

Example:

AT+I2CCFG=7,400,16


OK

9.20. AT+I2CREAD

Reads one or more specified eight bit registers from an I2C slave at a specified address.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+I2CREAD=<slave_address>,<slave_register>[,<Number_Bytes>]

Return:

0xXX,0xXX,0xXX OK

Example:

AT+I2CREAD=0x18,3 [reading 3 bytes]


0x01,0x02,0x03
OK

9.21. AT+I2CWRITE

Writes eight bit data to a register of an I2C slave at a specified address.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+I2CWRITE=<slave_address>, <slave_register>,<Data_Byte>

Return:

OK

Example:

AT+I2CWRITE=0x18,3,5


OK

9.22. AT+PRINT

Prints a specified string to the UART. As opposed to the pipe command, the PRINT command returns OK. The special pipe command (|) sends the following string to the connected peer and when the peer receives it, it prints it out to the local terminal. No reply is expected/generated by the pipe command.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+PRINT=<text_to_print>

Return:

<text_to_print> OK

Example:

AT+PRINT=Hello World!


Hello World!
OK

9.23. AT+MEM

Allows you to exchange data between devices without the need for custom commands.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+MEM=<index 0-3>,[<Text string to store>] There are 4 such blocks each of 100 characters

Return:

Lists the content of memory index entered

<text string to store> OK

Example:

AT+MEM=0,Helloworld!  [Stores Helloworld! in mem location 0]

OK


AT+MEM=0  [Retreives data stored in location 0]


Helloworld!
OK

9.24. AT+PIN

Allows you to set a passkey on your device which will force the device to prompt for a passkey (PIN code) when a central device attempts to connect. The AT+PIN command can be used to set or get the six-digit code that is needed for pairing on specific occasions (as dictated by the AT+SEC command).

When the AT+PIN command is entered without parameters the current PIN code will be returned.

The default pin is 000000 and is indicated by the AT+PIN returning 0. The command accepts only one argument which is a six-digit code.

Please note that the command neither checks nor sanitizes the argument passed to it (for example, AT+PIN=123456 would be a valid pin entry whereas AT+PIN=1234 would be invalid).

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+PIN=[<Bluetooth access key (32bit integer)>]

Return:

<Lists the current access key> OK

Example:

AT+PIN=123456 [Sets the access key]


OK


AT+PIN [Lists the current access key]


123456
OK

9.25. AT+CMDSTORE

Stores one or multiple commands (semicolon separated).

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+CMDSTORE=<index:0-3>,<semicolon separated command strings>

Return:

OK

Example:

AT+CMDSTORE=0, AT+IOCFG=10,4;AT+IO=10,1


OK

9.26. AT+CMDPLAY

Executes the semicolon separated command strings in the corresposing index stored using CMDSTORE command.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+CMDPLAY=<index:0-3>

Return:

OK

Example:

AT+CMDPLAY=0


OK [Response to the AT+IOCFG=10,4 which is the first command stored using CMDSTORE in index 0]
OK [Response to the AT+IO=10,1 which is the second command stored using CMDSTORE in index 0]

9.27. AT+CMD

Displays the semicolon separated command strings in the corresposing index stored using CMDSTORE command.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+CMDPLAY=<index:0-3>

Return:

OK

Example:

AT+CMD=0


… [Whatever has been stored using CMDSTORE in index 0]
OK

9.28. AT+ADVSTOP

Stops advertising. Returns ERROR if not already advertising

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+ADVSTOP

Return:

OK

Example:

AT+ADVSTOP


OK

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

Return:

9.29. AT+ADVSTART

Starts advertising. Advertising interval can optionally be specified in milliseconds (100 to 3000ms). Returns Error if advertising is already active or if the device is in the central role.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+ADVSTART[=<adv_interval_ms>]

Return:

OK

Example:

AT+ADVSTART=100


OK

9.30. AT+ADVDATA

Sets or queries the advertising data. Data must be provided as hex string. The content will take effect only after advertising is restarted.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+ADVDATA[=<advertise data>]

Return:

OK

Example:

AT+ADVDATA=04:09:43:41:54
[Length =0x04, type =0x09, data = ‘CAT’ (C=0x43, A=0x41, T=0x54), the length includes type and data]


OK

9.31. AT+ADVRESP

Sets or queries scan response data. Changes to take effect after the restart of advertising.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+ADVRESP[=<advertise data>]

Return:

OK

Example:

AT+ADVRESP

9.32. AT+CENTRAL

Sets the device Bluetooth role to the central role. Advertising must be stopped and any connection must be terminated before the role change is accepted.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+CENTRAL

Return:

OK

Example:

AT+CENTRAL


OK

9.33. AT+PERIPHERAL

Sets the device Bluetooth role to peripheral. Any connection must be terminated before the role change is accepted.

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+PERIPHERAL

Return:

OK

Example:

AT+PERIPHERAL


OK

9.34. AT+BROADCASTER

Sets the device Bluetooth role to broadcaster. Any connection must be terminated before the role change is accepted.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+BROADCASTER

Return:

OK

Example:

AT+BROADCASTER


OK

9.35. AT+GAPSTATUS

Reports the Bluetooth role and connection status as X,Y where X is 0 for peripheral role and one for central role and Y is 0 for non-connected and 1 for connected.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+GAPSTATUS

Return:

1,1 OK

Example:

AT+GAPSTATUS


1,1
OK

9.36. AT+GAPSCAN

Starts a Bluetooth device scan. Only accepted when device is in central role and not connected. A scan will continue for eight seconds or until any character is received via UART.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+GAPSCAN

Return:

Scanning… <list of devices> Scan completed OK

Example:

AT+GAPSCAN


Scanning…
( ) FD:37:13:D0:6D:02,R, Type: ADV, RSSI:-81
( ) FD:37:13:D0:6D:02,R, Type: RSP, RSSI:-80
( ) 69:35:59:5C:88:DA,R, Type: ADV, RSSI:-87
( ) 80:EA:CA:80:00:07,P, Type: ADV, RSSI:-52
( ) 80:EA:CA:80:00:07,P, Type: RSP, RSSI:-52
( ) 69:35:59:5C:88:DA,R, Type: RSP, RSSI:-81
( ) F0:1B:2A:F3:C6:0E,R, Type: ADV, RSSI:-67
( ) F1:5C:6F:77:62:AF,R, Type: ADV, RSSI:-64
( ) F1:5C:6F:77:62:AF,R, Type: RSP, RSSI:-64
( ) F0:1B:2A:F3:C6:0E,R, Type: RSP, RSSI:-67
Scan Completed…
OK

9.37. AT+GAPCONNECT

Initiates a connection with a specific slave device. The local device must be in the central role. The connection attempt will continue until a connection has been established or until a character is received via the UART.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+GAPCONNECT=<slave_address>,<P:public/ R:random>

Return:

Connecting… Connected

OK

Example:

AT+GAPCONNECT=FD:37:13:D0:6D:02,R


Connecting…
Connected


OK

9.38. AT+GAPDISCONNECT

Disconnects from a peer Bluetooth device. This command can be used in both central and peripheral role.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+GAPDISCONNECT

Return:

Disconnected OK

Example:

AT+GAPDISCONNECT


Disconnected
OK

9.39. AT+BINREQ

This command is used in conjunction to AT+BINACK to enter Binary mode. It’s a passthrough command to the peer host to request a switch to Binary mode. This command takes no parameters and has no effect on the internal state of the device

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BINREQ

Return:

OK

9.40. AT+BINREQACK

This command should be used as a reply to AT+BINREQ to enter Binary mode. When the CodeLess parsers detect this command switches the flow to Binary mode operation through the DSPS path. This command takes no parameters

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BINREQACK

Return:

OK

9.41. AT+BINREQEXIT

Upon issuing the escape sequence the host device is switching the CodeLess device into a local command mode. Then using the AT+BINEXIT command it may request the peer host to exit Binary mode. This command when issued by the host is causing an escape sequence to the peer host. The peer host should reply with AT+BINEXITACK. This command takes no parameters

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BINREQEXIT

Return:

OK

9.42. AT+BINREQEXITACK

When a host device is in Binary mode upon reception of an escape sequence it should exit Binary mode and reply with an AT+BINEXITACK. This command is transferred passthrough to the peer host to indicate the switch to full end to end command operation

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BINREQEXITACK

Return:

OK

9.43. AT+BINRESUME

When the host has switched the CodeLess device to command mode using the escape sequence, it may switch back to Binary mode using this command

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BINRESUME

Return:

OK

9.44. AT+BINESC

This command is used to specify escape condition to exit binary sequence. If the command is issued without any parameters, the current applied values are returned

[<esctime1>] - A 16-bit unsigned value that define the escape time in milliseconds that should apply without reception prior to the reception of escape characters. The default value is 1000 msec.

[<escchar>] - A 32-bit integer that should specify three bytes of the escape characters. The most significant byte is ignored. The default escape sequence is 0x002B2B2B that is equal to the escape sequence ‘+++’.

[<esctime2>] - A 16-bit unsigned value that define the escape time in milliseconds that should apply without reception after the reception of escape characters. The default value is 1000 msec

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BINESC=[<esctime1>,<escchar>., <esctime2>]

Return:

OK

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

Return:

9.45. AT+CONPAR

This command adjusts the connection parameters and the actions that should be taken. If the command is issued without any parameters, the current applied values are returned.

<ci> - The desired connection interval in multiples of 1.25 msec. The actual connection interval is 1.25 msec x <ci>. Default value is 15 msec. The allowed value is 6-3200 (7.5 msec to 4.0 sec)

<sl> - The desired slave latency in connection events. Default value is 0 connection events. This value should be less than 500 and less than ((<sto> / (2.5 x <ci>)) - 1).

<sto> - The desired supervision timeout in milliseconds. Default value is 1250 msec. This value should be a multiple of 10 msec and in the range of 100 msec to 32.0 sec

<pu_action> - The desired action:

0 = Disable Parameter Update on every connection

1 = Apply a parameter update on every future connections (default)

2 = Apply a parameter update now with the provided parameters. Stored parameters will not be updated.

3 = Apply a parameter update now and on every connection. Stored parameters will be updated with the new values.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+CONPAR= [<ci>, <sl>, <sto>, <pu_action>]

Return:

OK

<ci>, <sl>, <sto>, <pu_action>

Example:

AT+CONPAR=100,0,1250,1

OK


Apply these parameters before connection and once connected to a device, the connection parameters will be reflected

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

Return:

9.46. AT+DLEEN

Enables or disables the DLE feature with the corresponding data lengths for transmission and reception. If the command is issued without any parameters, the current applied values are returned.

< dle_enbl > - 0 = DLE disabled 1 = DLE enabled (default) For DA14531 this value has effects on feature flags of LL_FEATURE_REQ/RSP. For DA14585 non DLE is emulated by reducing Rx/Tx size to 27 octets.

<tx_pkt_len> - 27-251 octets, even number of octets are not supported. A selected even number will be automatically converted to the next odd one. The supported rx/tx time value is automatically calculated. Default value is 251. These values do not have any effect if <dle_enbl>=0.

<rx_pkt_len> - same as tx_pkt_len

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+ DLEEN=[<dle_enbl>,<tx_pkt_len>,<rx_pkt_len>]

Return:

OK

<dle_enbl>,<tx_pkt_len>,<rx_pkt_len>

9.47. AT+MAXMTU

Sets the maximum MTU in octets that may be accepted and will be negotiated on every connection. If the command is issued without any parameters, the current applied value is returned. This command reconfigures the device and should be issued while there is no GAP activity. <mtu_val> should be in the range 23 to 512.

<mtu_val> - 23-512, Default value is 247.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+MAXMTU=[<mtu_val>]

Return:

OK

< mtu_val>

9.48. AT+FLOWCONTROL

Uses the designated mode to instruct the controller to use HW flow control for the UART communication. This is applicable for Command mode and Binary mode. If the command is issued without any parameters, the current applied value is returned.

<fc_mode>] - 0 = Disable RTS/CTS Flow Control 1 = Enable RTS/CTS Flow Control

<rts_pin> - The controller pin output for the RTS signal.

<cts_pin> - The controller pin input for the CTS signal.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+FLOWCONTROL=[<fc_mode>, [<rts_pin>, <cts_pin>]]

Return:

OK

<fc_mode>,<rts_pin>, <cts_pin>

9.49. AT+SPICFG

Configures the SPI interface parameters. The actual pins that will be used for SPI communication must be preconfigured using the AT+IOCFG command. If no parameters are provided the command returns the current spi configuration.

<speed> - This parameter determines the SPI Clock value. Valid parameters are the following:

0 = 2 MHz SPI Clock

1 = 4 MHz SPI Clock

2 = 8 MHz SPI Clock

<mode> - This parameter determines the clock polarity and clock phase. All four modes of operation are supported:

0 = Data are sampled on the rising edge and shifted out on the falling edge. The clock is low in idle state.

1 = Data are sampled on the falling edge and shifted out on the rising edge. The clock is low in idle state.

2 = Data are sampled on the falling edge and shifted out on the rising edge. The clock is high in idle state.

3 = Data are sampled on the rising edge and shifted out on the falling edge. The clock is high in idle state.

<size> - This parameter determines the SPI word size. In the current release the CodeLess software supports only 8-bit transfer size therefore this parameter must always be eight.

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+SPICFG= [<speed>, <mode>, <size>]

Return:

OK,

<speed>, <mode>, <size>

9.50. AT+SPIWR

Writes a hexadecimal string to the slave device attached to the SPI interface. Discard the response.

<hex_string> - The hexadecimal string to send. The string may be prefixed with 0x or 0X and must not exceed 64 characters (32 bytes) in size. At least two characters (1 byte) must be provided.

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+SPIWR= <hex_string>

Return:

OK

Example:

AT+SPIWR=0x3216AABBE3

9.51. AT+SPIRD

Reads a specified number of bytes from the SPI slave device

<bytes> - Number of bytes to read. The number of bytes specified cannot be larger than 64.

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+SPIRD= <bytes>

Return:

OK

9.52. AT+SPITR

Transfers a specified hexadecimal string to the slave device while reading the response. Keep the CS signal low throughout the operation.

<hex_string> - The hexadecimal string to send. It may be prefixed with 0x or 0X and cannot be more than 64 characters or less than two characters (1 byte) in length.

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+SPITR= <hex_string>

Return:

OK

9.53. AT+BAUD

Sets the serial Baud rate between the host and the device running the CodeLess software. If no parameters are provided, then the command prints the current setting.

<baud_rate> - The desired Baud rate. Supported values are the following:

2400, 4800, 9600, 19200, 38400, 57600, 115200, and 230400

In the rare occasion that the Baud rate related registers are in an inconsistent state the string ‘Error determining baud rate’ will be printed to the console.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+BAUD= [<baud_rate>]

Return:

OK

Example:

AT+BAUD=115200

OK


To verify the changed baud rate, type in AT in terminal and you wil find it is not readable. This is becuase the BAUD rate is now 115200 and not 57600


In settings, change the port settings, baud -> 115200. Now type in AT and you can read AT in terminal and the response as OK

9.54. AT+PWRLVL

Configureі the Bluetooth output power level. This command is only supported by DA14531.

<power_level> - The output power level parameter. Valid inputs are numbers from 1 till 12 as follows: 1 = -19.5 dBm 2 = -13.5 dBm 3 = -10 dBm 4 = -7 dBm 5 = -5 dBm 6 = -3.5 dBm 7 = -2 dBm 8 = -1 dBm 9 = 0 dBm 10 = 1 dBm 11 = 1.5 dBm 12 = 2.5 dBm

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+PWRLVL= <power_level>

Return:

OK

<power_level>

Example:

AT+PWRLVL

<power_level>


Returns the existing power level. The default is 9 that is 0 dBm

9.55. AT+PWM

Generates a PWM pulse with a specified duration and duty cycle to a selected pin for a specified amount of time. The pin must be preconfigured using the AT+IOCFG command with parameter 24 for IO functionality.

<frequency> - The desired frequency in Hz. Valid inputs are between 1000 and 500000.

<duty_cycle> - The duty cycle of the pulse. Valid inputs are between 0 and 100 inclusive.

<duration> - The total duration of the PWM output in ms. Valid inputs are between 100 and 10000. The PWM output will be generated for the specified amount of time.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+PWM= [<frequency>, <duty_cycle>, <duration>]

Return:

OK | <frequency>, <duty_cycle>, <duration>]

9.56. AT+EVENT

Activates or deactivates one of the predefined events. A predefined string will be printed to the console when the event takes place.

<event> - The desired event specified as a number. Valid inputs are the following: 1 = selection of the initialization event 2 = selection of the connection event 3 = selection of the disconnection event 4 = selection of the wakeup event

<status> - 0 = Deactivates the selected event, 1 = Activates the selected event

None - If no parameters are specified, the command prints the events table in the following format: 1, X 2, X 3, X 4, X where the numbers from 1 to 4 define the selected event and X = {0,1} depends on the status {not activated, activated} of each event.

Unsolicited replies for types of events:

Initialization - +READY<CR><LF> Connected - +CONNECTED<CR><LF> Disconnection - +DISCONNECTED<CR><LF> Wake-up - +AWAKE<CR><LF>

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+EVENT= [<event>, <status>]

Return:

OK

<event>, <status>

9.57. AT+CLRBNDE

Clears a bonding database entry or clear the whole bonding database.

<index> - The index of the bonding database entry to clear. Valid inputs are 1,2,3,4 and 5. A parameter of 0xFF will erase the whole database.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+CLRBNDE=<index>

Return:

OK

9.58. AT+CHGBNDP

Changes the persistence status of the bonding entry specified by index.

<index> - Specifies the index of the entry whose persistence status will change. Valid inputs are 1,2,3,4 and 5. In case the index is 0xFF, all entries will be changed simultaneously.

<status> - 0 = make the entry non-persistent, 1 = make the entry persistent

Availability:

  • DA14585/586: No

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+CHGBNDP= [<index>, <status>]

Return:

OK

<index>, <status>

9.59. AT+IEBNDE

Imports or exports (print to serial port) a bonding database entry. The first argument is mandatory whereas the second argument is optional (denoted by [ ]) and is only used in the case of importing an entry to the database.

<index> - Specifies the index of the entry that will be exported (printed to the serial port).Valid inputs are 1,2,3,4 and 5 for both DA14585/586 and DA14531. The index plays no role in case of importing an entry, but it must be provided.

[<entry>] - This is an optional argument. If it exists, it specifies the hexadecimal string that will be imported in the database. The database index will be the one found within the database string.

Format of the exported entry

Character Position Data

1 - 32 Long Term Key (LTK) 33 - 36 Encrypted Diversifier (EDIV) 37 - 52 Random number (RAND) 53 - 54 Key size 55 ; (comma delimiter) 56 -87 Peer Connection Signature Resolving Key (CSRK) 88 - 99 Peer Bluetooth Address 100 - 101 Address type 102 - 103 Authentication level 104 - 105 Bonding database slot 106 ; (comma delimiter) 107 - 138 Identity resolving key (IRK) 139 ; (comma delimiter) 140 -141 Persistence status 142 ; (comma delimiter) 143 - 150 Timestamp

Additional notes: Please note that this command is a very powerful one especially while importing data. The user must be very careful to ensure the validity of the data imported. Although certain validity checks are performed (string length, position of delimiters, hexadecimal characters) no check is done about the validity of the data itself. An invalid string may cause connection errors, bonding errors, erratic behavior of the software or even cause the software to enter an undefined state.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+IEBNDE= <index>, [<entry>]

Return:

OK

9.60. AT+HNDL

Executes a set of previously defined AT Commands on specific events as if the user has entered them in the command line. If no arguments are specified, the existing parameters are returned.

<event> - The event parameter can be one of the following: 1 = connection event 2 = disconnection event 3 = wake-up event

<at_commands> - The at_commands string can contain one or more AT commands that are supported by the CodeLess command set. If more than one commands are specified, they must be delimited by a semicolon. The last command does not need a semicolon. An example is shown below:

for example, AT+HNDL=1, AT; ATI

In this example as soon as there is a connection event, the AT and ATI commands will be executed locally. If the at_commands string argument is provided it must be less than 50 characters in length. If the <at_commands> argument is not provided, then the event specified by <event> will be deactivated and the at commands string will be erased. The command will automatically store any change to the non-volatile flash memory if there is one and external storage has been configured. Please note that the semicolon character (;) is used as delimiter and therefore the commands used should not contain extra semicolons, for example, an argument passed in the AT+PRINT command. In addition, no error checking is performed on the <at_commands> argument. The user must ensure that the <at_commands> is valid.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): No

Usage:

AT+HNDL= [<event>, <at_commands>]

Return:

OK

<event>, <at_commands>

Example:

AT+HNDL=1, AT; ATI


OK

9.61. AT+RSSI

Retrieves the received signal strength indication and prints it in the console in dBm. This value is updated internally every two seconds. The device must be in connected state otherwise the command will return an error.

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+RSSI

Return:

OK

9.62. AT+SEC

The command sets the current security/pairing mode out of four different modes:

LE secure connections pairing Legacy pairing with MITM protection Unauthenticated No MIMT protection (Just works) No security

The device must not be connected for the security mode to be changed or an error will occur. If no argument is specified, the command returns the current configuration.

<mode> - The mode parameter can be one of the following:

0 = LE secure connections pairing: In this case cryptography will be used along with the Diffie - Hellman public key exchange mechanism. The passkey entry pairing method will be used for MITM protection. The LTK will be stored along with other parameters in the bonding database if the bonding database is available. The device will print the six-digit pin (by default 000000) which can also be set in advance using the AT+PIN command.

1 = Legacy pairing with MITM protection: The user will have to enter a passkey which is currently set to six zero characters (000000). It can be changed using the AT+PIN command.

2 = Unauthenticated no MITM protection: In this case the Just Works pairing method will be used to pair the two devices. The communication will be encrypted.

3 = No security: In this method there is no support for authentication or encryption

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: Yes

  • DA14531 Standalone (SET-ONE): Yes

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+SEC=[<mode>]

Return:

OK

9.63. AT+HRTBT

The command outputs a heartbeat signal to one of the device pins to indicate that the device is indeed working and executing code. The pin will be toggled every second. Before using the command, the proper device pin must be configured using the command AT+IOCFG with the parameter 27.

<en> - The <en> parameter can be one of the following: 0 = disable the heartbeat signal 1 = enable the heartbeat signal

Availability:

  • DA14585/586: Yes

  • DA14531 Datapump: No

  • DA14531 Standalone (SET-ONE): No

  • DA14531 Standalone (SET-TWO): Yes

Usage:

AT+HRTBT=[<en>]

Return:

OK