7 #include <hal/hal-bluetooth-interface.h>
10 #define LOG_TAG "HALAPI_BLUETOOTH"
12 #define EXPORT __attribute__ ((visibility("default")))
14 static int bluetooth_tm1_start(void)
17 ret = system("/hal/etc/bluetooth/bt-dev-start.sh");
19 LOGE("script internal failed");
20 return HAL_BACKEND_ERROR_INTERNAL;
21 } else if (ret == 0x200) {
22 LOGE("script timeout failed");
23 return HAL_BACKEND_ERROR_TIMEOUT;
25 LOGD("script started successfully");
26 return HAL_BACKEND_ERROR_NONE;
29 static int bluetooth_tm1_stop(void)
32 ret = system("/hal/etc/bluetooth/bt-dev-end.sh");
34 LOGE("script internal failed");
35 return HAL_BACKEND_ERROR_INTERNAL;
36 } else if (ret == 0x200) {
37 LOGE("script timeout failed");
38 return HAL_BACKEND_ERROR_TIMEOUT;
40 LOGD("script started successfully");
41 return HAL_BACKEND_ERROR_NONE;
44 static int bluetooth_tm1_init(void **data)
46 hal_backend_bluetooth_funcs *bluetooth_funcs;
48 bluetooth_funcs = calloc(1, sizeof(hal_backend_bluetooth_funcs));
52 bluetooth_funcs->start = bluetooth_tm1_start;
53 bluetooth_funcs->stop = bluetooth_tm1_stop;
55 *data = (void *)bluetooth_funcs;
60 static int bluetooth_tm1_exit(void *data)
69 hal_backend EXPORT hal_backend_bluetooth_data = {
70 .name = "bluetooth-spreadtrum",
71 .vendor = "Spreadtrum",
72 .abi_version = HAL_ABI_VERSION_TIZEN_6_5,
73 .init = bluetooth_tm1_init,
74 .exit = bluetooth_tm1_exit,