TI论坛
直播中

张英

7年用户 1401经验值
私信 关注
[问答]

请问static void simpleProfileChangeCB( uint8 paramID )是怎么调用的?

现在找到不到static void simpleProfileChangeCB( uint8 paramID )是怎么调用的,找不到入口在哪里
static void simpleProfileChangeCB( uint8 paramID ) //simpleProfile特征值改变时的回调函数
[
uint8 newValue;
switch( paramID )
[
case SIMPLEPROFILE_CHAR1:
SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR1, &newValue );
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteStringValue( "Char 1:", (uint16)(newValue), 10, HAL_LCD_LINE_3 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
break;
case SIMPLEPROFILE_CHAR3:
SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR3, &newValue );
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteStringValue( "Char 3:", (uint16)(newValue), 10, HAL_LCD_LINE_3 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
break;
default:
// should not reach here!
break;
]
]

回帖(1)

马海娟

2019-11-5 10:21:02
首先这是一个 GATT Profile 的回调函数
static simpleProfileCBs_t simpleBLEPeripheral_SimpleProfileCBs =
[
simpleProfileChangeCB // Charactersitic value change callback
]
然后再初始化中注册该回调
// Register callback with SimpleGATTprofile
VOID SimpleProfile_RegisterAppCBs( &simpleBLEPeripheral_SimpleProfileCBs );
下面是回调函数的注册函数
/*********************************************************************
* @fn SimpleProfile_RegisterAppCBs
*
* @brief Registers the application callback function. Only call
* this function once.
*
* @param callbacks - pointer to application callbacks.
*
* @return SUCCESS or bleAlreadyInRequestedMode
*/
bStatus_t SimpleProfile_RegisterAppCBs( simpleProfileCBs_t *appCallbacks )
[
if ( appCallbacks )
[
simpleProfile_AppCBs = appCallbacks;

return ( SUCCESS );
]
else
[
return ( bleAlreadyInRequestedMode );
]
]
                                                                         致力于帮助更多使用TI平台的开发者!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分