Mesh: Implement bluetooth service interface for model message
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-event-handler.c
index abdecd3..5b31961 100644 (file)
@@ -742,6 +742,23 @@ static void __bt_mesh_event_filter(GDBusConnection *connection,
                _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, &param);
+               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 <<");
 }