uint16_t?Peripheral_ProcessEvent(uint8_t?task_id,?uint16_t?events) { ??... ????if(events?&?SBP_PERIODIC_EVT) ????{ ????????if(SBP_PERIODIC_EVT_PERIOD) ????????{ ????????????tmos_start_task(Peripheral_TaskID,?SBP_PERIODIC_EVT,?SBP_PERIODIC_EVT_PERIOD); ????????} ????????performPeriodicTask(); ????????return?(events?^?SBP_PERIODIC_EVT); ????} ??... } static?void?performPeriodicTask(void) { ????uint8_t?notiData[SIMPLEPROFILE_CHAR4_LEN]?=?{0x88}; ????peripheralChar4Notify(notiData,?SIMPLEPROFILE_CHAR4_LEN); } static?void?peripheralChar4Notify(uint8_t?*pValue,?uint16_t?len) { ????attHandleValueNoti_t?noti; ????if(len?>?(peripheralMTU?-?3)) ????{ ????????PRINT("Too?large?noti\r\n"); ????????return; ????} ????noti.len?=?len; ????noti.pValue?=?GATT_bm_alloc(peripheralConnList.connHandle,?ATT_HANDLE_VALUE_NOTI,?noti.len,?NULL,?0); ????if(noti.pValue) ????{ ????????tmos_memcpy(noti.pValue,?pValue,?noti.len); ????????if(simpleProfile_Notify(peripheralConnList.connHandle,?¬i)?!=?SUCCESS) ????????{ ????????????GATT_bm_free((gattMsg_t?*)¬i,?ATT_HANDLE_VALUE_NOTI); ????????} ????} }
當(dāng)BLE調(diào)試助手開(kāi)啟Characteristic 4的通知功能 ,上述幾個(gè)函數(shù)將周期向主機(jī)發(fā)送通知
有幾個(gè)問(wèn)題請(qǐng)教各位大神
1、如何觸發(fā)開(kāi)啟或關(guān)閉周期發(fā)送通知
2、它是如何知道是gattprofile服務(wù)中Characteristic 4 的通知