This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540 Notify 使用问题



Hi,各位好:

       最近才开始搞一个蓝牙的项目,有些问题想请教一下各位。sever端可以通过notify发送数据给client端,不需要uuid匹配。那请问,notify需要怎么进行初始化呢?

以一个官方的thermometer例子说明一下:在Thermometer_ProcessEvent任务中的TH_PERIODIC_IMEAS_EVT事件中进行notify处理,进一步跟踪在  thermometerCB回调函数中

case THERMOMETER_IMEAS_NOTI_ENABLED:
temperatureIMeasCharConfig = true;
if (gapProfileState == GAPROLE_CONNECTED)
{
osal_start_timerEx( thermometerTaskId, TH_PERIODIC_IMEAS_EVT, 1000 );
}
break;   

回调函数thermometerCB是由Thermometer_Register函数注册到thermometerServiceCB    通过搜索在thermometer_WriteAttrCB函数里发现了thermometerServiceCB回调函数。

请问在初始化notify问什么需要进到thermometer_WriteAttrCB函数里,这个函数又是由谁触发的呢? 谢谢