由於想要在 cc2541中實現 截取鍵盤上的 num caps 狀態,而在HIDEMUKBD範例中有看到關於
hidAdvRemoteRptCB
這個callbackfunction,裡面所夾帶的字串為
uint8 id, uint8 type, uint16 uuid,
uint8 oper, uint8 *pLen, uint8 *pData )
而裡面的判斷式為:
// write
if ( oper == HID_DEV_OPER_WRITE )
{
if ( uuid == HID_REPORT_UUID )
{
// process write to LED output report; ignore others
if ( type == HID_REPORT_TYPE_OUTPUT )
{
status = hidAdvRemoteRcvReport( *pLen, pData );
}
}
if ( status == SUCCESS )
{
status = HidKbM_SetParameter( id, type, uuid, *pLen, pData );
}
}
// read
else if ( oper == HID_DEV_OPER_READ )
{
status = HidKbM_GetParameter( id, type, uuid, pLen, pData );
}
return status;
由於我在CC2541中的HIDadvremote中 debug模式一值把oper 為 read 因此都不會跑 write的程式
想問為何只有read? 何種時後才有write的oper?又這個callbackfunction是輪詢狀態嗎?
謝謝大家