2 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
4 * Contact: Suresh Kumar N (suresh.n@samsung.com)
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 <zblib_service.h>
29 #include "zigbee_service.h"
31 #ifndef ZIGBEE_DEFAULT_PLUGINS_PATH
32 #define ZIGBEE_DEFAULT_PLUGINS_PATH "/usr/lib/zigbee/plugins/"
35 /* Zigbee service initialization */
36 gboolean zigbee_service_init(ZigBeeService *service)
38 const char *zigbee_plugin_path = ZIGBEE_DEFAULT_PLUGINS_PATH;
40 if (service == NULL) {
41 Z_LOGE("service is NULL");
45 /* Load ZigBee plug-ins */
46 if (G_UNLIKELY(TRUE != zblib_service_load_plugins(service, zigbee_plugin_path))) {
47 Z_LOGE("Load plug-ins failed!");
51 Z_TIME_CHECK("Loading Plugins Complete");
53 /* Initialize ZigBee plug-ins */
54 if (G_UNLIKELY(TRUE != zblib_service_initialize_plugins(service))) {
55 Z_LOGE("Initialize plug-ins failed!");
59 Z_TIME_CHECK("Initializing Plugins Complete. Starting Daemon");
64 /* Zigbee service de-initialization */
65 void zigbee_service_deinit(ZigBeeService *service)
67 if (service == NULL) {
68 Z_LOGE("service is NULL");
72 /* Unload ZigBee plug-ins */
73 if (G_UNLIKELY(TRUE != zblib_service_unload_plugins(service))) {
74 Z_LOGE("Unload plug-ins failed!");
78 Z_TIME_CHECK("Unload Plugins Complete");