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 keyboard emu works but not mouse in HIDEmuKdb

Other Parts Discussed in Thread: CC2540

I'm currently trying to get the CC2540 to act as both a mouse and a keyboard.  I am basing my project off of the HIDEmuKbd project.  Currently I can get the keyboard to work no problem, but when I try and use the mouse nothing happens.  

I believe it has something to do with the fact that the mode in the hid report map is set to HID_PROTOCOL_MODE_BOOT.  This causes my mouse commands to return without executing as it requires the mouse protocol in the table to match the general protocol mode that is set in the file (HID_PROTOCOL_MODE_REPORT).  However, forcing this to execute or manually changing it to match has no effect and the mouse still does not work.

There's little to no documentation on working with the mouse that I can find.  Do I need to send a command to set up boot mode?  Any insight here would be appreciated.

  • Hello Nathan,

    By default HIDEmuKbd supports keyboard mode. I'll notify the HID team to see if there is a function mouse example.

    Best wishes
  • Hi,
    I suggest you take a look at the HIDAdvRemote project. It's written for another hardware platform although the software components for the mouse functionality should be fairly transparent. How do you capture movement?

    The hardware platform I'm referring to is; www.ti.com/.../cc2541arc-rd

    Best Regards
    Joakim
  • The project says it supports boot mouse, but to be honest I'm not entirely sure what this means. Anyways, I tried integrating the HIDAdvRemote into my working code (using the hidkbmservice.c files as a substitute), but I'll take another look and see if I can get anything working. I assumed it didn't work before because of different architectures, but I wasn't sure. I'll report back afterwards.

    EDIT: To answer your question, I capture movement with a serial callback mechanism.  Essentially an external MCU sends commands for particular operations.  This works find and when debugging I can see the commands being properly sent.

  • OK I figured it out. I used the HIDAdvRemote project, but it wasn't working. Turns out one of the #defines (specifically #define HID_RPT_ID_KEY_IN was set to 0 in my project instead of 2). I have no idea why this seems to be different between the hidemukbd and hidemukbm projects, but changing it seems to have worked.