7. CodeLess Host Application

The CodeLess Host application comes with the SDK and it is located here: ...projects/host_apps/Host_application/application. An overview of codeless host application can be found in Section 11.

The CodeLess Host application is a terminal app enabling the user to view, control, and communicate with the serial port of a CodeLess device. The user can easily connect and disconnect from any available CodeLess device and finally exit the CodeLess Host application. Next, the user selects the desired serial port and completes setup by pressing OK from the initial menu, as shown below. After successful connection to the serial port of the CodeLess device, the window title of CodeLess Host is updated containing the COM port that is currently connected. While the UART COM port is connected with the Codeless Host application, the user can change any parameter - port, speed, data, parity, stop bits or flow control - from the Connect menu without pressing disconnect. Although, the disconnect option is available in the Setup menu if the user wants to disconnect the Codeless device from the Codeless Host application.

After a successful UART connection between Codeless device and CodeLess Host application, ATE and AT+BINESC commands are executed. The ATE command is required to inform the user about the structure of each command reply (if the executed command is included in the command reply or not). The AT+BINESC command is required to inform the user about the current escape sequence that is set to the Codeless device and is used in case of exiting the Binary mode state. The current escape sequence, including the corresponding timeout values, is displayed in the Binary Mode section.

The CodeLess Host application gives the ability to the user to either copy any line or word that is selected from the monitor or select all the contents of the monitor or even clear the monitor by just right-clicking inside the monitor.

_images/codelesshost.png

Figure 42 Connect, Disconnect, and Exit CodeLess Host

_images/hostport.png

Figure 43 Serial Port Setup

7.1. Command Mode of CodeLess Host

The user can relay commands to the peer Codeless device either manually or automatically. Any AT command can be sent manually using the Command entry in the Send Text section, either by clicking the Send button or by pressing the Enter key. The Command entry can also be used in Binary mode for sending small ASCII or binary strings. The CodeLess Host application empowers the user to run automated tests with the ability to enable even command reply validation. The user is only required to write a very simple batch file containing a series of all the AT commands that cover the test scenario. A batch file is a simple text file containing a sequence of AT commands, optionally followed by the expected output. The creation of a batch file should follow the specific guidelines:

  • any line that starts with “–>” indicates the input command that will be sent to device

  • any line that starts with “<–” indicates the output (reply string) of the above command

  • any line that ends with “OK” or “ERROR” is the end of the current command sequence

  • lines that don’t start with any of the above indications are the values that need to be validated

Example:

–> AT+GAPDISCONNECT

<– AT+GAPDISCONNECT

–> AT+ADVSTOP

<– AT+ADVSTOP

–> AT+CENTRAL

<– AT+CENTRAL

–> AT+GAPSCAN

<– AT+GAPSCAN

–> AT+GAPCONNECT=E0:E8:B6:4E:78:F0,R

<– AT+GAPCONNECT=E0:E8:B6:4E:78:F0,R

+CONNECTED

OK

–> AT+GAPSTATUS

<– AT+GAPSTATUS

1,1

OK

At this point, the user needs to Browse to the file system, select the desired batch file and click the Send Batch File button. If command reply validation is enabled and the command reply fails, then the execution of the batch stops automatically.

All commands that are sent and executed to a CodeLess device, including their replies, will be printed to the console. The CodeLess Host will automatically log all this interaction to a file named <dayMonthYear_hourMinuteSecond>_console.log.

Color coding is used to print the executed commands and their replies. Input commands are printed in yellow and command replies are printed in green. When the device operates in Binary mode, any string or unsolicited message is printed in blue.

Warning

The DA14531-01 can’t be configured as a central, the AT+CENTRAL,AT+GAPSCAN and AT+GAPCONNECT commands are not supported.

_images/hostexecute.png

Figure 44 Execution Output of a Batch File

7.2. Binary Mode of CodeLess Host

In the Binary Mode section, the user can find all Binary mode related commands, including an indication of the current mode (“Binary mode” ON/OFF). CodeLess Host provides the ability to enter and exit Binary mode automatically by reducing and simplifying the steps.

If the CodeLess host receives +BINREQ from the controller, it automatically replies to the controller with the AT+BINREQACK command and enters Binary mode. The automatic acknowledgment (AT+BINREQACK) has been programmed to be done so in the CodeLess Host application.

In case the escape sequence is received, then CodeLess Host automatically executes the “AT” command followed by “AT+BINREQEXITACK” and exits Binary mode.

The user can change separately any parameter of the AT+BINESC command. The current applied values are displayed in the entry boxes. The ESCCHAR can be either in hex or in ASCII format. Finally, the user can change the escape sequence of the Codeless device by clicking the Set button.

CodeLess Host also supports the exchange of ASCII or binary files between two Bluetooth-connected devices and provides the option to save any received file for data loss validation after file reception. The binary log filename is <dayMonthYear_hourMinuteSecond>_bin.log and is saved in the application’s path.

7.3. Binary Mode Using the Generic GATT Client Host

See section 8.6. Using Renesas Smartbond Application.