Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some of the HID consumer codes are not working as expected using the ble_hid_device_demo example (PlayPause(0xCD) AC Home (0xDF)) (IDFGH-13227) #14162

Open
3 tasks done
rleython opened this issue Jul 10, 2024 · 4 comments
Assignees
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@rleython
Copy link

rleython commented Jul 10, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

V5.2.2

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

What is the expected behavior?

What I am trying to do is to emulate an STB Remote Controller that uses the BLE connection to control a STB, when I connect the original remote control to my Android Phone I can detect the commands, and I can control i.e. the youtube player; Using the BLE example now I am able to use most of the commands defined there, but for HID_CONSUMER_PLAY_PAUSE that is defined in hid_dev.h file, it is not working as expected, neither in the STB or in the Youtube player, and the same is happening with the HID_CONSUMER_AC_HOME but this last one is not defined in hid_dev.h but I guess the code is the rigth one.

Most of the commands are working as expected using the HID, and HID consumer codes, exept for codes:

#define HID_CONSUMER_PLAY_PAUSE 205 // Play/Pause
and one more code not defined but acoording to some search should be :
#define HID_CONSUMER_AC_HOME 223 // AC Home

What is the actual behavior?

When I connect the BLE device to an application that identifies the keypressed, this is doing nothing, Is like the user is sending anything.

Steps to reproduce.

Basically I just modified the example to hardcode the commands:

  1. I am sending the keycode in true,
  2. Then I wait small period of time to simulate the keypress
  3. Then I sent the keycode in false to release the key
            esp_hidd_send_consumer_value(hid_conn_id, HID_CONSUMER_PLAY_PAUSE, true);
            vTaskDelay(100 / portTICK_PERIOD_MS);
            esp_hidd_send_consumer_value(hid_conn_id, HID_CONSUMER_PLAY_PAUSE, false);

Build or installation Logs.

No response

More Information.

  1. I have tried all the codes from 0x00 to 0xFF in both HID and HID Consumer codes and none of them are doing what is expected. I did it to discard that maybe there is another code expected.
  2. I have tried adding the 0x09, 0xCD, // Usage (Play/Pause)to the descriptor hid_device_le_prf.c file
  3. Also I noticed that the case to build the buffer when calling the function: hid_consumer_build_report has all the cases exept for the commands that I was looking for, so I have tried adding the case like:
case HID_CONSUMER_PLAY_PAUSE:
            HID_CC_RPT_SET_BUTTON(buffer, HID_CONSUMER_PLAY_PAUSE);
            break; 

but none of the above solutions are working as what I was expecting.

Any help or advice is really apreciated

@rleython rleython added the Type: Bug bugs in IDF label Jul 10, 2024
@github-actions github-actions bot changed the title Some of the HID consumer codes are not working as expected using the ble_hid_device_demo example (PlayPause(0xCD) AC Home (0xDF)) Some of the HID consumer codes are not working as expected using the ble_hid_device_demo example (PlayPause(0xCD) AC Home (0xDF)) (IDFGH-13227) Jul 10, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 10, 2024
@weiyuhannnn
Copy link
Collaborator

@rleython Thanks for choosing Espressif product! May I know which chip do you use?

@rleython
Copy link
Author

Thanks for your reply @weiyuhannnn , I am using the ESP32-WROOM-32D

@gcstr
Copy link

gcstr commented Aug 21, 2024

I have the same issue.

esp_hidd_send_consumer_value(hid_conn_id, HID_CONSUMER_PLAY_PAUSE, true);

has no effect

@esp-xzk
Copy link

esp-xzk commented Nov 12, 2024

Hello,
Please find the attached patch for instructions on sending the commands you asked for.
To send more custom commands, you need to adjust the report map in hid_device_le_prf.c as well as the hid_dev.h file and the hid_consumer_build_report function.
0001-patch-add-support-for-sending-PLAY-PAUSE-and-AC-home.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

6 participants