mirror of
https://github.com/RPCS3/hidapi.git
synced 2026-01-31 01:25:21 +01:00
macOS: fix hid_send_output_report implementation
- fix name of the function on macOS - add compile-time check by the CI Fixes: #683
This commit is contained in:
@@ -86,7 +86,11 @@ void print_hid_report_descriptor_from_device(hid_device *device) {
|
||||
int res = 0;
|
||||
|
||||
printf(" Report Descriptor: ");
|
||||
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 14, 0)
|
||||
res = hid_get_report_descriptor(device, descriptor, sizeof(descriptor));
|
||||
#else
|
||||
(void)res;
|
||||
#endif
|
||||
if (res < 0) {
|
||||
printf("error getting: %ls", hid_error(device));
|
||||
}
|
||||
@@ -131,6 +135,23 @@ int main(int argc, char* argv[])
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
/* --- HIDAPI R&D: this is just to force the compiler to ensure
|
||||
each of those functions are implemented (even as a stub)
|
||||
by each backend. --- */
|
||||
(void)&hid_open;
|
||||
(void)&hid_open_path;
|
||||
(void)&hid_read_timeout;
|
||||
(void)&hid_get_input_report;
|
||||
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 15, 0)
|
||||
(void)&hid_send_output_report;
|
||||
#endif
|
||||
(void)&hid_get_feature_report;
|
||||
(void)&hid_send_feature_report;
|
||||
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 14, 0)
|
||||
(void)&hid_get_report_descriptor;
|
||||
#endif
|
||||
/* --- */
|
||||
|
||||
int res;
|
||||
unsigned char buf[256];
|
||||
#define MAX_STR 255
|
||||
|
||||
@@ -1341,7 +1341,7 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data,
|
||||
return get_report(dev, kIOHIDReportTypeFeature, data, length);
|
||||
}
|
||||
|
||||
int HID_API_EXPORT hid_send_output_feature_report(hid_device *dev, const unsigned char *data, size_t length)
|
||||
int HID_API_EXPORT hid_send_output_report(hid_device *dev, const unsigned char *data, size_t length)
|
||||
{
|
||||
return set_report(dev, kIOHIDReportTypeOutput, data, length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user