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

Gamepad with IOS #248

Open
Laurin08 opened this issue Dec 22, 2024 · 8 comments
Open

Gamepad with IOS #248

Laurin08 opened this issue Dec 22, 2024 · 8 comments

Comments

@Laurin08
Copy link

Is there still no workaround to use the gamepad with ios?
The BLE-Mouse library is supporting Ios so i think it should be possible somehow...

@lemmingDev
Copy link
Owner

@Laurin08
Copy link
Author

Hey
Thank you for your answer!!
I would like to try it but I get several errors while compiling. I think the problem is the NimBLE library, with the older version 2.0.0 I got less errors but still something:

/Users/laurinmichel/Documents/Arduino/libraries/ESP32-BLE-CompositeHID/GamepadDevice.cpp: In member function 'uint8_t GamepadDevice::specialButtonBitPosition(uint8_t)':
/Users/laurinmichel/Documents/Arduino/libraries/ESP32-BLE-CompositeHID/GamepadDevice.cpp:343:20: error: 'invalid_argument' is not a member of 'std'
343 | throw std::invalid_argument("Index out of range");
| ^~~~~~~~~~~~~~~~
/Users/laurinmichel/Documents/Arduino/libraries/ESP32-BLE-CompositeHID/GamepadDevice.cpp:6:1: note: 'std::invalid_argument' is defined in header ''; did you forget to '#include '?
5 | #include "esp32-hal-log.h"
+++ |+#include
6 | #define LOG_TAG "GamepadDevice"

exit status 1

Compilation error: exit status 1

@lemmingDev
Copy link
Owner

Might be best to ask on that specific page, though it might target NimBLE below 2.0.0

@Laurin08
Copy link
Author

Which nimble version do you use?

@lemmingDev
Copy link
Owner

NimBLE-Arduino-a79941cc9e77ed60136ee385b1c73d89c847bd94.zip

This is the version that the readme says to use

I just tried and it compiles fine with the xinput sketch, though I don't have an ESP32 handy to test with

Don't forget to also install the Callback library, as indicated in the readme
https://github.com/tomstewart89/Callback

@lemmingDev
Copy link
Owner

Also, please report back whether or not it works with iOS

@Laurin08
Copy link
Author

Laurin08 commented Dec 24, 2024

Hi
Thanks again, I was able to clear the error with adding #include <stdexcept> in the GamepadDevice.cpp file in the Composite-HID library. now it works with the 2.0.0 version of nimble.
And it also works with IOS!

@LeeNX
Copy link
Contributor

LeeNX commented Jan 9, 2025

@Laurin08 if all is good, do you mind closing the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants