mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-25 14:09:10 +00:00
Build hidapi code into SDL as a new public API
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
This commit is contained in:
parent
94c1276a5f
commit
5b646cd19e
35 changed files with 798 additions and 633 deletions
|
@ -22,6 +22,27 @@
|
|||
//
|
||||
// This layer glues the hidapi API to Android's USB and BLE stack.
|
||||
|
||||
#ifndef SDL_DISABLE_HIDAPI
|
||||
|
||||
#define hid_init PLATFORM_hid_init
|
||||
#define hid_exit PLATFORM_hid_exit
|
||||
#define hid_enumerate PLATFORM_hid_enumerate
|
||||
#define hid_free_enumeration PLATFORM_hid_free_enumeration
|
||||
#define hid_open PLATFORM_hid_open
|
||||
#define hid_open_path PLATFORM_hid_open_path
|
||||
#define hid_write PLATFORM_hid_write
|
||||
#define hid_read_timeout PLATFORM_hid_read_timeout
|
||||
#define hid_read PLATFORM_hid_read
|
||||
#define hid_set_nonblocking PLATFORM_hid_set_nonblocking
|
||||
#define hid_send_feature_report PLATFORM_hid_send_feature_report
|
||||
#define hid_get_feature_report PLATFORM_hid_get_feature_report
|
||||
#define hid_close PLATFORM_hid_close
|
||||
#define hid_get_manufacturer_string PLATFORM_hid_get_manufacturer_string
|
||||
#define hid_get_product_string PLATFORM_hid_get_product_string
|
||||
#define hid_get_serial_number_string PLATFORM_hid_get_serial_number_string
|
||||
#define hid_get_indexed_string PLATFORM_hid_get_indexed_string
|
||||
#define hid_error PLATFORM_hid_error
|
||||
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
#include <pthread.h>
|
||||
|
@ -1264,3 +1285,5 @@ int hid_exit(void)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif /* SDL_DISABLE_HIDAPI */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue