Reorder AOA functions
This will allow sc_aoa_setup_hid() to compile even when sc_aoa_unregister_hid() will be made static.
This commit is contained in:
parent
1344b76f42
commit
2caf593960
@ -126,26 +126,6 @@ sc_aoa_set_hid_report_desc(struct sc_aoa *aoa, uint16_t accessory_id,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
sc_aoa_setup_hid(struct sc_aoa *aoa, uint16_t accessory_id,
|
|
||||||
const uint8_t *report_desc, uint16_t report_desc_size) {
|
|
||||||
bool ok = sc_aoa_register_hid(aoa, accessory_id, report_desc_size);
|
|
||||||
if (!ok) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = sc_aoa_set_hid_report_desc(aoa, accessory_id, report_desc,
|
|
||||||
report_desc_size);
|
|
||||||
if (!ok) {
|
|
||||||
if (!sc_aoa_unregister_hid(aoa, accessory_id)) {
|
|
||||||
LOGW("Could not unregister HID");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
sc_aoa_send_hid_event(struct sc_aoa *aoa, const struct sc_hid_event *event) {
|
sc_aoa_send_hid_event(struct sc_aoa *aoa, const struct sc_hid_event *event) {
|
||||||
uint8_t request_type = LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR;
|
uint8_t request_type = LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR;
|
||||||
@ -192,6 +172,26 @@ sc_aoa_unregister_hid(struct sc_aoa *aoa, uint16_t accessory_id) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
sc_aoa_setup_hid(struct sc_aoa *aoa, uint16_t accessory_id,
|
||||||
|
const uint8_t *report_desc, uint16_t report_desc_size) {
|
||||||
|
bool ok = sc_aoa_register_hid(aoa, accessory_id, report_desc_size);
|
||||||
|
if (!ok) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ok = sc_aoa_set_hid_report_desc(aoa, accessory_id, report_desc,
|
||||||
|
report_desc_size);
|
||||||
|
if (!ok) {
|
||||||
|
if (!sc_aoa_unregister_hid(aoa, accessory_id)) {
|
||||||
|
LOGW("Could not unregister HID");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
sc_aoa_push_hid_event_with_ack_to_wait(struct sc_aoa *aoa,
|
sc_aoa_push_hid_event_with_ack_to_wait(struct sc_aoa *aoa,
|
||||||
const struct sc_hid_event *event,
|
const struct sc_hid_event *event,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user