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.

(CC2541) How do I detect keyboard caps lock led status ?

Hi~ 

I used HIDEmuKbd (1.3.2 version) project + HidKbM_AddService can't get HOST led (num lock, caps lock) status.

Test keyboard and mouse cursor motion and consumer then can work properly on WIN8 system.

But original HiDEmuKbd firmware it can working (In hidEmuKbdRcvReport change leds status).  

They're difference as follows:

One is the keyboard + mouse + consumer service

Other is the keyboard service only

In my firmware just modify as below:

#if (defined HAL_KBMS) && (HAL_KBMS != TRUE)
    // Set up HID keyboard service
    HidKbd_AddService();
#else
    // Set up HID keyboard + Mouse service
    HidKbM_AddService();
#endif

static uint8 hidEmuKbdRptCB( uint8 id, uint8 type, uint16 uuid,
uint8 oper, uint8 *pLen, uint8 *pData )
{
uint8 status = SUCCESS;

// 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 = hidEmuKbdRcvReport( *pLen, pData );
       }
    }

    if ( status == SUCCESS )
    {
#if (defined HAL_KBMS) && (HAL_KBMS != TRUE)
        status = HidKbd_SetParameter( id, type, uuid, *pLen, pData );
#else
        status = HidKbM_SetParameter( id, type, uuid, *pLen, pData );
#endif
    }
}
// read
else if ( oper == HID_DEV_OPER_READ )
{
#if (defined HAL_KBMS) && (HAL_KBMS != TRUE)
    status = HidKbd_GetParameter( id, type, uuid, pLen, pData );
#else
    status = HidKbM_GetParameter( id, type, uuid, pLen, pData );
#endif
}