Skip to content

Output Report Function Not Working Properly in Release 2.1.0 #804

@Sab1e-dev

Description

@Sab1e-dev

Hello @h2zero ,
I am a contributor to the ESP32-BLE-Gamepad repository. We use your repository as a dependency, and I must say that your project is excellent! However, when adapting to Release 2.1.0, all other features work fine, but the Output Report doesn't seem to work properly. Specifically, when the host computer sends data, the following issue occurs:

Output Report send failed
Error writing report. Code: 1168, Message: Element not found.

You can find the host application here: HIDOutputDemo_CSharp
On the other hand, with the NimBLE Arduino version 1.4.3, I can use all the features without issues. I believe I have carefully checked the code, and it seems the issue is not with our repository.

Additionally, I have tried printing to check if the OutputReportChr pointer is correctly obtained, and it looks fine:

    if (enableOutputReport) {
    BleGamepadInstance->outputGamepad = BleGamepadInstance->hid->getOutputReport(BleGamepadInstance->configuration.getHidReportId());
    BleGamepadInstance->outputReceiver = new BleOutputReceiver(outputReportLength);
    if (BleGamepadInstance->outputGamepad == nullptr) {
        Serial.println("Failed to create Output Report characteristic!");
        return;
    }
    BleGamepadInstance->outputGamepad->setCallbacks(BleGamepadInstance->outputReceiver);

    Serial.println("Enabled Output Report!");
    }

图片

Here is the code I've modified in our repository: ESP32-BLE-Gamepad/tree/master
And here is the old version of the repository code: ESP32-BLE-Gamepad/tree/NimBLE-v1.4.3

I am not very familiar with the Bluetooth low-level architecture, so I would greatly appreciate your help. Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions