Explorar el Código

Add idVendor() & idProduct() to HID parser class

main
PaulStoffregen hace 7 años
padre
commit
0e35681c48
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. +6
    -2
      USBHost_t36.h

+ 6
- 2
USBHost_t36.h Ver fichero

@@ -405,6 +405,10 @@ private:
// Device drivers may inherit from this base class, if they wish to receive
// HID input data fully decoded by the USBHIDParser driver
class USBHIDInput {
public:
operator bool() { return (mydevice != nullptr); }
uint16_t idVendor() { return (mydevice != nullptr) ? mydevice->idVendor : 0; }
uint16_t idProduct() { return (mydevice != nullptr) ? mydevice->idProduct : 0; }
private:
virtual bool claim_collection(Device_t *dev, uint32_t topusage);
virtual void hid_input_begin(uint32_t topusage, uint32_t type, int lgmin, int lgmax);
@@ -414,6 +418,8 @@ private:
void add_to_list();
USBHIDInput *next;
friend class USBHIDParser;
protected:
Device_t *mydevice = NULL;
};

/************************************************/
@@ -755,7 +761,6 @@ protected:
virtual void hid_input_end();
virtual void disconnect_collection(Device_t *dev);
private:
Device_t *mydevice = NULL;
uint8_t collections_claimed = 0;
volatile bool mouseEvent = false;
uint8_t buttons = 0;
@@ -780,7 +785,6 @@ protected:
virtual void hid_input_end();
virtual void disconnect_collection(Device_t *dev);
private:
Device_t *mydevice = NULL;
uint8_t collections_claimed = 0;
bool anychange = false;
volatile bool joystickEvent = false;

Cargando…
Cancelar
Guardar