4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Atul Kumar Rai <a.rai@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
27 #include <gio/gunixfdlist.h>
33 #include "bt-hal-hdp-dbus-handler.h"
34 #include "bt-hal-dbus-common-utils.h"
35 #include "bt-hal-internal.h"
36 #include "bt-hal-msg.h"
38 #define BT_HAL_HDP_MANAGER_INTERFACE "org.bluez.HealthManager1"
39 #define BT_HAL_HDP_DEVICE_INTERFACE "org.bluez.HealthDevice1"
40 #define BT_HAL_HDP_CHANNEL_INTERFACE "org.bluez.HealthChannel1"
41 #define BT_HAL_HDP_CHANNEL_ID_MAX 255
43 static GSList *app_list;
46 char address[BT_HAL_ADDRESS_STRING_SIZE];
59 static handle_stack_msg event_cb = NULL;
60 static int latest_id = -1;
61 static gboolean id_used[BT_HAL_HDP_CHANNEL_ID_MAX];
63 static void __hdp_send_conn_event(hdp_conn_info_t *conn_info, int state)
65 struct hal_ev_hdp_conn_state ev;
69 /* Prepare to send HDP app registration state event */
70 memset(&ev, 0, sizeof(ev));
71 ev.app_id = conn_info->app_id;
72 _bt_hal_convert_addr_string_to_type(ev.bdaddr, conn_info->address);
74 ev.channel_id = conn_info->channel_id;
75 ev.data_fd = conn_info->fd;
76 ev.channel_state = state;
78 ERR("HDP dbus handler callback not registered");
80 event_cb(HAL_EV_HDP_CONN_STATE, (void *)&ev, sizeof(ev));
85 int __hdp_assign_channel_id(void)
89 DBG("latest_id: %d", latest_id);
91 index = latest_id + 1;
92 if (index >= BT_HAL_HDP_CHANNEL_ID_MAX)
95 DBG("index: %d", index);
97 while (id_used[index] == TRUE) {
98 if (index == latest_id) {
100 ERR("All request ID is used");
105 if (index >= BT_HAL_HDP_CHANNEL_ID_MAX)
110 id_used[index] = TRUE;
111 DBG("Assigned Id: %d", latest_id);
116 void __hdp_delete_channnel_id(int id)
118 if (id >= BT_HAL_HDP_CHANNEL_ID_MAX || id < 0) {
119 ERR("Invalid id %d", id);
125 DBG("id: %d, latest_id: %d", id, latest_id);
128 static hdp_app_data_t *__get_hdp_app_by_id(int id)
132 for (l = app_list; l != NULL; l = l->next) {
133 hdp_app_data_t *app = l->data;
134 if (app && app->id == id)
141 static hdp_app_data_t *__get_hdp_app_by_path(char *app_path)
148 for (l = app_list; l != NULL; l = l->next) {
149 hdp_app_data_t *app = l->data;
150 if (app && 0 == g_strcmp0(app->path, app_path))
157 static hdp_conn_info_t *__hdp_find_conn_info_by_ch_path(const char *channel_path)
165 for (l = app_list; l != NULL; l = l->next) {
166 hdp_app_data_t *app = l->data;
170 for (l1 = app->conn_list; l1 != NULL; l1 = l1->next) {
171 hdp_conn_info_t *info = l1->data;
172 if (info && 0 == g_strcmp0(info->obj_path, channel_path))
180 static hdp_conn_info_t *__hdp_find_conn_info_by_ch_id(int channel_id)
185 for (l = app_list; l != NULL; l = l->next) {
186 hdp_app_data_t *app = l->data;
190 for (l1 = app->conn_list; l1 != NULL; l1 = l1->next) {
191 hdp_conn_info_t *info = l1->data;
192 if (info && info->channel_id == channel_id)
200 static hdp_conn_info_t *__hdp_app_create_incomming_conn_info(const char *path)
202 hdp_conn_info_t *conn_info = NULL;
204 GDBusConnection *conn;
206 GVariantIter *property_iter;
207 const char *property;
208 GVariant *value = NULL;
213 char *app_path = NULL;
214 char *type_qos = NULL;
219 conn = _bt_hal_get_system_gconn();
221 ERR("_bt_hal_get_system_gconn returned NULL, return");
225 /* Retrive device info */
226 proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
230 BT_HAL_PROPERTIES_INTERFACE,
233 ERR("Unable to create proxy: %s", err->message);
238 dev_path = g_strdup(BT_HAL_HDP_CHANNEL_INTERFACE);
239 reply = g_dbus_proxy_call_sync(proxy, "GetAll",
240 g_variant_new("(s)", dev_path),
241 G_DBUS_CALL_FLAGS_NONE,
244 g_object_unref(proxy);
246 ERR(" HDP:dbus Can't get the reply");
248 ERR("%s", err->message);;
254 g_variant_get(reply, "(a{sv})", &property_iter);
255 while (g_variant_iter_loop(property_iter, "{sv}", &property, &value)) {
256 DBG("String received = %s\n", property);
257 if (g_strcmp0("Type", property) == 0)
258 type_qos = g_variant_dup_string(value, &len);
259 else if (g_strcmp0("Device", property) == 0)
260 device = g_variant_dup_string(value, &len);
261 else if (g_strcmp0("Application", property) == 0)
262 app_path = g_variant_dup_string(value, &len);
265 DBG("QOS = %s, Device = %s, Apphandler = %s", type_qos, device, app_path);
266 g_variant_iter_free(property_iter);
267 g_variant_unref(reply);
270 if (!type_qos || !app_path) {
271 ERR("Pasing failed");
275 app = __get_hdp_app_by_path(app_path);
277 ERR("Could not find the app with path: %s", app_path);
281 conn_info = g_new0(hdp_conn_info_t, 1);
282 conn_info->channel_id = __hdp_assign_channel_id();
283 _bt_hal_convert_device_path_to_address(path, conn_info->address);
284 conn_info->app_id = app->id;
287 DBG("App Id: %d, remote_address: %s", app->id, conn_info->address);
288 app->conn_list = g_slist_append(app->conn_list, conn_info);
298 static void __hdp_free_conn_info(hdp_conn_info_t *conn_info)
303 ERR("conn_info is NULL");
307 __hdp_delete_channnel_id(conn_info->channel_id);
308 if (0 < conn_info->fd)
309 close(conn_info->fd);
310 g_free(conn_info->obj_path);
316 static void __hdp_free_app_data(hdp_app_data_t *app)
320 g_slist_foreach(app->conn_list, (GFunc)__hdp_free_conn_info, NULL);
321 g_free(app->conn_list);
328 static int __hdp_acquire_fd(const char *path)
330 GDBusConnection *conn;
333 GUnixFDList *out_fd_list = NULL;
340 conn = _bt_hal_get_system_gconn();
342 ERR("_bt_hal_get_system_gconn returned NULL, return");
346 proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
350 BT_HAL_HDP_CHANNEL_INTERFACE,
353 ERR("Unable to create proxy: %s", err->message);
358 reply = g_dbus_proxy_call_with_unix_fd_list_sync(proxy,
360 NULL, G_DBUS_CALL_FLAGS_NONE,
361 -1, NULL, &out_fd_list,
363 g_object_unref(proxy);
365 ERR(" HDP:****** dbus Can't create application ****");
367 ERR("%s", err->message);;
374 g_variant_get(reply, "(h)", &index);
375 fd = g_unix_fd_list_get(out_fd_list, index, NULL);
377 INFO("File Descriptor = %d, Dev_path = %s \n", fd, path);
378 g_variant_unref(reply);
379 g_object_unref(out_fd_list);
385 static void __hdp_handle_connect(GVariant *parameters)
387 hdp_conn_info_t *conn_info = NULL;
388 const char *obj_channel_path;
393 g_variant_get(parameters, "(&o)", &obj_channel_path);
394 INFO("Channel connected, Path = %s", obj_channel_path);
396 conn_info = __hdp_find_conn_info_by_ch_path(obj_channel_path);
398 fd = __hdp_acquire_fd(obj_channel_path);
400 ERR("__hdp_acquire_fd failed");
405 INFO("conn_info not found, incomming connection request");
406 /* Create hdp app connection info */
407 conn_info = __hdp_app_create_incomming_conn_info(obj_channel_path);
409 ERR("Could not create app conn info");
416 conn_info->obj_path = g_strdup(obj_channel_path);
417 /* Send channel_connect callback with status: success */
418 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_CONNECTED);
424 hdp_app_data_t *app = __get_hdp_app_by_id(conn_info->app_id);
426 ERR("Outgoing connection failed for app_id:%d, send event", conn_info->app_id);
427 /* Send channel_connect callback with status: disconnected and fd = -1 */
429 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTED);
431 app->conn_list = g_slist_remove(app->conn_list, conn_info);
432 __hdp_free_conn_info(conn_info);
436 static void __hdp_handle_disconnect(GVariant *parameters,
437 const gchar *object_path)
439 const char *obj_channel_path;
441 hdp_conn_info_t *conn_info;
445 g_variant_get(parameters, "(&o)", &obj_channel_path);
446 INFO("Channel Deleted, Path = %s, channel_path: %s",
447 object_path, obj_channel_path);
449 conn_info = __hdp_find_conn_info_by_ch_path(obj_channel_path);
451 INFO("No conn_info found for channel path:%s", obj_channel_path);
455 /* Send channel_connect callback with status: success */
457 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DESTROYED);
459 app = __get_hdp_app_by_id(conn_info->app_id);
460 app->conn_list = g_slist_remove(app->conn_list, conn_info);
461 __hdp_free_conn_info(conn_info);
466 static void __hdp_handle_property_changed(GVariant *parameters)
468 char *property = NULL;
469 GVariant *value = NULL;
470 char *obj_main_channel_path = NULL;
471 GVariantIter *property_iter = NULL;
476 g_variant_get(parameters, "(a{sv})", &property_iter);
477 while (g_variant_iter_loop(property_iter, "{sv}", &property, &value)) {
478 if (g_strcmp0("MainChannel", property) == 0) {
479 INFO("Property MainChannel received");
480 obj_main_channel_path = g_variant_dup_string(value, &len);
481 DBG("Main Channel Path = %s", obj_main_channel_path);
485 g_variant_iter_free(property_iter);
487 g_variant_unref(value);
488 g_free(obj_main_channel_path);
493 static void __hdp_event_filter(GDBusConnection *connection,
494 const gchar *sender_name,
495 const gchar *object_path,
496 const gchar *interface_name,
497 const gchar *signal_name,
498 GVariant *parameters,
501 DBG("Path = %s", object_path);
502 if (object_path == NULL || g_strcmp0(object_path, "/") == 0)
505 if (signal_name == NULL)
508 if (strcasecmp(signal_name, "ChannelConnected") == 0)
509 __hdp_handle_connect(parameters);
511 else if (strcasecmp(signal_name, "ChannelDeleted") == 0)
512 __hdp_handle_disconnect(parameters, object_path);
514 else if (strcasecmp(signal_name, "PropertyChanged") == 0)
515 __hdp_handle_property_changed(parameters);
520 static int __hdp_filter_subscribe_signal(GDBusConnection *conn,
523 static guint subs_add_filter_id = 0;
526 return BT_HAL_ERROR_INVALID_PARAM;
529 if (subs_add_filter_id == 0) {
530 subs_add_filter_id = g_dbus_connection_signal_subscribe(
531 conn, NULL, BT_HAL_HDP_DEVICE_INTERFACE,
533 __hdp_event_filter, NULL, NULL);
535 INFO("Signal already subscribed");
538 if (subs_add_filter_id > 0) {
539 g_dbus_connection_signal_unsubscribe(conn,
541 subs_add_filter_id = 0;
545 return BT_HAL_ERROR_NONE;
548 static int __hdp_add_filter(void)
550 static GDBusConnection *hdp_conn;
554 hdp_conn = _bt_hal_get_system_gconn();
556 ERR("_bt_hal_get_system_gconn returned NULL, return");
557 return BT_HAL_ERROR_INTERNAL;
560 return __hdp_filter_subscribe_signal(hdp_conn, TRUE);
565 static int __hdp_remove_filter(void)
567 static GDBusConnection *hdp_conn;
571 hdp_conn = _bt_hal_get_system_gconn();
573 ERR("_bt_hal_get_system_gconn returned NULL, return");
574 return BT_HAL_ERROR_INTERNAL;
577 return __hdp_filter_subscribe_signal(hdp_conn, FALSE);
582 static void __hdp_send_app_reg_event(int app_id, unsigned int state)
584 struct hal_ev_hdp_app_reg_state ev;
588 /* Prepare to send HDP app registration state event */
589 memset(&ev, 0, sizeof(ev));
593 ERR("HDP dbus handler callback not registered");
595 event_cb(HAL_EV_HDP_APP_REG_STATE, (void *)&ev, sizeof(ev));
600 static gboolean __hdp_application_created_cb(gpointer data)
602 hdp_app_data_t *app = data;
606 ERR("__hdp_application_created_cb called with null app data");
610 app_list = g_slist_append(app_list, app);
611 if (BT_HAL_ERROR_NONE != __hdp_add_filter()) {
612 ERR("Funtion failed");
613 __hdp_send_app_reg_event(app->id, BTHL_APP_REG_STATE_REG_FAILED);
617 __hdp_send_app_reg_event(app->id, BTHL_APP_REG_STATE_REG_SUCCESS);
623 static gboolean __hdp_application_destroyed_cb(gpointer data)
625 hdp_app_data_t *app = data;
630 ERR("__hdp_application_destroyed_cb called with null app data");
634 app_list = g_slist_remove(app_list, app);
636 len = g_slist_length(app_list);
637 DBG("List length = %d\n", len);
639 __hdp_remove_filter();
641 __hdp_send_app_reg_event(app->id, BTHL_APP_REG_STATE_DEREG_SUCCESS);
642 __hdp_free_app_data(app);
648 static GDBusProxy *__get_health_device_proxy(char *address)
650 GDBusConnection *conn;
651 GDBusProxy *hdp_proxy;
658 adapter_path = _bt_hal_get_adapter_path();
660 ERR("Could not get adapter path");
664 dev_path = g_strdup_printf("%s/dev_%s", adapter_path, address);
666 ERR("Failed to create dev_path");
667 g_free(adapter_path);
671 g_strdelimit(dev_path, ":", '_');
672 DBG("dev_path: %s", dev_path);
674 conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
676 ERR("ERROR: Can't get on system bus [%s]", err->message);
682 hdp_proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
683 NULL, BT_HAL_BLUEZ_NAME,
684 dev_path, BT_HAL_HDP_DEVICE_INTERFACE,
687 ERR("Failed to get the HDP server proxy");
688 g_object_unref(conn);
695 static void __hdp_connect_request_cb(GDBusProxy *hdp_proxy,
696 GAsyncResult *res, gpointer user_data)
700 hdp_conn_info_t *conn_info = user_data;
702 char *obj_path = NULL;
706 reply = g_dbus_proxy_call_finish(hdp_proxy, res, &err);
707 g_object_unref(hdp_proxy);
710 ERR("HDP connection Dbus Call Error: %s", err->message);
713 /* Send channel_connect callback with status: disconnected and fd = -1 */
715 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTED);
716 __hdp_free_conn_info(conn_info);
720 g_variant_get(reply, "(&o)", &obj_path);
721 DBG("Obj Path returned = %s\n", obj_path);
722 conn_info->obj_path = g_strdup(obj_path);
724 app = __get_hdp_app_by_id(conn_info->app_id);
726 ERR("No app with app_id: %d exists");
727 __hdp_free_conn_info(conn_info);
731 app->conn_list = g_slist_append(app->conn_list, conn_info);
735 static void __hdp_disconnect_request_cb(GDBusProxy *hdp_proxy,
736 GAsyncResult *res, gpointer user_data)
738 hdp_conn_info_t *conn_info = user_data;
744 reply = g_dbus_proxy_call_finish(hdp_proxy, res, &err);
745 g_object_unref(hdp_proxy);
748 ERR("HDP disconnection Dbus Call Error: %s", err->message);
752 /* Send channel_connect callback with status: connected */
753 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_CONNECTED);
760 bt_status_t _bt_hal_dbus_handler_hdp_register_application(int role,
761 int data_type, int channel_type, const char *description, int *app_id)
763 GDBusConnection *conn;
764 GDBusProxy *proxy = NULL;
765 GVariantBuilder *builder;
766 const char *key_type;
769 GVariant *reply = NULL;
776 conn = _bt_hal_get_system_gconn();
778 ERR("_bt_hal_get_system_gconn returned NULL, return");
779 return BT_STATUS_FAIL;
782 proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
786 BT_HAL_HDP_MANAGER_INTERFACE,
789 ERR("Unable to create proxy: %s", err->message);
791 return BT_STATUS_FAIL;
794 builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
796 key_type = "DataType";
797 value = (guint16)data_type;
798 g_variant_builder_add(builder, "{sv}", key_type, g_variant_new("q", value));
801 svalue = (role == BTHL_MDEP_ROLE_SINK) ? "Sink" : "Source";
802 g_variant_builder_add(builder, "{sv}", key_type, g_variant_new("s", svalue));
804 key_type = "Description";
805 svalue = (description) ? description : "Health Device";
806 g_variant_builder_add(builder, "{sv}", key_type, g_variant_new("s", svalue));
808 if (role == BTHL_MDEP_ROLE_SOURCE) {
809 key_type = "ChannelType";
810 if (channel_type == BTHL_CHANNEL_TYPE_RELIABLE) {
812 DBG("%s : %s", key_type, svalue);
813 } else if (channel_type == BTHL_CHANNEL_TYPE_STREAMING) {
814 svalue = "streaming";
815 DBG("%s : %s", key_type, svalue);
817 g_variant_builder_unref(builder);
818 g_object_unref(proxy);
819 return BT_STATUS_PARM_INVALID;
822 g_variant_builder_add(builder, "{sv}", key_type, g_variant_new("s", svalue));
825 reply = g_dbus_proxy_call_sync(proxy, "CreateApplication",
826 g_variant_new("(a{sv})", builder),
827 G_DBUS_CALL_FLAGS_NONE, -1,
829 g_variant_builder_unref(builder);
830 g_object_unref(proxy);
832 ERR(" HDP:dbus Can't create application");
834 ERR("%s", err->message);
837 return BT_STATUS_FAIL;
840 g_variant_get(reply, "(&o)", &app_path);
841 DBG("Created health application: %s", (char *)app_path);
843 app = g_new0(hdp_app_data_t, 1);
844 app->path = g_strdup(app_path);
845 sscanf(app_path, "/org/bluez/health_app_%d", &(app->id));
846 app->channel_type = channel_type;
847 g_variant_unref(reply);
850 DBG("App Id: %d", *app_id);
852 g_idle_add(__hdp_application_created_cb, (gpointer)app);
854 return BT_STATUS_SUCCESS;
857 bt_status_t _bt_hal_dbus_handler_hdp_unregister_application(int app_id)
859 GDBusConnection *conn;
860 GDBusProxy *proxy = NULL;
861 GVariant *reply = NULL;
867 DBG("app_id: %d", app_id);
868 app = __get_hdp_app_by_id(app_id);
870 ERR("No app with app_id: %d exists");
871 return BT_STATUS_PARM_INVALID;
874 conn = _bt_hal_get_system_gconn();
876 ERR("_bt_hal_get_system_gconn returned NULL, return");
877 return BT_STATUS_FAIL;
880 proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
884 BT_HAL_HDP_MANAGER_INTERFACE,
888 ERR("Unable to create proxy: %s", err->message);
891 ERR("Unable to create proxy");
893 return BT_STATUS_FAIL;
896 DBG("app->path: %s", app->path);
897 reply = g_dbus_proxy_call_sync(proxy, "DestroyApplication",
898 g_variant_new("(o)", app->path),
899 G_DBUS_CALL_FLAGS_NONE,
901 g_object_unref(proxy);
903 ERR(" HDP:dbus Can't Destroy application");
905 ERR("%s", err->message);
908 return BT_STATUS_FAIL;
911 g_variant_unref(reply);
912 DBG("Destroyed health application: %s", (char *)app->path);
913 g_idle_add(__hdp_application_destroyed_cb, (gpointer)app);
916 return BT_STATUS_SUCCESS;
919 bt_status_t _bt_hal_dbus_handler_hdp_connect_channel(int app_id, bt_bdaddr_t *bd_addr, int *channel_id)
921 GDBusProxy *hdp_proxy;
923 hdp_conn_info_t *conn_info;
925 char address[BT_HAL_ADDRESS_STRING_SIZE];
930 ERR("Address is NULL");
931 return BT_STATUS_PARM_INVALID;
934 _bt_hal_convert_addr_type_to_string(address, bd_addr->address);
937 ERR("channel_id is NULL");
938 return BT_STATUS_PARM_INVALID;
941 app = __get_hdp_app_by_id(app_id);
943 ERR("No app with app_id: %d exists", app_id);
944 return BT_STATUS_PARM_INVALID;
947 if (BTHL_CHANNEL_TYPE_RELIABLE == app->channel_type)
948 ch_type = "Reliable";
949 else if (BTHL_CHANNEL_TYPE_STREAMING == app->channel_type)
950 ch_type = "Streaming";
954 DBG("create conection to %s, channel_type: %s", address, ch_type);
956 hdp_proxy = __get_health_device_proxy(address);
958 ERR("Failed to get the health device proxy");
959 return BT_STATUS_FAIL;
962 DBG("app path %s", app->path);
964 *channel_id = __hdp_assign_channel_id();
965 conn_info = g_new0(hdp_conn_info_t, 1);
966 conn_info->app_id = app->id;
967 g_strlcpy(conn_info->address, address, BT_HAL_ADDRESS_STRING_SIZE);
968 conn_info->channel_id = *channel_id;
971 g_dbus_proxy_call(hdp_proxy, "CreateChannel",
972 g_variant_new("(os)", app->path, ch_type),
973 G_DBUS_CALL_FLAGS_NONE, -1, NULL,
974 (GAsyncReadyCallback)__hdp_connect_request_cb,
977 /* Send channel_connect callback with status: connecting and fd = -1 */
978 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_CONNECTING);
981 return BT_STATUS_SUCCESS;
984 bt_status_t _bt_hal_dbus_handler_hdp_destroy_channel(int channel_id)
986 GDBusProxy *hdp_proxy;
987 hdp_conn_info_t *conn_info;
991 conn_info = __hdp_find_conn_info_by_ch_id(channel_id);
993 ERR("No conn found with channel_id: %d", channel_id);
994 return BT_STATUS_PARM_INVALID;
997 DBG("Destroy channel with channel_id: %d, remote_addr: %s, obj_path: %s",
998 channel_id, conn_info->address, conn_info->obj_path);
1000 hdp_proxy = __get_health_device_proxy(conn_info->address);
1002 ERR("Failed to get the health device proxy");
1003 return BT_STATUS_FAIL;
1006 g_dbus_proxy_call(hdp_proxy, "DestroyChannel",
1007 g_variant_new("(o)", conn_info->obj_path),
1008 G_DBUS_CALL_FLAGS_NONE, -1, NULL,
1009 (GAsyncReadyCallback)__hdp_disconnect_request_cb,
1012 /* Send channel_connect callback with status: connecting and fd = -1 */
1013 __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTING);
1016 return BT_STATUS_SUCCESS;
1019 /* To send stack event to hal-hidhost handler */
1020 void _bt_hal_register_hdp_dbus_handler_cb(handle_stack_msg cb)
1025 /* To send stack event to hal-hidhost handler */
1026 void _bt_hal_unregister_hdp_dbus_handler_cb()