1010#include " esp_gatt_common_api.h"
1111#include " esp_gatts_api.h"
1212#include " esp_hidh_api.h"
13+ #include " inputdevices.h"
1314#include " megahub.h"
1415
1516#include < ArduinoJson.h>
@@ -111,25 +112,6 @@ struct HIDDevice {
111112 uint32_t handle;
112113};
113114
114- // Gamepad State - Standard HID gamepad layout
115- struct GamepadState {
116- esp_bd_addr_t address;
117- bool connected;
118- uint32_t timestamp;
119- uint16_t vendorId;
120- uint16_t productId;
121-
122- uint16_t buttons;
123-
124- uint8_t dpad;
125-
126- // Analog sticks (16-bit signed, range: -32768 to 32767, center=0)
127- int16_t leftStickX;
128- int16_t leftStickY;
129- int16_t rightStickX;
130- int16_t rightStickY;
131- };
132-
133115// HID Event Queue Item for async processing
134116struct HIDEventItem {
135117 esp_hidh_cb_event_t event;
@@ -143,6 +125,7 @@ class BTRemote {
143125 uint16_t gatts_if_;
144126 uint16_t app_id_;
145127
128+ InputDevices *inputDevices_;
146129 SerialLoggingOutput *loggingOutput_;
147130 Configuration *configuration_;
148131 Megahub *hub_;
@@ -176,8 +159,6 @@ class BTRemote {
176159 // HID Host
177160 std::map<std::string, HIDDevice> hidDevices_;
178161 SemaphoreHandle_t hidDevicesMutex_;
179- std::map<std::string, GamepadState> gamepadStates_;
180- SemaphoreHandle_t gamepadStatesMutex_;
181162
182163 // HID event processing queue and task
183164 QueueHandle_t hidEventQueue_;
@@ -249,7 +230,7 @@ class BTRemote {
249230 void stringToBdAddr (const std::string &str, esp_bd_addr_t address);
250231
251232public:
252- BTRemote (FS *fs, Megahub *hub, SerialLoggingOutput *loggingOutput, Configuration *configuragtion);
233+ BTRemote (FS *fs, InputDevices *inputDevices, Megahub *hub, SerialLoggingOutput *loggingOutput, Configuration *configuragtion);
253234
254235 void begin (const char *deviceName);
255236
@@ -283,10 +264,6 @@ class BTRemote {
283264 bool hidConnect (const char *macAddress);
284265 bool hidDisconnect (const char *macAddress);
285266 std::vector<HIDDevice> getConnectedHIDDevices ();
286-
287- // Gamepad API
288- bool getGamepadState (const char *macAddress, GamepadState &state);
289- std::vector<GamepadState> getAllGamepadStates ();
290267};
291268
292269#endif // BTREMOTE_H
0 commit comments