EasyManuals Logo

Texas Instruments CC2541EMK Application Guide

Texas Instruments CC2541EMK
36 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #24 background imageLoading...
Page #24 background image
TI CC2540 Bluetooth low energy Sample Applications Guide v1.4.1 SWRU297 Version 1.4.1
Page 24 of 36
Copyright © 2011-2015 Texas Instruments, Inc
Function HidEmuKbd_ProcessOSALMsg handles OSAL messages as follows:
KEY_CHANGE messages: Call function HidEmuKbd_HandleKeys to handle
keypresses.
10.3.3 Callbacks
The application callback functions are as follows:
hidEmuKbdRptCB: This is the HID device report callback. It processes HID reports
received from the HID host.
hidEmuKbdEvtCB: This is the HID device event callback. It handles HID events, such
as enter/exit suspend or enter/exit boot mode.
10.3.4 Sending Notifications
The application sends notifications containing HID keypress data when a button is pressed. This
is done in function HidEmuKbd_HandleKeys by calling HID device profile function
HidDev_Report. The details of sending notifications are handled in the HID device profile.
10.4 HID Device Profile
The HID device profile is implemented in the file hiddev.c.
10.4.1 Initialization
The initialization of occurs in two phases: first, the HidDev_Init function is called by OSAL. This
function sets up the battery, device information, and scan parameters services along with
standard GATT and GAP services in the attribute server. Then it sets an OSAL
START_DEVICE_EVT event. This triggers the second phase of the initialization, which can be
found within the HidDev_ProcessEvent function. During this phase, the GAPRole_StartDevice
function is called to set up the GAP functions of the application. Then GAPBondMgr_Register is
called to register with the bond manager.
10.4.2 Event Processing
The application has two main event processing functions, HidDev_ProcessEvent and
HidDev_ProcessOSALMsg.
Function HidDev_ProcessEvent handles events as follows:
SYS_EVENT_MSG: Service the OSAL queue and process OSAL messages.
START_DEVICE_EVT: Start the device, as described in the previous section.
HID_IDLE_EVT: Terminate the connection if idle.
BATT_PERIODIC_EVT: Check the battery level and send notification if it changed.
Function HidDev_ProcessOSALMsg handles OSAL messages as follows:
GATT_MSG_EVENT messages: Call function hidDevProcessGattMsg to process
GATT messages.
10.4.3 Callbacks
The HID device profile callback functions are as follows:
HidDevGapStateCB: This is the GAP event callback. It processes GAP events for
startup and link connect/disconnect.
hidDevPairStateCB: This is the pairing state callback. Handle pairing events.
hidDevPasscodeCB: This is the passcode callback. Send a passcode response.
HidDevBattCB: This is the battery service callback. It handles enabling or disabling
periodic battery measurements when notifications of the battery level-state are enabled or
disabled.

Table of Contents

Other manuals for Texas Instruments CC2541EMK

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments CC2541EMK and is the answer not in the manual?

Texas Instruments CC2541EMK Specifications

General IconGeneral
BrandTexas Instruments
ModelCC2541EMK
CategoryMicrocontrollers
LanguageEnglish

Related product manuals