7 #include <hal/hal-bluetooth-interface.h>
10 #define LOG_TAG "HALAPI_BLUETOOTH"
12 #define EXPORT __attribute__ ((visibility("default")))
14 static int bluetooth_bcm_start(void)
17 ret = system("/usr/etc/bluetooth/bt-stack-up.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_bcm_stop(void)
32 ret = system("/usr/etc/bluetooth/bt-stack-down.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_bcm_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_bcm_start;
53 bluetooth_funcs->stop = bluetooth_bcm_stop;
55 *data = (void *)bluetooth_funcs;
60 static int bluetooth_bcm_exit(void *data)
69 hal_backend EXPORT hal_backend_bluetooth_data = {
72 .abi_version = HAL_ABI_VERSION_TIZEN_6_5,
73 .init = bluetooth_bcm_init,
74 .exit = bluetooth_bcm_exit,