EasyManuals Logo

Texas Instruments CC2540 Software Developers Guide

Texas Instruments CC2540
162 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 #83 background imageLoading...
Page #83 background image
www.ti.com
Porting From Earlier BLE-Stack Versions
83
SWRU271HOctober 2010Revised April 2019
Submit Documentation Feedback
Copyright © 2010–2019, Texas Instruments Incorporated
General Information
9.3.2.2 API Changes
The following API's are now abstracted through gattservapp_util.c:
extern void GATTServApp_InitCharCfg( uint16 connHandle, gattCharCfg_t *charCfgTbl );
extern uint16 GATTServApp_ReadCharCfg( uint16 connHandle, gattCharCfg_t *charCfgTbl );
extern bStatus_t GATTServApp_ProcessCharCfg( gattCharCfg_t *charCfgTbl, uint8 *pValue, uint8
authenticated, gattAttribute_t *attrTbl, uint
extern bStatus_t GATTServApp_ProcessCCCWriteReq( uint16 connHandle, gattAttribute_t *pAttr, uint8
*pValue, uint8 len, uint16 offset, uint1
Therefore, the following file should be added to your project (preferably under the PROFILES group for
consistency): $INSTALL$\Projects\ble\Profiles\GATT\ gattservapp_util.c
An additional "method" parameter has been added to profiles' read and write callback functions that are
registered with GATTServApp_RegisterService() to indicate the type of read/write message.
typedef bStatus_t (*pfnGATTReadAttrCB_t)(uint16 connHandle, gattAttribute_t *pAttr,
uint8 *pValue, uint8 *pLen, uint16 offset,
uint8 maxLen, uint8 method );
typedef bStatus_t (*pfnGATTWriteAttrCB_t)(uint16 connHandle, gattAttribute_t *pAttr,
uint8 *pValue, uint8 len, uint16 offset,
uint8 method );
Also, the GAP_RegisterForHCIMsgs( ) command has been changed to GAP_RegisterForMsgs().
9.3.2.3 Typedef Changes
The Central Event Callback function in the Central GAPRole has changed from:
typedef void (*pfnGapCentralRoleEventCB_t)
(
gapCentralRoleEvent_t *pEvent //!< Pointer to event structure.
);
to:
typedef uint8 (*pfnGapCentralRoleEventCB_t)
(
gapCentralRoleEvent_t *pEvent //!< Pointer to event structure.
);
9.3.2.4 Structure Changes
9.3.2.4.1 Array Elements Changed to Pointers
In order to prepare for a possible future fragmentation implementation, GATT / ATT payload structures are
no longer fixed sized arrays and are now pointers. Therefore, the payload is allocated based on its length.
This means that the names of all payload elements in the structures in att.h and gatt.h have changed. A
“p” has been added in front of the old array name and the next letter has been capitalized.
typedef struct
{
uint16 handle; //!< Handle of the attribute to be written (must be first field)
uint16 offset; //!< Offset of the first octet to be written
uint8 len; //!< Length of value
uint8 value[ATT_MTU_SIZE-5]; //!< Part of the value of the attribute to be written
} attPrepareWriteReq_t
has been changed to:
typedef struct
{
uint16 handle; //!< Handle of the attribute to be written (must be first field)
uint16 offset; //!< Offset of the first octet to be written
uint8 len; //!< Length of value
uint8 *pValue; //!< Part of the value of the attribute to be written (0 to ATT_MTU_SIZE-5) -
must be allocated
} attPrepareWriteReq_t;

Table of Contents

Other manuals for Texas Instruments CC2540

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments CC2540 Specifications

General IconGeneral
BrandTexas Instruments
ModelCC2540
CategoryMicrocontrollers
LanguageEnglish

Related product manuals