2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "bluetooth-api.h"
21 #include "bt-internal-types.h"
23 #include "bt-common.h"
24 #include "bt-request-sender.h"
25 #include "bt-event-handler.h"
27 /* Avoid the build error related to vconf.h's dependency */
28 #ifndef VCONFKEY_BATTERY_MONITOR_STATUS
29 #define VCONFKEY_BATTERY_MONITOR_STATUS "db/bluetooth/bmstatus"
37 } bt_battery_monitor_state_t;
39 static int battery_monitor_state = BT_MONITOR_NONE;
41 static int __bt_fill_device_list(GArray *out_param2, GPtrArray **dev_list)
45 bluetooth_device_info_t *info;
47 BT_CHECK_PARAMETER(out_param2, return);
48 BT_CHECK_PARAMETER(dev_list, return);
50 size = out_param2->len;
53 BT_ERR("No bonded device");
54 return BLUETOOTH_ERROR_NONE;
57 size = (out_param2->len) / sizeof(bluetooth_device_info_t);
59 for (i = 0; i < size; i++) {
60 bluetooth_device_info_t *dev_info = NULL;
62 info = &g_array_index(out_param2,
63 bluetooth_device_info_t, i);
65 dev_info = g_memdup(info, sizeof(bluetooth_device_info_t));
68 g_ptr_array_add(*dev_list, (gpointer)dev_info);
71 return BLUETOOTH_ERROR_NONE;
74 BT_EXPORT_API int bluetooth_check_adapter(void)
76 int value = VCONFKEY_BT_STATUS_OFF;
78 #ifndef TIZEN_TEST_EMUL
81 ret = _bt_get_adapter_path(_bt_get_system_private_conn(), NULL);
83 if (ret != BLUETOOTH_ERROR_NONE)
84 return BLUETOOTH_ADAPTER_DISABLED;
87 /* check VCONFKEY_BT_STATUS */
88 if (vconf_get_int(VCONFKEY_BT_STATUS, &value) != 0) {
89 BT_ERR("fail to get vconf key!");
90 return BLUETOOTH_ADAPTER_DISABLED;
93 return value == VCONFKEY_BT_STATUS_OFF ? BLUETOOTH_ADAPTER_DISABLED :
94 BLUETOOTH_ADAPTER_ENABLED;
97 BT_EXPORT_API int bluetooth_enable_adapter(void)
101 BT_INFO_C("### Enable adapter");
102 _bt_print_api_caller_name();
103 retv_if(bluetooth_check_adapter() == BLUETOOTH_ADAPTER_ENABLED,
104 BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED);
106 #ifdef TIZEN_FEATURE_BT_DPM
107 retv_if(bluetooth_dpm_is_mode_allowed() == BLUETOOTH_ERROR_PERMISSION_DEINED,
108 BLUETOOTH_ERROR_PERMISSION_DEINED);
112 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
114 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_ENABLE_ADAPTER,
115 in_param1, in_param2, in_param3, in_param4, &out_param);
117 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
122 BT_EXPORT_API int bluetooth_set_battery_monitor_state(bool state)
124 if (vconf_set_bool(VCONFKEY_BATTERY_MONITOR_STATUS, state) != 0)
126 BT_ERR("vconf_set_bool failed");
127 return BLUETOOTH_ERROR_INTERNAL;
130 battery_monitor_state = (state == false) ? BT_MONITOR_OFF : BT_MONITOR_ON;
132 return BLUETOOTH_ERROR_NONE;
135 static void __bt_battery_monitor_status_changed_cb(keynode_t *node, void *data)
137 gboolean status = FALSE;
140 type = vconf_keynode_get_type(node);
141 if (type == VCONF_TYPE_BOOL) {
142 status = vconf_keynode_get_bool(node);
144 BT_DBG("Update the monitor state to %d", status);
146 battery_monitor_state = (status == FALSE) ? BT_MONITOR_OFF : BT_MONITOR_ON;
148 BT_ERR("Invaild vconf key type : %d", type);
153 void _bt_reset_battery_monitor_info(void)
155 vconf_ignore_key_changed(VCONFKEY_BATTERY_MONITOR_STATUS,
156 (vconf_callback_fn)__bt_battery_monitor_status_changed_cb);
158 _bt_rfcomm_server_reset_timer();
159 _bt_rfcomm_client_reset_timer();
161 battery_monitor_state = BT_MONITOR_NONE;
164 BT_EXPORT_API int bluetooth_get_battery_monitor_state()
168 if (battery_monitor_state != BT_MONITOR_NONE)
169 return battery_monitor_state;
171 if (vconf_get_bool(VCONFKEY_BATTERY_MONITOR_STATUS, &state) != 0)
172 BT_ERR("vconf_get_bool failed");
174 battery_monitor_state = state;
176 if (vconf_notify_key_changed(VCONFKEY_BATTERY_MONITOR_STATUS,
177 (vconf_callback_fn)__bt_battery_monitor_status_changed_cb, NULL) < 0)
178 BT_ERR("Unable to register key handler");
183 BT_EXPORT_API int bluetooth_read_battery_data(bt_battery_data *data)
186 bt_battery_dbus_data_t *info = NULL;
188 BT_CHECK_PARAMETER(data, return);
190 retv_if(bluetooth_check_adapter() != BLUETOOTH_ADAPTER_ENABLED,
191 BLUETOOTH_ADAPTER_DISABLED);
193 retv_if(bluetooth_get_battery_monitor_state() == FALSE,
194 BLUETOOTH_ERROR_NOT_SUPPORT);
196 #ifdef TIZEN_FEATURE_BT_DPM
197 retv_if(bluetooth_dpm_is_mode_allowed() == BLUETOOTH_ERROR_PERMISSION_DEINED,
198 BLUETOOTH_ERROR_PERMISSION_DEINED);
202 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
204 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_BATTERY_READ_DATA,
205 in_param1, in_param2, in_param3, in_param4, &out_param);
207 if (result != BLUETOOTH_ERROR_NONE) {
208 BT_ERR("Error encountered");
209 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
213 info = &g_array_index(out_param, bt_battery_dbus_data_t, 0);
215 data->session_start_time = info->session_start_time;
216 data->session_end_time = info->session_end_time;
217 data->session_scan_time = info->session_scan_time;
218 data->session_connected_time = info->session_connected_time;
219 data->tx_time = info->tx_time;
220 data->rx_time = info->rx_time;
221 data->idle_time = info->idle_time;
222 data->atm_list = NULL;
224 BT_DBG("Received battery data in bt-api: %ld %ld %d %d.",
225 data->session_start_time, data->session_end_time,
226 data->session_scan_time, data->session_connected_time);
228 /*Copying app wise details*/
229 int n = NUM_APP_MAX < info->num_app ? NUM_APP_MAX : info->num_app; //Maximum NUM_APP_MAX details will be fetched
231 for (int i = 0; i < n; i++) {
232 bt_battery_app_data *app_data = NULL;
233 app_data = g_malloc0(sizeof(bt_battery_app_data));
234 memcpy(app_data, &(info->app_data[i]), sizeof(bt_battery_app_data));
235 data->atm_list = g_slist_append(data->atm_list, app_data);
238 if (data->atm_list == NULL) {
239 BT_DBG("No app data transaction in this session");
240 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
244 BT_DBG("App-wise data transaction details:");
245 for (GSList *l = data->atm_list; l != NULL; l = g_slist_next(l)) {
246 bt_battery_app_data *t = (bt_battery_app_data *)(l->data);
247 BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
250 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
255 BT_EXPORT_API int bluetooth_disable_adapter(void)
259 BT_INFO_C("### Disable adapter");
260 _bt_print_api_caller_name();
261 BT_CHECK_ENABLED(return);
264 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
266 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_DISABLE_ADAPTER,
267 in_param1, in_param2, in_param3, in_param4, &out_param);
269 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
274 BT_EXPORT_API int bluetooth_recover_adapter(void)
278 BT_INFO_C("### Recover adapter");
279 BT_CHECK_ENABLED(return);
282 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
284 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_RECOVER_ADAPTER,
285 in_param1, in_param2, in_param3, in_param4, &out_param);
287 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
292 BT_EXPORT_API int bluetooth_reset_adapter(void)
298 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
300 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_RESET_ADAPTER,
301 in_param1, in_param2, in_param3, in_param4, &out_param);
303 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
308 BT_EXPORT_API int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
312 BT_CHECK_PARAMETER(local_address, return);
313 BT_CHECK_ENABLED_ANY(return);
316 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
318 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_LOCAL_ADDRESS,
319 in_param1, in_param2, in_param3, in_param4, &out_param);
321 if (result == BLUETOOTH_ERROR_NONE) {
322 *local_address = g_array_index(out_param,
323 bluetooth_device_address_t, 0);
326 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
331 BT_EXPORT_API int bluetooth_get_local_version(bluetooth_version_t *local_version)
335 BT_CHECK_PARAMETER(local_version, return);
336 BT_CHECK_ENABLED_ANY(return);
339 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
341 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_LOCAL_VERSION,
342 in_param1, in_param2, in_param3, in_param4, &out_param);
344 if (result == BLUETOOTH_ERROR_NONE)
345 *local_version = g_array_index(out_param, bluetooth_version_t, 0);
347 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
352 BT_EXPORT_API int bluetooth_get_local_name(bluetooth_device_name_t *local_name)
356 BT_CHECK_PARAMETER(local_name, return);
357 BT_CHECK_ENABLED_ANY(return);
360 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
362 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_LOCAL_NAME,
363 in_param1, in_param2, in_param3, in_param4, &out_param);
365 if (result == BLUETOOTH_ERROR_NONE) {
366 *local_name = g_array_index(out_param,
367 bluetooth_device_name_t, 0);
370 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
375 BT_EXPORT_API int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
379 BT_CHECK_PARAMETER(local_name, return);
380 BT_CHECK_ENABLED_ANY(return);
383 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
385 g_array_append_vals(in_param1, local_name, sizeof(bluetooth_device_name_t));
387 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_LOCAL_NAME,
388 in_param1, in_param2, in_param3, in_param4, &out_param);
390 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
395 BT_EXPORT_API int bluetooth_is_service_used(const char *service_uuid,
399 char uuid[BLUETOOTH_UUID_STRING_MAX];
401 BT_CHECK_PARAMETER(service_uuid, return);
402 BT_CHECK_PARAMETER(used, return);
403 BT_CHECK_ENABLED(return);
406 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
408 g_strlcpy(uuid, service_uuid, sizeof(uuid));
409 g_array_append_vals(in_param1, uuid, BLUETOOTH_UUID_STRING_MAX);
411 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_SERVICE_USED,
412 in_param1, in_param2, in_param3, in_param4, &out_param);
414 if (result == BLUETOOTH_ERROR_NONE)
415 *used = g_array_index(out_param, gboolean, 0);
417 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
422 BT_EXPORT_API int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *
423 discoverable_mode_ptr)
427 BT_CHECK_PARAMETER(discoverable_mode_ptr, return);
429 if (!TIZEN_PROFILE_WEARABLE) {
431 /* Requirement in OSP */
432 if (bluetooth_check_adapter() == BLUETOOTH_ADAPTER_DISABLED) {
433 if (vconf_get_int(BT_FILE_VISIBLE_TIME, &timeout) != 0) {
434 BT_ERR("Fail to get the timeout value");
435 return BLUETOOTH_ERROR_DEVICE_NOT_ENABLED;
439 *discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE;
441 *discoverable_mode_ptr = BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE;
443 return BLUETOOTH_ERROR_NONE;
446 BT_CHECK_ENABLED(return);
450 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
452 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_DISCOVERABLE_MODE,
453 in_param1, in_param2, in_param3, in_param4, &out_param);
455 if (result == BLUETOOTH_ERROR_NONE)
456 *discoverable_mode_ptr = g_array_index(out_param, int, 0);
458 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
463 BT_EXPORT_API int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
468 BT_CHECK_ENABLED(return);
471 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
473 g_array_append_vals(in_param1, &discoverable_mode, sizeof(int));
474 g_array_append_vals(in_param2, &timeout, sizeof(int));
476 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_DISCOVERABLE_MODE,
477 in_param1, in_param2, in_param3, in_param4, &out_param);
479 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
484 BT_EXPORT_API int bluetooth_get_timeout_value(int *timeout)
488 BT_CHECK_PARAMETER(timeout, return);
489 BT_CHECK_ENABLED(return);
492 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
494 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_DISCOVERABLE_TIME,
495 in_param1, in_param2, in_param3, in_param4, &out_param);
497 if (result == BLUETOOTH_ERROR_NONE)
498 *timeout = g_array_index(out_param, int, 0);
500 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
505 BT_EXPORT_API int bluetooth_start_discovery(unsigned short max_response,
506 unsigned short discovery_duration,
507 unsigned int classOfDeviceMask)
510 uid_t uid = getuid();
512 BT_CHECK_ENABLED(return);
515 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
517 g_array_append_vals(in_param1, &max_response, sizeof(unsigned short));
518 g_array_append_vals(in_param2, &discovery_duration, sizeof(unsigned short));
519 g_array_append_vals(in_param3, &classOfDeviceMask, sizeof(unsigned int));
520 g_array_append_vals(in_param4, &uid, sizeof(uid_t));
522 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_START_DISCOVERY,
523 in_param1, in_param2, in_param3, in_param4, &out_param);
525 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
530 BT_EXPORT_API int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
531 unsigned short max_response,
532 unsigned short discovery_duration,
533 unsigned int classOfDeviceMask)
537 if (role == DISCOVERY_ROLE_LE)
538 BT_CHECK_ENABLED_LE(return);
540 BT_CHECK_ENABLED(return);
543 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
545 g_array_append_vals(in_param1, &role, sizeof(bt_discovery_role_type_t));
546 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_START_CUSTOM_DISCOVERY,
547 in_param1, in_param2, in_param3, in_param4, &out_param);
549 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
554 BT_EXPORT_API int bluetooth_cancel_discovery(void)
558 BT_CHECK_ENABLED(return);
561 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
563 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_CANCEL_DISCOVERY,
564 in_param1, in_param2, in_param3, in_param4, &out_param);
567 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
572 BT_EXPORT_API int bluetooth_is_discovering(void)
575 int is_discovering = FALSE;
577 BT_CHECK_ENABLED(return);
580 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
582 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_DISCOVERYING,
583 in_param1, in_param2, in_param3, in_param4, &out_param);
585 if (result == BLUETOOTH_ERROR_NONE) {
586 is_discovering = g_array_index(out_param,
589 BT_ERR("Fail to send request");
590 is_discovering = result;
593 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
595 return is_discovering;
598 BT_EXPORT_API int bluetooth_is_connectable(gboolean *is_connectable)
602 BT_CHECK_ENABLED_ANY(return);
605 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
607 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_CONNECTABLE,
608 in_param1, in_param2, in_param3, in_param4, &out_param);
610 if (result == BLUETOOTH_ERROR_NONE)
611 *is_connectable = g_array_index(out_param, int, 0);
613 BT_ERR("Fail to send request");
615 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
620 BT_EXPORT_API int bluetooth_set_connectable(gboolean is_connectable)
624 BT_CHECK_ENABLED_ANY(return);
627 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
629 g_array_append_vals(in_param1, &is_connectable, sizeof(gboolean));
631 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_CONNECTABLE,
632 in_param1, in_param2, in_param3, in_param4, &out_param);
634 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
639 BT_EXPORT_API int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
643 BT_CHECK_PARAMETER(dev_list, return);
644 BT_CHECK_ENABLED(return);
647 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
649 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_BONDED_DEVICES,
650 in_param1, in_param2, in_param3, in_param4, &out_param);
652 if (result == BLUETOOTH_ERROR_NONE)
653 result = __bt_fill_device_list(out_param, dev_list);
655 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
660 BT_EXPORT_API int bluetooth_get_profile_connected_device_list(
661 const char *profile_uuid, GPtrArray **addr_list)
663 char uuid[BLUETOOTH_UUID_STRING_MAX];
668 BT_CHECK_PARAMETER(profile_uuid, return);
669 BT_CHECK_PARAMETER(addr_list, return);
670 BT_CHECK_ENABLED(return);
673 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
675 g_strlcpy(uuid, profile_uuid, sizeof(uuid));
676 g_array_append_vals(in_param1, uuid, BLUETOOTH_UUID_STRING_MAX);
678 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_GET_PROFILE_CONNECTED_DEVICES,
679 in_param1, in_param2, in_param3, in_param4, &out_param);
681 if (result == BLUETOOTH_ERROR_NONE) {
682 if (out_param == NULL) {
683 BT_ERR("out_param is NULL");
684 result = BLUETOOTH_ERROR_INTERNAL;
686 size = (out_param->len) / sizeof(bluetooth_device_address_t);
689 BT_ERR("No connected device");
690 result = BLUETOOTH_ERROR_NOT_CONNECTED;
693 for (i = 0; i < size; i++) {
694 bluetooth_device_address_t *addr = NULL;
695 bluetooth_device_address_t *ptr = NULL;
697 ptr = &g_array_index(out_param,
698 bluetooth_device_address_t, i);
700 addr = g_memdup(ptr, sizeof(bluetooth_device_address_t));
703 g_ptr_array_add(*addr_list, (gpointer)addr);
708 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
713 BT_EXPORT_API int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value)
717 BT_CHECK_PARAMETER(value, return);
718 BT_CHECK_ENABLED_ANY(return);
720 if (value->data_len > BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX)
721 return BLUETOOTH_ERROR_INVALID_PARAM;
724 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
726 g_array_append_vals(in_param1, value, sizeof(bluetooth_manufacturer_data_t));
728 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_MANUFACTURER_DATA,
729 in_param1, in_param2, in_param3, in_param4, &out_param);
731 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
736 BT_EXPORT_API int bluetooth_set_passkey_notification(gboolean enable)
740 BT_CHECK_ENABLED_ANY(return);
743 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
745 g_array_append_vals(in_param1, &enable, sizeof(gboolean));
747 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_SET_PASSKEY_NOTIFICATION,
748 in_param1, in_param2, in_param3, in_param4, &out_param);
750 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);