_bt_mesh_event_cb(BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED,
result, info,
event_info->cb, event_info->user_data);
+ } else if (strcasecmp(signal_name, BT_MESH_MODEL_APPKEY_CONFIGURED) == 0) {
+ int result;
+ GVariant *param = NULL;
+ GArray *dbus_data = NULL;
+ bluetooth_mesh_model_configure_t *info = NULL;
+
+ g_variant_get(parameters, "(iv)", &result, ¶m);
+ dbus_data = g_array_new(TRUE, TRUE, sizeof(gchar));
+
+ __bt_fill_garray_from_variant(param, dbus_data);
+ g_variant_unref(param);
+
+ info = &g_array_index(dbus_data, bluetooth_mesh_model_configure_t, 0);
+
+ _bt_mesh_event_cb(BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND,
+ result, info,
+ event_info->cb, event_info->user_data);
} else if (strcasecmp(signal_name, BT_MESH_MODEL_APPKEY_LIST) == 0) {
int result;
GVariantIter *iter = NULL;
uint16_t appkey_idx;
int i;
- g_variant_get(parameters, "(i&sqiui(ay))", &result, &net_uuid,
+ g_variant_get(parameters, "(i&sqiui(aq))", &result, &net_uuid,
&node_unicast, &elem_idx, &model, &total, &iter);
memset(&info, 0x00, sizeof(bluetooth_mesh_model_configure_t));
info.elem_index = elem_idx;
info.model = model;
info.appkeylist_count = total;
-
+ BT_INFO("Mesh: Total appkeys bound to model [%d]", total);
if (total) {
info.appkey_list = (uint16_t**)g_malloc0(sizeof(uint16_t*) * total);
result, &info,
event_info->cb, event_info->user_data);
- if (total) {
- for (i = 0; i < total; i++)
- g_free(info.appkey_list[i]);
+ for (i = 0; i < total; i++)
+ g_free(info.appkey_list[i]);
+ if (info.appkey_list) {
+ g_free(info.appkey_list);
g_variant_iter_free(iter);
}
+
} else if (strcasecmp(signal_name, BT_MESH_MODEL_SUB_LIST) == 0) {
int result;
GVariantIter *iter = NULL;
uint16_t sub_addr;
int i;
- g_variant_get(parameters, "(i&sqiui(ay))", &result, &net_uuid,
+ g_variant_get(parameters, "(i&sqiui(aq))", &result, &net_uuid,
&node_unicast, &elem_idx, &model, &total, &iter);
memset(&info, 0x00, sizeof(bluetooth_mesh_model_configure_t));
info.model = model;
info.sublist_count = total;
+ BT_INFO("Mesh: Total Subscriptions Bound to model [%d]", total);
if (total) {
info.sub_list = (uint16_t**)g_malloc0(sizeof(uint16_t*) * total);
for (i = 0; i < total && g_variant_iter_loop(iter, "q", &sub_addr); ++i) {
info.sub_list[i] = g_malloc0(sizeof(uint16_t));
*info.sub_list[i] = sub_addr;
+ BT_INFO("Mesh: Subscription Address [0x%2.2x]", sub_addr);
}
}
result, &info,
event_info->cb, event_info->user_data);
- if (total) {
- for (i = 0; i < total; i++)
- g_free(info.sub_list[i]);
+ for (i = 0; i < total; i++)
+ g_free(info.sub_list[i]);
+ if (info.sub_list) {
+ g_free(info.sub_list);
g_variant_iter_free(iter);
}
} else if (strcasecmp(signal_name, BT_MESH_NODE_TTL_CONFIGURED) == 0) {
_bt_mesh_event_cb(BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS,
result, info,
event_info->cb, event_info->user_data);
+ } else if (strcasecmp(signal_name, BT_MESH_MODEL_MSG_EXECUTED) == 0) {
+ int result;
+ GVariant *param = NULL;
+ GArray *dbus_data = NULL;
+ bluetooth_mesh_model_msg_t *info = NULL;
+
+ g_variant_get(parameters, "(iv)", &result, ¶m);
+ dbus_data = g_array_new(TRUE, TRUE, sizeof(gchar));
+
+ __bt_fill_garray_from_variant(param, dbus_data);
+ g_variant_unref(param);
+
+ info = &g_array_index(dbus_data, bluetooth_mesh_model_msg_t, 0);
+
+ _bt_mesh_event_cb(BLUETOOTH_EVENT_MESH_MODEL_MSG_EXECUTED,
+ result, info,
+ event_info->cb, event_info->user_data);
}
BT_INFO("Mesh event handler Exit <<");
}
#endif
ret_if(signal_name == NULL);
-#ifdef TIZEN_GATT_CLIENT
+
if (strcasecmp(signal_name, BT_GATT_SERVER_CONNECTED) == 0) {
const char *address = NULL;
bluetooth_device_address_t dev_address = { {0} };
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
-#else
- if (strcasecmp(signal_name, BT_GATT_CONNECTED) == 0) {
- const char *address = NULL;
- bluetooth_device_address_t dev_address = { {0} };
- BT_DBG("BT_GATT_CONNECTED");
- g_variant_get(parameters, "(i&s)", &result, &address);
-
- _bt_convert_addr_string_to_type(dev_address.addr, address);
- _bt_common_event_cb(BLUETOOTH_EVENT_GATT_CONNECTED,
- result, &dev_address,
- event_info->cb, event_info->user_data);
- } else if (strcasecmp(signal_name, BT_GATT_DISCONNECTED) == 0) {
- const char *address = NULL;
- bluetooth_device_address_t dev_address = { {0} };
- BT_DBG("BT_GATT_DISCONNECTED");
- g_variant_get(parameters, "(i&s)", &result, &address);
-
- _bt_convert_addr_string_to_type(dev_address.addr, address);
- _bt_common_event_cb(BLUETOOTH_EVENT_GATT_DISCONNECTED,
- result, &dev_address,
- event_info->cb, event_info->user_data);
-#endif
} else if (strcasecmp(signal_name, BT_GATT_REQ_ATT_MTU_CHANGED) == 0) {
const char *address = NULL;
bluetooth_device_address_t dev_address = { {0} };
_bt_headset_event_cb(BLUETOOTH_EVENT_AG_MIC_GAIN,
result, &gain,
event_info->cb, event_info->user_data);
-#ifdef TIZEN_FEATURE_BT_AVC_TARGET
} else if (strcasecmp(signal_name, BT_AUDIO_AVC_MODE_CHANGED) == 0) {
bool mode;
result, &volume,
event_info->cb, event_info->user_data);
}
-#endif
}
void __bt_hid_device_event_filter(GDBusConnection *connection,
g_free(cb_data);
}
-#ifdef TIZEN_GATT_CLIENT
static void __bt_gatt_client_event_filter(GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
}
}
-#endif
-
-
#ifndef GATT_DIRECT
static void __bt_gatt_server_event_filter(GDBusConnection *connection,
const gchar *sender_name,
event_info = (bt_event_info_t *)user_data;
ret_if(event_info == NULL);
-#ifdef TIZEN_GATT_CLIENT
- if (strcasecmp(signal_name, BT_GATT_VALUE_CHANGED) == 0) {
-#else
- if (strcasecmp(signal_name, BT_GATT_CONNECTED) == 0) {
- const char *address = NULL;
- bluetooth_device_address_t dev_address = { {0} };
- BT_DBG("BT_GATT_CONNECTED");
- g_variant_get(parameters, "(i&s)", &result, &address);
- _bt_convert_addr_string_to_type(dev_address.addr, address);
- _bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_CONNECTED,
- result, &dev_address,
- event_info->cb, event_info->user_data);
- } else if (strcasecmp(signal_name, BT_GATT_DISCONNECTED) == 0) {
- const char *address = NULL;
- bluetooth_device_address_t dev_address = { {0} };
- BT_DBG("BT_GATT_DISCONNECTED");
- g_variant_get(parameters, "(i&s)", &result, &address);
-
- _bt_convert_addr_string_to_type(dev_address.addr, address);
- _bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_DISCONNECTED,
- result, &dev_address,
- event_info->cb, event_info->user_data);
- } else if (strcasecmp(signal_name, BT_GATT_VALUE_CHANGED) == 0) {
-#endif
+ if (strcasecmp(signal_name, BT_GATT_VALUE_CHANGED) == 0) {
const char *address = NULL;
GVariant *data_var = NULL;
bluetooth_device_address_t dev_address = { {0} };
path = BT_GATT_SERVER_PATH;
break;
#endif
-
-#ifdef TIZEN_GATT_CLIENT
case BT_GATT_CLIENT_EVENT:
event_func = __bt_gatt_client_event_filter;
path = BT_GATT_CLIENT_PATH;
break;
-#endif
case BT_MESH_EVENT:
event_func = __bt_mesh_event_filter;
path = BT_MESH_PATH;