Part Number: LAUNCHXL-CC2640R2
Hi,
I am porting sensortag_cc2650lp_app from BLE 2.2. to CC2640R2 SDK. I am using the porting guide, simple_peripheral and project_zero as references. At porting guide this is mentioned below.regarding Listing 30. ICall Registration.
// Register the current thread as an ICall dispatcher application // so that the application can send and receive messages via ICall to Stack. ICall_registerApp(&selfEntity, &syncEvent);
"The application supplies the selfEntity and syncEvent inputs. These inputs are initialized for the task of the client (for example, application) when the ICall_registerApp() returns are initialized. These objects are subsequently used by ICall to facilitate messaging between the application and server tasks. The syncEvent argument represents the Events Module handle for signaling and the selfEntity represents the destination message queue of the task. Each task registering with ICall have unique syncEvent and selfEntity identifiers."
I see at project zero that "selfEntity" is passed to LedService_AddService(), ButtonService_AddService(), DataService_AddService().
// Add services to GATT server and give ID of this task for Indication acks. LedService_AddService( selfEntity ); ButtonService_AddService( selfEntity ); DataService_AddService( selfEntity );
If passing "selfEntity" to xxxxxx_AddService() C API's is necessary then, I would need to modify all xxxxx_AddService() C API's to accept "selfEntity"? Is that right or wrong? Example, I would need to modify the Io_addService() below to have an argument for "selfEntity".
/*********************************************************************
* @fn Io_addService
*
* @brief Initializes the IO Service service by registering
* GATT attributes with the GATT server.
*
* @return Success or Failure
*/
bStatus_t Io_addService(void)
{
// Allocate Client Characteristic Configuration table
ioDataConfig = (gattCharCfg_t *)ICall_malloc(sizeof(gattCharCfg_t) *
linkDBNumConns);
if (ioDataConfig == NULL)
{
return (bleMemAllocError);
}
// Initialize Client Characteristic Configuration attributes
GATTServApp_InitCharCfg(INVALID_CONNHANDLE, ioDataConfig);
// Register GATT attribute list and CBs with GATT Server App
return GATTServApp_RegisterService(ioAttrTbl,
GATT_NUM_ATTRS(ioAttrTbl),
GATT_MAX_ENCRYPT_KEY_SIZE,
&ioCBs);
}
- kel