Porting From Earlier BLE-Stack Versions
www.ti.com
84
SWRU271H–October 2010–Revised April 2019
Submit Documentation Feedback
Copyright © 2010–2019, Texas Instruments Incorporated
General Information
Macro’s have been added which can be used to access offsets from these pointer locations. For example:
typedef struct
// Service found, store handles
if ( pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
pMsg->msg.findByTypeValueRsp.numInfo > 0 )
{
simpleBLESvcStartHdl = pMsg->msg.findByTypeValueRsp.handlesInfo[0].handle;
simpleBLESvcEndHdl = pMsg->msg.findByTypeValueRsp.handlesInfo[0].grpEndHandle;
}
has been changed to:
// Service found, store handles
if (pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
pMsg->msg.findByTypeValueRsp.numInfo > 0 )
{
simpleBLESvcStartHdl = ATT_ATTR_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
simpleBLESvcEndHdl = ATT_GRP_END_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
}
where the macro's used are defined as:
#define ATT_ATTR_HANDLE( info, i ) ( BUILD_UINT16( (info)[ATT_ATTR_HANDLE_IDX((i))], \
(info)[ATT_ATTR_HANDLE_IDX((i))+1] ) )
#define ATT_GRP_END_HANDLE( info, i ) ( BUILD_UINT16( (info)[ATT_GRP_END_HANDLE_IDX((i))], \
(info)[ATT_GRP_END_HANDLE_IDX((i))+1] ) )
9.3.2.4.2 Additional Fields in Key Distribution Strucutre
The keyDist_t has several added fields which were previously reserved. These are needed for
interoperability with Bluetooth 4.1 Security features. See an example of how to use this in the 1.4.1
HostTestRelease project.
typedef struct
{
unsigned int sEncKey:1; //!< Set to distribute slave encryption key
unsigned int sIdKey:1; //!< Set to distribute slave identity key
unsigned int sSign:1; //!< Set to distribute slave signing key
unsigned int sLinkKey:1; //!< Set to derive slave link key from slave LTK
unsigned int sReserved:4; //!< Reserved for slave - don't use
unsigned int mEncKey:1; //!< Set to distribute master encryption key
unsigned int mIdKey:1; //!< Set to distribute master identity key
unsigned int mSign:1; //!< Set to distribute master signing key
unsigned int mLinkKey:1; //!< Set to derive master link key from master LTK
unsigned int mReserved:4; //!< Reserved for master - don't use
} keyDist_t;
9.3.2.5 Default Value of HAL Components
The default values of HAL components, if not defined, have changed. See the hal_board_cfg.h file for a
list of the default values. If you need to modify any of these, add a preprocessor definition. For example,
HAL_KEY is now set to TRUE if not defined. Therefore, the SimpleBLEPeripheral project has added a
new preprocessor definition: HAL_KEY=FALSE.
9.3.2.6 Allocating Memory for Over-the-Air Messages
As stated above, there have been changes made to prepare for a possible future fragmentation
implementation. Therefore, it is now necessary to allocate memory for data sent over-the-air for ATT /
GATT commands.
For example, a buffer must be allocated when sending a GATT_Notification. Note that this is done by the
stack if the preferred method to send a GATT notification / indication is to used. That is, using a profile’s
SetParameter function (i.e. SimpleProfile_SetParameter()) and calling GATTServApp_ProcessCharCfg().
See the simpleGATTProfile.c for an example of this.