SmartSnippets DA1459x SDK
BLE CLI application

Overview

This application provides a Command Line Interface handling functions and events from the SDK APIs.

Supported APIs:

Installation procedure

The project is located in the projects/dk_apps/demos/ble_cli folder.

To install the project follow the General Installation and Debugging Procedure.

UART Setup

Use a uart termninal (Putty etc) in order to establish uart communication with the following settings:

  • Baudrate: 115.200 bps
  • Data Bits: 8
  • Stop Bits: 1
  • Parity: None
  • Flow Control: None or RTS/CTS
  • Local Echo: Enabled (optional) in order for the user to see the given commands

Usage

To use the application, the device must be connected over a serial port. Once the application has started, the message "ble_cli application started" will be printed out.

Commands

The commands are split in categories named after the supported APIs. To list all available commands per category type the category name i.e.:

$> gap
gap commands:
gap address_get
gap address_set
gap dev_name_set
gap dev_name_get
gap appearance_set
gap appearance_get
gap per_pref_conn_params_set
gap per_pref_conn_params_get

In case category name does not match any of the supported APIs, all available categories will be printed out.

Getting Help

To find command arguments type command then help. Application will print the helper pattern i.e.:

$> gap address_set help
usage: gap address_set [pub|priv|priv-res|priv-nonres] <bd_addr> [renew_dur]

The command helper pattern will also be printed if any of the mandatory arguments is invalid or missing.

Running a Command

To run a command type it with all its mandatory arguments. The ommitted optional arguments are set to their default value.

Example:

gap address_set priv 80:EA:AD:00:00:00

will set the device address to private, 80:EA:AD:00:00:00 with the default renew duration (see ble_config.h).

Events

Application will print notifications on GAP, GATTS, or GATTC events. Event Notification contains event data and event name i.e.:

BLE_EVT_GAP_ADV_REPORT
Type of advertising packet: 0
BD address of advertising device: public, B1:B2:B3:B4:B5:B6
RSSI: 46
Length of advertising data: 11
Data: 0201060432501929308404