2 - Connection Types
DynaPro Mini| PIN Encryption Device | Programmer’s Manual (Commands)
Page 24 of 128 (
D99875629-43
)
2.3
How to Use Bluetooth LE Connections (Bluetooth LE Only)
When the device is connected to a Bluetooth Low Energy (Bluetooth LE) capable host via Bluetooth LE,
the device acts as a Bluetooth LE server/peripheral, and the host acts as a client/central. The host
software wraps commands in simple Get/Set wrappers, and should use whatever Bluetooth LE library is
appropriate for the chosen software development framework. For example, iOS host apps use Apple’s
Framework, for which sample code is available in the form of Apple’s Temperature
Sensor app (see
https://developer.apple.com/library/IOS/samplecode/TemperatureSensor/Introduction/Intro.html).
Some of the details described in this section may be abstracted by the libraries in the chosen development
framework. For general information about Bluetooth LE and the associated terms, see the Bluetooth
specifications found at https://www.bluetooth.org/Technical/Specifications/adopted.htm.
The general steps for a host to communicate with the device via Bluetooth LE are as follows. Refer to
for details about each Bluetooth LE Characteristic (in this case, “Application” refers to the
device):
1)
Make sure the device is advertising. Some devices do not need to be fully powered on to advertise.
See the device’s
Installation and Operation Manual
for specific steps.
2)
Scan for nearby Bluetooth LE peripherals advertising the desired GATT service UUID.
3)
If multiple devices of the desired type are available, examine each device’s name property. A
specific device’s default name is a constant, equal to the product name plus a dash and a unique
identifier (for example, part of the serial number, part of its Bluetooth address, etc.)
4)
Establish a Bluetooth LE connection with the device. If this triggers the device to power on
automatically, the device may take some number of seconds to fully power on. The host should not
send additional commands or expect responses until after the power on sequence is complete.
5)
Pair with the device. If the host software prompts for a passkey, see the device’s
Installation and
Operation Manual
for information about passkeys. In many cases this step is operator-driven.
6)
Configure the device to notify the host when the
Application Data To Host Length
characteristic changes. The host should then use this notification as a trigger to read the
Application Data To Host
characteristic and process incoming data from the device. The
specific method to enable notifications for a characteristic is different in different Bluetooth LE
development libraries. For example, iOS code would be similar to
[servicePeripheral
setNotifyValue:YES forCharacteristic:characteristic]
.
7)
Send commands to the device by writing to the
Application Data From Host Length
characteristic, then to the
Application Data From Host
characteristic; receive notifications
that the device has changed the
Application Data To Host Length
characteristic, and read
the corresponding incoming data from the
Application Data To Host
characteristic.
8)
For further information about device modes, power management, and usage, see the device’s
Installation and Operation Manual
.
Table 2-3 - Bluetooth LE Characteristics and UUIDs
Characteristic
Max. Size
UUID In LSB (Little Endian) Order
Some frameworks use MSB order
DynaPro Mini GATT service
N/A
01:01:B6:0C:41:E3:43:F8:8F:89:82:AD:F8:E6:08:05
Application Data From Host Length 1 byte
20:02:B6:0C:41:E3:43:F8:8F:89:82:AD:F8:E6:08:05
Application Data From Host
65 bytes
21:02:B6:0C:41:E3:43:F8:8F:89:82:AD:F8:E6:08:05