Logging and Telephony HID device #667
Replies: 9 comments 16 replies
-
https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf |
Beta Was this translation helpful? Give feedback.
-
HID report descriptor is very difficult thing to come up by oneself. You should google around, or dump report descriptor from existing device to copy/follow it. For debug log, it will printed via UART in GPIO0, 1 |
Beta Was this translation helpful? Give feedback.
-
I fixed the report not aligned error, somewhere in the PDF there is a line that says: Which does not match, the REPORT_SIZE should be 7, so 0x07 and not 0x05. I pushed my new code to github. I also changed my vendor id to microsoft as per the document: Unfortunately, I am getting absolutely zero reports in from teams or skype for presence icons as I expected. I get in my num/caps lock reports (which I can see through the debug print function I built in, log and debug still not working on the pico despite a rm * -rf in the build folder, and a "clean" cmake .. and make LOG=2 DEBUG=1 command). So no cigar yet. I am thinking somewhere in this text is the clue to why it's not working: But I'll be damned if I know what I should add to the descriptor to get this puppy to work... |
Beta Was this translation helpful? Give feedback.
-
OK, New plan. Hope you can help me with this one. I "copied" a HID descriptor from a Kuando Busylight. I did some usb captures, and by going through them, the data seems to be transferred using " URB_INTERRUPT out" according to wireshark:
But using my current callbacks: I do not see this data coming in anywhere. So my question to you is, how can I capture and answer this "HID Data"? |
Beta Was this translation helpful? Give feedback.
-
Cool, I got it to work (uploaded my changes to github) with debug, Had set it to one, setting it to "2" fixed it. It said "1" on https://github.com/hathach/tinyusb/blob/master/docs/getting_started.md#debug , I guess that it is why I had set it to "1". I uploaded the wireshark capture of the pico (and the USB Device I'm trying to mimic). They are all in my repo, and I updated the description in the readme as to how I filtered out the data: https://github.com/buildcomics/MST_keyboard I am still looking for that "HID Data" that was sent. For the actual USB device it is showing up as an "URB_INTERRUPT in". The pico shows something simular, but now it is a "USBHID" "SET_REPORT Request" It seems to come in as a "USBD Setup", "HID control request" as far as I can see below. Now my question is, how do I capture this HID control request, the data attached to it and "answer" it. Is there a callback function for the USBD Setup and/or HID Control request?
|
Beta Was this translation helpful? Give feedback.
-
I have a suspicion of the cause, when looking at the code in hid_device.c, I noticed the comparison of the bm REquest type with TUSB_REQ_TYPE_CLASS.:
Looking at my pcaps, this value is 0x21 Looking at the code, the defined value in the code below is 2
So is this HID action "illegal"? According to https://www.beyondlogic.org/usbnutshell/usb6.shtml |
Beta Was this translation helpful? Give feedback.
-
Allright, I figured it out. I used the tid_hid_report function to "answer". Code snippet below, full code on github
|
Beta Was this translation helpful? Give feedback.
-
I'm afraid I'm not quite there yet. I wanted to "add" keyboard functionality to my device, so I updated the HID descriptor as per below. Unfortunately, now things stop working somehow... I do not get the program to send me it's normal HID reports for some reason. I am afraid I messed up my HID descriptor. Even though the below is not working, it also is not working as soon as I add the HID_REPORT_ID to the descriptor. Is there any reason this all of a sudden can change things?
|
Beta Was this translation helpful? Give feedback.
-
Related: I started building the very same thing, but my approach was to build a chrome extension that interacts with the web version of Teams to run functions and read data. Hint: you have to load React.js in debug mode, then you have proper scope to access all the functions and variables. That's where I was able to get the call status, camera toggles etc. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm attempting to create a Telephony HID device to control skype/teams or other unified communications software. I want to have status LEDs for "in a call", mute/unmute. I also aim to have buttons for hang up, answer, mute/unmute.
I found the microsoft teams spec: https://docs.microsoft.com/en-us/skypeforbusiness/certification/test-spec
Specifying to use a telephony HID device.
I am using a raspberry pi pico, and I can succesfully emulate a normal keyboard. Then I tried to enable deub logging by either doing "make DEBUG=1" or even "make DEBUG=1 LOG=2". But I still do not get anything in the serial output of the pico apart from the debug messages I write myself.
I tried changing tusb_config.h to set "#define CFG_TUSB_DEBUG 1" , but that didn't help either.
Apart from that, I am struggling to understand the desc_hid_report. I copied the "keyboard" example, but I am a bit at a loss how this part is setup:
Is there any documentation available on what all this is? Such that I can change it to provide the teams HID specs that I need?
I put all the code that I got so far up here: https://github.com/buildcomics/MST_keyboard
Beta Was this translation helpful? Give feedback.
All reactions