1 /* RetroArch - A frontend for libretro. 2 * 3 * RetroArch is free software: you can redistribute it and/or modify it under the terms 4 * of the GNU General Public License as published by the Free Software Found- 5 * ation, either version 3 of the License, or (at your option) any later version. 6 * 7 * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 * PURPOSE. See the GNU General Public License for more details. 10 * 11 * You should have received a copy of the GNU General Public License along with RetroArch. 12 * If not, see <http://www.gnu.org/licenses/>. 13 */ 14 15 #ifndef __BLUETOOTH_DRIVER__H 16 #define __BLUETOOTH_DRIVER__H 17 18 #include <stdint.h> 19 20 #include <boolean.h> 21 #include <retro_common_api.h> 22 #include <lists/string_list.h> 23 24 RETRO_BEGIN_DECLS 25 26 enum rarch_bluetooth_ctl_state 27 { 28 RARCH_BLUETOOTH_CTL_NONE = 0, 29 RARCH_BLUETOOTH_CTL_DESTROY, 30 RARCH_BLUETOOTH_CTL_DEINIT, 31 RARCH_BLUETOOTH_CTL_FIND_DRIVER, 32 RARCH_BLUETOOTH_CTL_INIT 33 }; 34 35 typedef struct bluetooth_driver 36 { 37 void *(*init)(void); 38 39 void (*free)(void *data); 40 41 void (*scan)(void *data); 42 void (*get_devices)(void *data, struct string_list *list); 43 bool (*device_is_connected)(void *data, unsigned i); 44 void (*device_get_sublabel)(void *data, char *s, unsigned i, size_t len); 45 bool (*connect_device)(void *data, unsigned i); 46 47 const char *ident; 48 } bluetooth_driver_t; 49 50 extern bluetooth_driver_t bluetooth_bluetoothctl; 51 extern bluetooth_driver_t bluetooth_bluez; 52 53 /** 54 * config_get_bluetooth_driver_options: 55 * 56 * Get an enumerated list of all bluetooth driver names, 57 * separated by '|'. 58 * 59 * Returns: string listing of all bluetooth driver names, 60 * separated by '|'. 61 **/ 62 const char* config_get_bluetooth_driver_options(void); 63 64 void driver_bluetooth_scan(void); 65 66 void driver_bluetooth_get_devices(struct string_list *list); 67 68 bool driver_bluetooth_device_is_connected(unsigned i); 69 70 void driver_bluetooth_device_get_sublabel(char *s, unsigned i, size_t len); 71 72 bool driver_bluetooth_connect_device(unsigned i); 73 74 bool bluetooth_driver_ctl(enum rarch_bluetooth_ctl_state state, void *data); 75 76 RETRO_END_DECLS 77 78 #endif 79