#include <bt-hal-agent.h>
#endif
#include <bt-hal-hf-client.h>
+#include <bt-hal-mesh.h>
#define enum_prop_to_hal(prop, hal_prop, type) do { \
static type e; \
if (!strcmp(profile_id, BT_PROFILE_ADVANCED_AUDIO_SINK_ID))
return bt_get_a2dp_sink_interface();
+ if (!strcmp(profile_id, BT_PROFILE_MESH_ID)) {
+ INFO("Mesh: Get MESH Stack Interface");
+ return bt_get_mesh_interface();
+ }
+
return NULL;
}
#include "bt-service-common.h"
#include "bt-service-util.h"
#include "bt-service-main.h"
+#include "bt-service-mesh-main.h"
#include "bt-service-core-adapter.h"
#include "bt-service-core-device.h"
#include "bt-service-event-receiver.h"
if (ret != BLUETOOTH_ERROR_NONE)
BT_ERR("_bt_audio_initialize(BT_HFP_MODULE) Failed");
+ /* Mesh Init */
+ ret = _bt_mesh_init();
+ if (ret != BLUETOOTH_ERROR_NONE)
+ BT_ERR("Mesh Initialization Failed!!");
return BLUETOOTH_ERROR_NONE;
}
#include <bincfg.h>
#endif
+#include <unistd.h>
+#include <sys/socket.h>
#include <bundle.h>
#include <eventsystem.h>
+#include <ell/ell.h>
#include "bt-internal-types.h"
#include "bt-service-common.h"
#include <oal-event.h>
#include <oal-manager.h>
+/* ELL Start */
+struct ell_event_source {
+ GSource source;
+ GPollFD pollfd;
+};
+
+static gboolean event_prepare(GSource *source, gint *timeout)
+{
+ int r = l_main_prepare();
+ *timeout = r;
+
+ return FALSE;
+}
+
+static gboolean event_check(GSource *source)
+{
+ l_main_iterate(0);
+ return FALSE;
+}
+
+static GSourceFuncs event_funcs = {
+ .prepare = event_prepare,
+ .check = event_check,
+};
+/* ELL End */
+
static GMainLoop *main_loop;
static gboolean terminated = FALSE;
static gboolean is_initialized = FALSE;
int main(void)
{
struct sigaction sa;
+ /* ELL Start */
+ struct ell_event_source *source;
+ /* ELL End */
BT_INFO_C("### Starting the bt-service daemon");
if (!TIZEN_FEATURE_BT_SUPPORTED) {
return 0;
}
+ /* ELL Start */
+ BT_INFO("ELL Main init");
+ l_main_init();
+ /* ELL End */
+
bluetooth_plugin_init();
g_log_set_default_handler(__on_log_glib, NULL);
main_loop = g_main_loop_new(NULL, FALSE);
+ /* ELL Start */
+ source = (struct ell_event_source *) g_source_new(&event_funcs,
+ sizeof(struct ell_event_source));
+
+ source->pollfd.fd = l_main_get_epoll_fd();
+ source->pollfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
+
+ g_source_add_poll((GSource *)source, &source->pollfd);
+ g_source_attach((GSource *) source,
+ g_main_loop_get_context(main_loop));
+
+ /* ELL End */
g_main_loop_run(main_loop);
BT_DBG("g_main_loop_quit called!");
_bt_service_unref_connection();
+ /* ELL Start */
+ g_source_destroy((GSource *) source);
+ /* ELL End */
+
if (main_loop != NULL)
g_main_loop_unref(main_loop);
if (terminated == FALSE)
__bt_release_service();
+ /* ELL Start */
+ l_main_exit();
+ /* ELL End */
+
return 0;
}
--- /dev/null
+/*
+ * Bluetooth-frwk
+ *
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * @author: Anupam Roy <anupam.r@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef BT_SERVICE_MESH_MAIN_H_
+#define BT_SERVICE_MESH_MAIN_H_
+
+#include <glib.h>
+#include <sys/types.h>
+#include "bluetooth-api.h"
+#include "bluetooth-mesh-api.h"
+#include <json-c/json.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _bt_mesh_init(void);
+
+int _bt_mesh_deinit(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* BT_SERVICE_MESH_MAIN_H_ */