TI CC2540 Bluetooth low energy Sample Applications Guide v1.4.1 SWRU297 Version 1.4.1
Page 25 of 36
Copyright © 2011-2015 Texas Instruments, Inc
hidDevScanParamCB: This is the scan parameters service callback. Handle a scan
parameters service event.
10.4.4 GATT Read and Write Callbacks
The HID device profile GATT read and write callbacks, HidDev_WriteAttrCB and
HidDev_ReadAttrCB handle reading and writing of all HID characteristics. These functions are
used by a HID service when registering the service with GATT.
10.4.5 Mapping HID Reports to HID Characteristics
A HID service defines one or more HID reports in its service that are used to send and receive
HID data. The HID device profile has a table that maps HID reports to HID characteristics. The
table is constructed by the HID service using the HID device profile and must be registered with
the HID device profile by calling function HidDev_RegisterReports.
10.4.6 Sending and Receiving HID Reports
The application calls function HidDev_Report to send a HID report. The HID device sends HID
report notifications to the HID host when configured to do so. When notifications are enabled or
disabled for a HID report characteristic the HID report callback is executed with event
HID_DEV_OPER_ENABLE or HID_DEV_OPER_DISABLE.
A HID report is received from the HID host is either a read event or write event. The HID report
callback is executed with event HID_DEV_OPER_READ or HID_DEV_OPER_WRITE.
10.4.7 Advertising and Connection Procedures
The HID device profile manages advertising and connection procedures. The device will start
advertising if the HidDev_Report function is called when not connected and not already
advertising.
Advertising is performed at an “initial” rate when not bonded, and at a “low” or “high” rate if
bonded. The advertising intervals and durations for the different rates are configurable.
If the device is bonded the device will advertise at the high rate when reconnecting to send a HID
report. If the connection is terminated and the device is bonded and the flags are set to
HID_FLAGS_NORMALLY_CONNECTABLE the device will advertise at the low rate. Otherwise
the device will not advertise when disconnected until it has data to send.
If no HID data is sent or received within an idle timeout period the HID device profile will terminate
the connection, unless pairing is in progress. The idle timeout is configured by the application
and can be disabled by setting it to zero.
11 HostTestRelease- BLE Network Processor
The HostTestRelease project implements a BLE network processor, for use with an external
microcontroller or a PC software application such as BTool. More information on the
HostTestRelease project can be found in [1].
12 KeyFobDemo
The KeyFobDemo application will demonstrate the following.
Report battery level
Report 3 axis accelerometer readings.
Report proximity changes
Report key press changes
The following GATT services are used:
Device Information (see [12])