Made SendReport() capaital

This commit is contained in:
NicoHood 2015-10-10 19:37:58 +02:00
parent 2e72174480
commit e521af69ca
12 changed files with 47 additions and 12 deletions

View file

@ -37,7 +37,7 @@ void KeyboardAPI::end(void)
void KeyboardAPI::send_now(void){
sendReport(&_keyReport, sizeof(_keyReport));
SendReport(&_keyReport, sizeof(_keyReport));
}

View file

@ -63,7 +63,7 @@ public:
size_t removeKeycodeFromReport(uint8_t k);
// Sending is public in the base class for advanced users.
virtual void sendReport(void* data, int length) = 0;
virtual void SendReport(void* data, int length) = 0;
protected:
HID_KeyboardReport_Data_t _keyReport;

View file

@ -54,7 +54,7 @@ void MouseAPI::move(signed char x, signed char y, signed char wheel)
report.xAxis = x;
report.yAxis = y;
report.wheel = wheel;
sendReport(&report, sizeof(report));
SendReport(&report, sizeof(report));
}
void MouseAPI::buttons(uint8_t b)

View file

@ -138,7 +138,7 @@ public:
bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default
// Sending is public in the base class for advanced users.
virtual void sendReport(void* data, int length) = 0;
virtual void SendReport(void* data, int length) = 0;
private:
uint8_t _buttons;

View file

@ -65,7 +65,7 @@ Keyboard_::Keyboard_(void)
HID().AppendDescriptor(&node);
}
void Keyboard_::sendReport(void* data, int length)
void Keyboard_::SendReport(void* data, int length)
{
HID().SendReport(HID_REPORTID_KEYBOARD, data, length);
}

View file

@ -37,7 +37,7 @@ public:
Keyboard_(void);
protected:
virtual inline void sendReport(void* data, int length) override;
virtual inline void SendReport(void* data, int length) override;
};
extern Keyboard_ Keyboard;

View file

@ -23,13 +23,48 @@ THE SOFTWARE.
#include "ImprovedMouse.h"
static const uint8_t _hidMultiReportDescriptorMouse[] PROGMEM = {
/* Mouse relative */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) 54 */
0x09, 0x02, /* USAGE (Mouse) */
0xa1, 0x01, /* COLLECTION (Application) */
0x85, HID_REPORTID_MOUSE, /* REPORT_ID */
/* 8 Buttons */
0x05, 0x09, /* USAGE_PAGE (Button) */
0x19, 0x01, /* USAGE_MINIMUM (Button 1) */
0x29, 0x08, /* USAGE_MAXIMUM (Button 8) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x95, 0x08, /* REPORT_COUNT (8) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x81, 0x02, /* INPUT (Data,Var,Abs) */
/* X, Y, Wheel */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x30, /* USAGE (X) */
0x09, 0x31, /* USAGE (Y) */
0x09, 0x38, /* USAGE (Wheel) */
0x15, 0x81, /* LOGICAL_MINIMUM (-127) */
0x25, 0x7f, /* LOGICAL_MAXIMUM (127) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x03, /* REPORT_COUNT (3) */
0x81, 0x06, /* INPUT (Data,Var,Rel) */
/* End */
0xc0 /* END_COLLECTION */
};
Mouse_::Mouse_(void)
{
static HIDDescriptorListNode node(_hidMultiReportDescriptorMouse, sizeof(_hidMultiReportDescriptorMouse));
HID().AppendDescriptor(&node);
}
void Mouse_::sendReport(void* data, int length)
void Mouse_::SendReport(void* data, int length)
{
HID().SendReport(HID_REPORTID_MOUSE, data, length);
}

View file

@ -37,7 +37,7 @@ public:
Mouse_(void);
protected:
virtual inline void sendReport(void* data, int length) override;
virtual inline void SendReport(void* data, int length) override;
};
extern Mouse_ Mouse;

View file

@ -151,7 +151,7 @@ uint8_t BootKeyboard_::getProtocol(void){
return protocol;
}
void BootKeyboard_::sendReport(void* data, int length){
void BootKeyboard_::SendReport(void* data, int length){
USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, length);
}

View file

@ -50,7 +50,7 @@ protected:
uint8_t leds;
virtual void sendReport(void* data, int length) override;
virtual void SendReport(void* data, int length) override;
};
extern BootKeyboard_ BootKeyboard;

View file

@ -95,7 +95,7 @@ uint8_t BootMouse_::getProtocol(void){
return protocol;
}
void BootMouse_::sendReport(void* data, int length){
void BootMouse_::SendReport(void* data, int length){
if(protocol == HID_BOOT_PROTOCOL){
USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, sizeof(HID_BootMouseReport_Data_t));
}

View file

@ -47,7 +47,7 @@ protected:
uint8_t protocol;
uint8_t idle;
virtual void sendReport(void* data, int length) override;
virtual void SendReport(void* data, int length) override;
};
extern BootMouse_ BootMouse;