#include "bt-hal-gatt-server.h"
#include "bt-hal-gatt-client.h"
#include "bt-hal-adapter-dbus-handler.h"
+#include "bt-hal-l2cap-le-dbus-handler.h"
#include "bt-hal-tds.h"
#include "bt-internal-types.h"
else
__bt_hal_send_device_le_connection_state_event(BT_STATUS_SUCCESS, TRUE, address);
g_free(address);
+ } else if (strcasecmp(member, "ConnectionFail") == 0) {
+ DBG("Received Connection failed error");
+ DBG("path : %s", path);
+ l2cap_le_cb_data_t *info;
+ l2cap_le_conn_info_t *conn_info;
+ char *info_path;
+ int res = -1;
+ g_variant_get(msg, "(s)", &info_path);
+
+ if (NULL != info_path) {
+ info = __find_l2cap_le_client_info_from_path(info_path);
+ if (info != NULL) {
+ conn_info = info->conn_info;
+ if (write(conn_info->hal_fd, &res, sizeof(res)) != sizeof(res)) {
+ ERR("Error Sending l2cap_le connection result");
+ }
+ __l2cap_le_cb_data_remove(info);
+ } else
+ ERR("info is NULL");
+ } else
+ ERR("info_path is NULL");
} else if (strcasecmp(member, "Disconnected") == 0) {
unsigned char disc_reason = 0;
unsigned char addr_type = 0;
#define L2CAP_LE_UUID_SUBSTR "FFFFFFFF-FFFF-FFFF-FFFF-"
typedef struct {
- char remote_addr[BT_HAL_ADDRESS_STRING_SIZE];
- int hal_fd;
- unsigned int hal_watch;
- int stack_fd;
- unsigned int bt_watch;
-} l2cap_le_conn_info_t;
-
-typedef struct {
- int psm;
- char *device_path;
- char *obj_path;
- int object_id;
- int id;
- l2cap_le_conn_info_t *conn_info;
-} l2cap_le_cb_data_t;
-
-typedef struct {
int psm;
char *obj_path;
int object_id;
}
/*************************** L2CAP_LE Client Implementation ***************************/
-static l2cap_le_cb_data_t *__find_l2cap_le_client_info_from_path(const char *path)
+l2cap_le_cb_data_t *__find_l2cap_le_client_info_from_path(const char *path)
{
GSList *l;
DBG("-");
}
-static void __l2cap_le_cb_data_remove(l2cap_le_cb_data_t *info)
+void __l2cap_le_cb_data_remove(l2cap_le_cb_data_t *info)
{
if (!info) {
ERR("info is NULL");
extern "C" {
#endif
+typedef struct {
+ char remote_addr[18];
+ int hal_fd;
+ unsigned int hal_watch;
+ int stack_fd;
+ unsigned int bt_watch;
+} l2cap_le_conn_info_t;
+
+typedef struct {
+ int psm;
+ char *device_path;
+ char *obj_path;
+ int object_id;
+ int id;
+ l2cap_le_conn_info_t *conn_info;
+} l2cap_le_cb_data_t;
+
int _bt_hal_dbus_handler_l2cap_le_connect(
unsigned char *addr, int psm, int *sock);
int _bt_hal_dbus_handler_l2cap_le_listen(
int psm, int *sock);
+l2cap_le_cb_data_t *__find_l2cap_le_client_info_from_path(const char *path);
+
+void __l2cap_le_cb_data_remove(l2cap_le_cb_data_t *info);
+
gboolean _is_l2cap_le_server_uuid(const char *uuid);
#ifdef __cplusplus