2 * Network Configuration Module
4 * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
27 #include "wmesh-log.h"
28 #include "wmesh-util.h"
29 #include "wmesh-service.h"
30 #include "wmesh-service-interface.h"
33 wmesh_service *meshsvc;
35 int main(int argc, char *argv[])
37 wmesh_service *service = NULL;
41 __WMESH_LOG_FUNC_ENTER__;
43 #if !GLIB_CHECK_VERSION(2, 32, 0)
44 if (!g_thread_supported())
48 #if !GLIB_CHECK_VERSION(2, 36, 0)
54 WMESH_LOGI("service mainloop start");
56 /* Create mesh service */
57 meshsvc = service = wmeshd_service_new();
59 /* Initialize mesh service interface layer */
60 ret = wmeshd_service_interface_init(service);
61 if (G_UNLIKELY(FALSE == ret)) {
62 WMESH_LOGE("wmeshd_service_interface_init failed!");
66 /* Run mesh service */
67 ret = wmeshd_service_run(service);
68 if (G_UNLIKELY(FALSE == ret)) {
69 WMESH_LOGE("Run service failed!");
70 ret_code = EXIT_FAILURE;
74 /* Free mesh service */
75 wmeshd_service_interface_deinit(service);
76 wmeshd_service_free(service);
79 __WMESH_LOG_FUNC_EXIT__;