![Cypress EZ-BLE PRoC AN9684 Getting Started Download Page 9](http://html1.mh-extra.com/html/cypress/ez-ble-proc-an9684/ez-ble-proc-an9684_getting-started_2705915009.webp)
Getting Started With EZ-
BLE™ PRoC™ Module
www.cypress.com
Document No.: 001-96841 Rev. **
9
S e c u r i t y M a n a g e r ( S M )
The SM layer defines the methods used for key
distribution to perform encryption and pairing.
Pairing
is the process to enable security features. In
this process, two devices are authenticated, the link is
encrypted, and then keys are exchanged.
Bonding
is the process in which the keys and identity
information exchanged during the pairing process are
saved within the paired devices. Bonded devices do
not have to go through the pairing process again
when reconnected.
A t t r i b u t e P r o t o c o l ( AT T )
ATT forms the basis of the BLE communication. This
protocol enables the client to find and access attributes on
the server. An attribute is the fundamental data-carrying
element in BLE, which consists of the following:
Attribute Handle:
This is the 16-bit address assigned
by the attribute server to allow its client to identify and
access an attribute.
Attribute Type:
This specifies the type of data stored
in an attribute. It is represented by a 128-bit number
called a universally unique identifier (UUID).
Bluetooth SIG defines the Bluetooth Base UUID,
which is 128 bits long. In this base UUID, typically 16
bits (32 bits for Bluetooth 4.1) are used to identify an
attribute type.
The Bluetooth Base UUID is:
0x0000xxxx-0000-1000-8000-00805F9B34FB
The 16-bit UUID of the Heart Rate Service (HRS) is
0x180D, so the complete 128-bit UUID for the HRS is
0x0000180D-0000-1000-8000-00805F9B34FB
Attribute Value:
This is the actual data stored in the
attribute.
Attribute Permission:
This specifies whether an
attribute can be read or written, and the security level
required. Attribute permission is set by the higher
layer specification and is not discoverable through the
attribute protocol.
Figure 7
shows the structure of an attribute with an
example.
Figure 7. Attribute Format and Example
Attribute
Handle
Attribute Type
At tribute Value
Attribute
Permission
2 bytes
2 bytes
0 to 512 bytes
Implementation
specific
0x0003
0x2A00
(UUID for
Device Name)
―Cypress HRM‖
Read Only, No
Authentication,
No Encryption
Example
Format
Several types of attributes are defined by Bluetooth SIG;
some of which are as follows:
Service:
The service attribute defines the function
performed by the server. It is a collection of data
entities called ―characteristics‖ and can also include
other services.
A service can be of two types: primary service or
secondary service. A primary service exposes the
main functionality of the device while the secondary
service provides additional functionality that a primary
service encapsulates, but that is not required to be
exposed. In a heart rate monitoring device example,
HRS is a primary service and Battery Service (BAS) is
a secondary service.
Characteristic:
The characteristic attribute exposes
the data, and consists of an attribute that holds the
value and a descriptor. ―Battery level‖ is an example
of a characteristic.
Descriptor:
The descriptor is a part of the
characteristic declaration, and provides additional
information about the characteristic. Representing the
battery level in percentage values is an example of
characteristic descriptor.
Figure 8
shows the structure of a characteristic.
Figure 8. Characteristic Format and Example
<<Characteristic>>
Value
<<Descriptor>>
<<Descriptor>>
Battery Service
Battery Level
Client Characteristic
Configuration Descriptor
Characteristic
Presentation Format
Attribute Operations:
These are accessed using the
following five basic methods:
Read Request:
Sent by the client to read an
attribute value. For every request, the server
sends a response to the client.
Write Request:
Sent by the client to write an
attribute value. The sever responds to the client
confirming whether the value is written.
Write Command:
Sent by the client to the server
to write an attribute value. The server does not
send any response for the write command.
Notification:
Sent by the server to the client to
notify a new value or a change in value. The client
does not send any response for a notification
command.
Indication:
A type of notification from the server
that is always confirmed by the client.