4. Binary Mode
CodeLess on the DA1453x offers two distinct modes of operation. Previous chapters pertain to the standalone CodeLess which is the Command mode. This section gives an overview of the Binary mode. Binary mode is used for data pumps wherein the Bluetooth CodeLess device transfers data without examining its contents, which is the preferred method for end-to-end raw data transfer.
The DA1453x can be switched from Command mode to Binary mode and back to Command mode or any other combination. The flow of commands to achieve this is mentioned below in the form of an example.
4.1. Example of Switching between Command Mode and Binary Mode
Description - Enter the Binary mode from the Command mode and back to Command mode between DA1453x and remote DA1453x.
Software setup - codeless_531_00_datapump.hex
is used to demonstrate Binary mode functionality.
Hardware setup - As shown in Figure 10. To proceed with this example, connect two DA145xx Pro-DK to the PC and follow the commands as mentioned below.
Note
For all the AT commands you need to append CR, for escape sequence and binary mode you need to append nothing.
AT command sequence:
The DA1453x and remote DA1453x need to be connected.
The set of commands to achieve this is mentioned in section Section 3.4.1
Open two terminals for the communication. Since we are still in Command mode, keep the “append CR” enabled. For the ease of understanding, the DA1453x and remote DA1453x are represented by 531 and 531_R.
531 - implies the commands being sent from DA1453x terminal
531_R - implies the commands being sent from remote DA1453x terminal
Command mode to Binary mode:
After the 531 and 531_R are connected, execute the following:
531: AT+BINREQ (The 531 requests the 531_R to enter the Binary mode)
531_R: AT+BINREQACK (531_R must send an acknowledgment back to 531 to enter the Binary mode)
Now both the devices have entered the Binary mode
Test by sending random data from 531 and 531_R receives the same message and vice-versa
Binary mode to Command mode:
531: +++ (This is the escape sequence and when sending this sequence in the terminal, you must NOT append a CR)
531: AT+BINREQEXIT (Append CR since its an AT command)
531_R: AT (Or any AT command, just to verify entering the Command mode)
531_R: AT+BINREQEXITACK (Acknowledgment can be sent to 531 on entering the Command mode)
4.2. Binary Mode - Entering and Exiting Flow
Figure 38 gives an overview of the sequence of AT commands of entering and exiting the Binary mode.
Note
The sequence of GATT commands between the mobile application and the Codeless peripheral when entering and exiting binary mode is described in Section 8.6

Figure 38 Entering and Exiting Binary Mode
The signal flows for various cases, entering, exiting, suspending, and resuming the Binary mode is shown above.
The 531 device may switch to Binary mode by using the command AT+BINREQ. The 531_R device should acknowledge this by AT+BINREQACK. When this command is detected by the command path the internal data path of the CodeLess devices is switched from CodeLess parser to Binary mode buffers, which is compatible with SPS (Renesas Serial Port Service).
When any of the participating devices need to exit Binary mode, there are two cases:
With a smart device, you can just write AT+BINREQEXIT to the remote CodeLess device receiving characteristic. Then the escape sequence will be issued to the remote CodeLess host to signal the exit from the Binary mode. The remote CodeLess host should acknowledge exiting the Binary mode by issuing an AT+BINREQEXITACK signaling the actual switch to the Command mode.
With another CodeLess device, any of the host devices may issue the escape sequence followed by AT+BINREQEXIT and then wait for an AT+BINREQEXITACK.
Note
The escape sequence issued by a host device suspends only locally the binary operation, which means that the host may issue AT commands and then resume Binary mode by issuing AT+BINRESUME. The actual switch to the Codeless mode for all devices is accomplished when AT+BINREQEXIT is issued and the remote host acknowledges the exit sequence by an “AT” command. The AT+BINREQEXITACK is a passthrough command without any effect in the internal states of the device and it is provided as a convenient way to mark the exit of the remote host from Binary mode.
If a host needs to exit Binary mode, then it should issue the escape sequence. The escape sequence is comprised of a guard time, followed by three escape characters and another guard time. That is escape time1 > escape characters > escape time2. You may use zero values for escape times if you plan to use a custom protocol that reserves the escape characters for binary mode exit conditions. In Binary mode, the default packet size is set to MTU size-3 and MTU size is set to RX/TX packet length-4. Arbitrary selection of MTU (AT+MAXMTU) or RX/TX packet length (AT+DLEEN) may cause loss of data in Binary mode.
Demonstration of CodeLess Binary Mode