Add module APIs in zigbee-lib
authorSuresh Kumar N <suresh.n@samsung.com>
Tue, 20 Dec 2016 17:52:24 +0000 (23:22 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Thu, 11 May 2017 09:10:25 +0000 (18:10 +0900)
Change-Id: Id59da23fbc1f5a9ea4d5db1dcb789c0c1c6bfd91
Signed-off-by: Suresh Kumar N <suresh.n@samsung.com>
44 files changed:
zigbee-daemon/CMakeLists.txt
zigbee-daemon/zigbee-interface/src/zigbee_service_interface_common.h
zigbee-daemon/zigbee-lib/include/zblib.h
zigbee-daemon/zigbee-lib/include/zblib_driver.h
zigbee-daemon/zigbee-lib/include/zblib_driver_alarm.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_custom.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_door_lock.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_fan_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_level_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_mfglib_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_on_off.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_service.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_thermostat.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_color.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_group.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_poll_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_scene.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zclbasic_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zclglobal_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zclias_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zclidentify_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zdo_bind.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/include/zblib_driver_zdodev_control.h [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_alarm.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_custom.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_door_lock.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_fan_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_level_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_mfglib_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_on_off.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_service.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_thermostat.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_color.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_group.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_poll_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_scene.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclbasic_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclglobal_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclias_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclidentify_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zdo_bind.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zdodev_control.c [new file with mode: 0644]
zigbee-daemon/zigbee-lib/src/zblib_driver.c
zigbee-daemon/zigbee-service/src/zigbee_service.c [changed mode: 0755->0644]

index c8339cf..f5ae890 100644 (file)
@@ -52,13 +52,34 @@ SET(SRCS
         src/main.c
 )
 
+SET(ZIGBEE_LIB_SRC_PATH "zigbee-lib/src")
+
 SET(ZIGBEE_LIB_SRCS
-        zigbee-lib/src/zblib_service.c
-        zigbee-lib/src/zblib_service_interface.c
-        zigbee-lib/src/zblib_plugin.c
-        zigbee-lib/src/zblib_driver.c
-        zigbee-lib/src/zblib_log.c
-        zigbee-lib/src/zblib_util.c
+        ${ZIGBEE_LIB_SRC_PATH}/zblib_service.c
+        ${ZIGBEE_LIB_SRC_PATH}/zblib_service_interface.c
+        ${ZIGBEE_LIB_SRC_PATH}/zblib_plugin.c
+        ${ZIGBEE_LIB_SRC_PATH}/zblib_driver.c
+        ${ZIGBEE_LIB_SRC_PATH}/zblib_log.c
+        ${ZIGBEE_LIB_SRC_PATH}/zblib_util.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_alarm.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_custom.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_door_lock.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_fan_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_level_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_mfglib_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_on_off.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_service.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_thermostat.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zclbasic_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zclglobal_control.c
+        ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zclias_control.c
+        ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zclidentify_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zcl_color.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zcl_group.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zcl_poll_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zcl_scene.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zdodev_control.c
+       ${ZIGBEE_LIB_SRC_PATH}/drivers/zblib_driver_zdo_bind.c
 )
 
 ### Sub-directotries ###
index 8e297d4..4546b3f 100644 (file)
@@ -56,8 +56,6 @@
 /**< ZigBee D-BUS service path */
 #define ZIGBEE_DBUS_PATH               "/org/tizen/zigbee"
 
-#define NOT_USED(var) ((var) = (var))
-
 /**< ZigBee D-BUS interface custom data */
 typedef struct {
        GDBusObjectManagerServer *manager; /**< ZigBee object */
index 20a86da..d4ea973 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <zblib_log.h>
 
+#define NOT_USED(var) ((var) = (var))
+
 /**< ZigBee module typedefs */
 typedef struct zblib_service_type ZigBeeService;
 typedef struct zblib_plugin_type ZigBeePlugin;
index d4530b5..e492c96 100644 (file)
 #ifndef __ZIGBEE_LIB_DRIVER_H__
 #define __ZIGBEE_LIB_DRIVER_H__
 
-/* Driver APIs */
+/**< ZigBee driver dispatcher function pointer */
+typedef gboolean (*ZblibDriverDispatcher_t)(ZigBeeDriver *driver);
+
+/**< ZigBee driver free hook function pointer */
+typedef void (*ZblibDriverFreeHook_t)(ZigBeeDriver *driver);
+
+/**< ZigBee driver types */
+typedef enum {
+       ZBLIB_DRIVER_TYPE_NONE, /**< None */
+       ZBLIB_DRIVER_TYPE_ALARM, /**< Alarm */
+       ZBLIB_DRIVER_TYPE_CUSTOM, /**< Custom */
+       ZBLIB_DRIVER_TYPE_DOOR_LOCK, /**< Door lock */
+       ZBLIB_DRIVER_TYPE_FAN_CONTROL, /**< Fan control */
+       ZBLIB_DRIVER_TYPE_LEVEL_CONTROL, /**< Level control */
+       ZBLIB_DRIVER_TYPE_MFGLIB_CONTROL, /**< Mfglib control */
+       ZBLIB_DRIVER_TYPE_ON_OFF, /**< On Off */
+       ZBLIB_DRIVER_TYPE_SERVICE, /**< Service */
+       ZBLIB_DRIVER_TYPE_THERMOSTAT, /**< Thermostat */
+       ZBLIB_DRIVER_TYPE_ZCLBASIC_CONTROL, /**< Zclbasic control */
+       ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL, /**< Zclglobal control */
+       ZBLIB_DRIVER_TYPE_ZCLIAS_CONTROL, /**< Zclias control */
+       ZBLIB_DRIVER_TYPE_ZCLIDENTIFY_CONTROL, /**< Zclidentify control */
+       ZBLIB_DRIVER_TYPE_ZCL_COLOR, /**< Zcl color */
+       ZBLIB_DRIVER_TYPE_ZCL_GROUP, /**< Zcl group */
+       ZBLIB_DRIVER_TYPE_ZCL_POLL_CONTROL, /**< Zcl poll control */
+       ZBLIB_DRIVER_TYPE_ZCL_SCENE, /**< Zcl scene */
+       ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL, /**< Zdodev control */
+       ZBLIB_DRIVER_TYPE_ZDO_BIND, /**< Zdo bind */
+} ZblibDriverType_e;
+
+/**< Driver APIs */
 ZigBeeDriver *zblib_driver_new(ZigBeePlugin *plugin,
-       const gchar *object_name,
-       gint object_type);
+       const gchar *driver_name,
+       ZblibDriverType_e driver_type);
 void zblib_driver_free(ZigBeeDriver *driver);
 
+gboolean zblib_driver_link_object(ZigBeeDriver *driver, gpointer object);
+gpointer zblib_driver_ref_object(ZigBeeDriver *driver);
+
+gboolean zblib_driver_set_dispatcher(ZigBeeDriver *driver, ZblibDriverDispatcher_t dispatcher_fn);
+gboolean zblib_driver_set_free_hook(ZigBeeDriver *driver, ZblibDriverFreeHook_t free_hook_fn);
+
+ZblibDriverType_e zblib_driver_ref_driver_type(ZigBeeDriver *driver);
+
 #endif /* __ZIGBEE_LIB_DRIVER_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_alarm.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_alarm.h
new file mode 100644 (file)
index 0000000..71b5de1
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ALARM_H__
+#define __ZIGBEE_LIB_ALARM_H__
+
+/**< ZigBee 'alarm' driver operations */
+typedef struct {
+       gboolean (*get_alarm_count)(ZigBeeDriver *driver);
+       gboolean (*reset_alarm)(ZigBeeDriver *driver);
+       gboolean (*reset_all_alarm)(ZigBeeDriver *driver);
+       gboolean (*alarm)(ZigBeeDriver *driver);
+       gboolean (*reset_alarm_log)(ZigBeeDriver *driver);
+       gboolean (*get_alarm)(ZigBeeDriver *driver);
+} ZblibDriverAlarmOps_t;
+
+/* ZigBee 'alarm' driver APIs */
+ZigBeeDriver *zblib_driver_alarm_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverAlarmOps_t *ops);
+void zblib_driver_alarm_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ALARM_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_custom.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_custom.h
new file mode 100644 (file)
index 0000000..dd7e964
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_CUSTOM_H__
+#define __ZIGBEE_LIB_CUSTOM_H__
+
+/**< ZigBee 'custom' driver operations */
+typedef struct {
+       gboolean (*aps_send)(ZigBeeDriver *driver);
+       gboolean (*zcl_send)(ZigBeeDriver *driver);
+       gboolean (*send_to_local)(ZigBeeDriver *driver);
+} ZblibDriverCustomOps_t;
+
+/* ZigBee 'custom' driver APIs */
+ZigBeeDriver *zblib_driver_custom_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverCustomOps_t *ops);
+void zblib_driver_custom_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_CUSTOM_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_door_lock.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_door_lock.h
new file mode 100644 (file)
index 0000000..2fa4e81
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_DOOR_LOCK_H__
+#define __ZIGBEE_LIB_DOOR_LOCK_H__
+
+/**< ZigBee 'door lock' driver operations */
+typedef struct {
+       gboolean (*subscribe_lock_event)(ZigBeeDriver *driver);
+       gboolean (*set_door_lock_pin)(ZigBeeDriver *driver);
+       gboolean (*set_door_lock)(ZigBeeDriver *driver);
+       gboolean (*get_lock_state)(ZigBeeDriver *driver);
+} ZblibDriverDoorLockOps_t;
+
+/* ZigBee 'door lock' driver APIs */
+ZigBeeDriver *zblib_driver_door_lock_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverDoorLockOps_t *ops);
+void zblib_driver_door_lock_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_DOOR_LOCK_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_fan_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_fan_control.h
new file mode 100644 (file)
index 0000000..0d26a42
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_FAN_CONTROL_H__
+#define __ZIGBEE_LIB_FAN_CONTROL_H__
+
+/**< ZigBee 'fan control' driver operations */
+typedef struct {
+       gboolean (*set_fan_mode)(ZigBeeDriver *driver);
+       gboolean (*get_fan_mode)(ZigBeeDriver *driver);
+       gboolean (*set_fan_mode_sequence)(ZigBeeDriver *driver);
+       gboolean (*get_fan_mode_sequence)(ZigBeeDriver *driver);
+} ZblibDriverFanControlOps_t;
+
+/* ZigBee 'fan control' driver APIs */
+ZigBeeDriver *zblib_driver_fan_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverFanControlOps_t *ops);
+void zblib_driver_fan_control_free(ZigBeeDriver *driver);
+
+
+#endif /* __ZIGBEE_LIB_FAN_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_level_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_level_control.h
new file mode 100644 (file)
index 0000000..0d75684
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_LEVEL_CONTROL_H__
+#define __ZIGBEE_LIB_LEVEL_CONTROL_H__
+
+/**< ZigBee 'level control' driver operations */
+typedef struct {
+       gboolean (*move_to_level)(ZigBeeDriver *driver);
+       gboolean (*move)(ZigBeeDriver *driver);
+       gboolean (*step)(ZigBeeDriver *driver);
+       gboolean (*move_to_level_with_on_off)(ZigBeeDriver *driver);
+       gboolean (*move_with_on_off)(ZigBeeDriver *driver);
+       gboolean (*step_with_on_off)(ZigBeeDriver *driver);
+       gboolean (*stop)(ZigBeeDriver *driver);
+} ZblibDriverLevelControlOps_t;
+
+/* ZigBee 'level control' driver APIs */
+ZigBeeDriver *zblib_driver_level_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverLevelControlOps_t *ops);
+void zblib_driver_level_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_LEVEL_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_mfglib_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_mfglib_control.h
new file mode 100644 (file)
index 0000000..d527792
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_MFGLIB_CONTROL_H__
+#define __ZIGBEE_LIB_MFGLIB_CONTROL_H__
+
+/**< ZigBee 'mfglib control' driver operations */
+typedef struct {
+       gboolean (*start)(ZigBeeDriver *driver);
+       gboolean (*end)(ZigBeeDriver *driver);
+       gboolean (*start_tone)(ZigBeeDriver *driver);
+       gboolean (*stop_tone)(ZigBeeDriver *driver);
+       gboolean (*start_stream)(ZigBeeDriver *driver);
+       gboolean (*stop_stream)(ZigBeeDriver *driver);
+       gboolean (*send_packet)(ZigBeeDriver *driver);
+       gboolean (*set_channel)(ZigBeeDriver *driver);
+       gboolean (*get_channel)(ZigBeeDriver *driver);
+       gboolean (*set_power)(ZigBeeDriver *driver);
+       gboolean (*get_power)(ZigBeeDriver *driver);
+       gboolean (*set_synoffset)(ZigBeeDriver *driver);
+       gboolean (*get_synoffset)(ZigBeeDriver *driver);
+       gboolean (*rx_start)(ZigBeeDriver *driver);
+       gboolean (*rx_stop)(ZigBeeDriver *driver);
+       gboolean (*rx_verify)(ZigBeeDriver *driver);
+       gboolean (*get_rssi)(ZigBeeDriver *driver);
+} ZblibDriverMfglibControlOps_t;
+
+/* ZigBee 'mfglib control' driver APIs */
+ZigBeeDriver *zblib_driver_mfglib_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverMfglibControlOps_t *ops);
+void zblib_driver_mfglib_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_MFGLIB_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_on_off.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_on_off.h
new file mode 100644 (file)
index 0000000..848f8bb
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ON_OFF_H__
+#define __ZIGBEE_LIB_ON_OFF_H__
+
+/**< ZigBee 'on off' driver operations */
+typedef struct {
+       gboolean (*set_on_off)(ZigBeeDriver *driver);
+       gboolean (*get_on_off_state)(ZigBeeDriver *driver);
+} ZblibDriverOnOffOps_t;
+
+/* ZigBee 'on off' driver APIs */
+ZigBeeDriver *zblib_driver_on_off_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverOnOffOps_t *ops);
+void zblib_driver_on_off_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ON_OFF_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_service.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_service.h
new file mode 100644 (file)
index 0000000..7f9cdfe
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_SERVICE_H__
+#define __ZIGBEE_LIB_SERVICE_H__
+
+/**< ZigBee 'service' driver operations */
+typedef struct {
+       gboolean (*set_on_off)(ZigBeeDriver *driver);
+       gboolean (*get_on_off_state)(ZigBeeDriver *driver);
+} ZblibDriverServiceOps_t;
+
+/* ZigBee 'service' driver APIs */
+ZigBeeDriver *zblib_driver_service_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverServiceOps_t *ops);
+void zblib_driver_service_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_SERVICE_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_thermostat.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_thermostat.h
new file mode 100644 (file)
index 0000000..95b452a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_THERMOSTAT_H__
+#define __ZIGBEE_LIB_THERMOSTAT_H__
+
+/**< ZigBee 'thermostat' driver operations */
+typedef struct {
+       gboolean (*get_local_temp)(ZigBeeDriver *driver);
+       gboolean (*get_weekly_schedule)(ZigBeeDriver *driver);
+       gboolean (*set_weekly_schedule)(ZigBeeDriver *driver);
+       gboolean (*clear_weekly_schedule)(ZigBeeDriver *driver);
+       gboolean (*setpoint_raise_lower)(ZigBeeDriver *driver);
+} ZblibDriverThermostatOps_t;
+
+/* ZigBee 'thermostat' driver APIs */
+ZigBeeDriver *zblib_driver_thermostat_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverThermostatOps_t *ops);
+void zblib_driver_thermostat_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_THERMOSTAT_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_color.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_color.h
new file mode 100644 (file)
index 0000000..05fbfb9
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCL_COLOR_H__
+#define __ZIGBEE_LIB_ZCL_COLOR_H__
+
+/**< ZigBee 'Zcl color' driver operations */
+typedef struct {
+       gboolean (*move_to_hue)(ZigBeeDriver *driver);
+       gboolean (*move_hue)(ZigBeeDriver *driver);
+       gboolean (*step_hue)(ZigBeeDriver *driver);
+       gboolean (*move_to_saturation)(ZigBeeDriver *driver);
+       gboolean (*move_saturation)(ZigBeeDriver *driver);
+       gboolean (*step_saturation)(ZigBeeDriver *driver);
+       gboolean (*move_to_hue_and_saturation)(ZigBeeDriver *driver);
+       gboolean (*move_to_color)(ZigBeeDriver *driver);
+       gboolean (*move_color)(ZigBeeDriver *driver);
+       gboolean (*step_color)(ZigBeeDriver *driver);
+       gboolean (*move_color_temperature)(ZigBeeDriver *driver);
+} ZblibDriverZclColorOps_t;
+
+/* ZigBee 'Zcl color' driver APIs */
+ZigBeeDriver *zblib_driver_zcl_color_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclColorOps_t *ops);
+void zblib_driver_zcl_color_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCL_COLOR_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_group.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_group.h
new file mode 100644 (file)
index 0000000..b8c9a1f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCL_GROUP_H__
+#define __ZIGBEE_LIB_ZCL_GROUP_H__
+
+/**< ZigBee 'Zcl group' driver operations */
+typedef struct {
+       gboolean (*add_group)(ZigBeeDriver *driver);
+       gboolean (*view_group)(ZigBeeDriver *driver);
+       gboolean (*get_group_membership)(ZigBeeDriver *driver);
+       gboolean (*remove_group)(ZigBeeDriver *driver);
+       gboolean (*remove_all_group)(ZigBeeDriver *driver);
+       gboolean (*add_group_if_identifying)(ZigBeeDriver *driver);
+} ZblibDriverZclGroupOps_t;
+
+/* ZigBee 'Zcl group' driver APIs */
+ZigBeeDriver *zblib_driver_zcl_group_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclGroupOps_t *ops);
+void zblib_driver_zcl_group_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCL_GROUP_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_poll_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_poll_control.h
new file mode 100644 (file)
index 0000000..e84bd17
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCL_POLL_CONTROL_H__
+#define __ZIGBEE_LIB_ZCL_POLL_CONTROL_H__
+
+/**< ZigBee 'Zcl poll control' driver operations */
+typedef struct {
+       gboolean (*check_in_response)(ZigBeeDriver *driver);
+       gboolean (*fast_poll_stop)(ZigBeeDriver *driver);
+       gboolean (*set_long_poll_interval)(ZigBeeDriver *driver);
+       gboolean (*set_short_poll_interval)(ZigBeeDriver *driver);
+} ZblibDriverZclPollControlOps_t;
+
+/* ZigBee 'Zcl poll control' driver APIs */
+ZigBeeDriver *zblib_driver_zcl_poll_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclPollControlOps_t *ops);
+void zblib_driver_zcl_poll_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCL_POLL_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_scene.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zcl_scene.h
new file mode 100644 (file)
index 0000000..ec694bd
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCL_SCENE_H__
+#define __ZIGBEE_LIB_ZCL_SCENE_H__
+
+/**< ZigBee 'Zcl scene' driver operations */
+typedef struct {
+       gboolean (*add_scene)(ZigBeeDriver *driver);
+       gboolean (*view_scene)(ZigBeeDriver *driver);
+       gboolean (*remove_scene)(ZigBeeDriver *driver);
+       gboolean (*store_scene)(ZigBeeDriver *driver);
+       gboolean (*recall_scene)(ZigBeeDriver *driver);
+       gboolean (*remove_all_scene)(ZigBeeDriver *driver);
+       gboolean (*get_scene_membership)(ZigBeeDriver *driver);
+} ZblibDriverZclSceneOps_t;
+
+/* ZigBee 'Zcl scene' driver APIs */
+ZigBeeDriver *zblib_driver_zcl_scene_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclSceneOps_t *ops);
+void zblib_driver_zcl_scene_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCL_SCENE_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zclbasic_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zclbasic_control.h
new file mode 100644 (file)
index 0000000..de90115
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCLBASIC_CONTROL_H__
+#define __ZIGBEE_LIB_ZCLBASIC_CONTROL_H__
+
+/**< ZigBee 'Zclbasic control' driver operations */
+typedef struct {
+       gboolean (*reset_factory_default)(ZigBeeDriver *driver);
+} ZblibDriverZclbasicControlOps_t;
+
+/* ZigBee 'Zclbasic control' driver APIs */
+ZigBeeDriver *zblib_driver_zclbasic_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclbasicControlOps_t *ops);
+void zblib_driver_zclbasic_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCLBASIC_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zclglobal_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zclglobal_control.h
new file mode 100644 (file)
index 0000000..c65c6b3
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCLGLOBAL_CONTROL_H__
+#define __ZIGBEE_LIB_ZCLGLOBAL_CONTROL_H__
+
+/**< ZigBee 'Zclglobal control' driver operations */
+typedef struct {
+       gboolean (*read_attributes_req)(ZigBeeDriver *driver);
+       gboolean (*write_attributes_req)(ZigBeeDriver *driver);
+       gboolean (*write_attributes_undivided_req)(ZigBeeDriver *driver);
+       gboolean (*write_attributes_no_resp)(ZigBeeDriver *driver);
+       gboolean (*write_attributes_structured)(ZigBeeDriver *driver);
+       gboolean (*read_attributes_structured)(ZigBeeDriver *driver);
+       gboolean (*configure_reporting_req)(ZigBeeDriver *driver);
+       gboolean (*read_configure_reporting)(ZigBeeDriver *driver);
+       gboolean (*discover_attributes)(ZigBeeDriver *driver);
+       gboolean (*discover_attributes_extended)(ZigBeeDriver *driver);
+       gboolean (*discover_commands_received)(ZigBeeDriver *driver);
+       gboolean (*discover_commands_generated)(ZigBeeDriver *driver);
+} ZblibDriverZclglobalControlOps_t;
+
+/* ZigBee 'Zclglobal control' driver APIs */
+ZigBeeDriver *zblib_driver_zclglobal_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclglobalControlOps_t *ops);
+void zblib_driver_zclglobal_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCLGLOBAL_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zclias_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zclias_control.h
new file mode 100644 (file)
index 0000000..d517152
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCLIAS_CONTROL_H__
+#define __ZIGBEE_LIB_ZCLIAS_CONTROL_H__
+
+/**< ZigBee 'Zclias control' driver operations */
+typedef struct {
+       gboolean (*enroll_response)(ZigBeeDriver *driver);
+} ZblibDriverZcliasControlOps_t;
+
+/* ZigBee 'Zclias control' driver APIs */
+ZigBeeDriver *zblib_driver_zclias_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZcliasControlOps_t *ops);
+void zblib_driver_zclias_control_free(ZigBeeDriver *driver);
+
+
+#endif /* __ZIGBEE_LIB_ZCLIAS_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zclidentify_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zclidentify_control.h
new file mode 100644 (file)
index 0000000..5b616b6
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZCLIDENTIFY_CONTROL_H__
+#define __ZIGBEE_LIB_ZCLIDENTIFY_CONTROL_H__
+
+/**< ZigBee 'Zclidentify control' driver operations */
+typedef struct {
+       gboolean (*identify)(ZigBeeDriver *driver);
+       gboolean (*query)(ZigBeeDriver *driver);
+} ZblibDriverZclidentifyControlOps_t;
+
+/* ZigBee 'Zclidentify control' driver APIs */
+ZigBeeDriver *zblib_driver_zclidentify_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclidentifyControlOps_t *ops);
+void zblib_driver_zclidentify_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZCLIDENTIFY_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zdo_bind.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zdo_bind.h
new file mode 100644 (file)
index 0000000..d1d6ea1
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZDO_BIND_H__
+#define __ZIGBEE_LIB_ZDO_BIND_H__
+
+/**< ZigBee 'Zdo bind' driver operations */
+typedef struct {
+       gboolean (*bind_req)(ZigBeeDriver *driver);
+       gboolean (*unbind_req)(ZigBeeDriver *driver);
+} ZblibDriverZdoBindOps_t;
+
+/* ZigBee 'Zdo bind' driver APIs */
+ZigBeeDriver *zblib_driver_zdo_bind_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZdoBindOps_t *ops);
+void zblib_driver_zdo_bind_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZDO_BIND_H__ */
diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_zdodev_control.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_zdodev_control.h
new file mode 100644 (file)
index 0000000..2cbe62d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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 __ZIGBEE_LIB_ZDODEV_CONTROL_H__
+#define __ZIGBEE_LIB_ZDODEV_CONTROL_H__
+
+/**< ZigBee 'Zdodev control' driver operations */
+typedef struct {
+       gboolean (*nwk_addr_req)(ZigBeeDriver *driver);
+       gboolean (*matched_descriptor_req)(ZigBeeDriver *driver);
+       gboolean (*ieee_addr_req)(ZigBeeDriver *driver);
+       gboolean (*active_ep_req)(ZigBeeDriver *driver);
+       gboolean (*node_desc_req)(ZigBeeDriver *driver);
+       gboolean (*power_desc_req)(ZigBeeDriver *driver);
+       gboolean (*complex_desc_req)(ZigBeeDriver *driver);
+       gboolean (*user_desc_req)(ZigBeeDriver *driver);
+       gboolean (*user_desc_set_req)(ZigBeeDriver *driver);
+       gboolean (*device_announce)(ZigBeeDriver *driver);
+       gboolean (*simple_desc_req)(ZigBeeDriver *driver);
+       gboolean (*mgmt_lqi_req)(ZigBeeDriver *driver);
+       gboolean (*mgmt_rtg_req)(ZigBeeDriver *driver);
+       gboolean (*mgmt_bind_req)(ZigBeeDriver *driver);
+       gboolean (*mgmt_permit_join_req)(ZigBeeDriver *driver);
+       gboolean (*nwk_update_req)(ZigBeeDriver *driver);
+       gboolean (*nwk_disc_req)(ZigBeeDriver *driver);
+} ZblibDriverZdodevControlOps_t;
+
+/* ZigBee 'Zdodev control' driver APIs */
+ZigBeeDriver *zblib_driver_zdodev_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZdodevControlOps_t *ops);
+void zblib_driver_zdodev_control_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_ZDODEV_CONTROL_H__ */
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_alarm.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_alarm.c
new file mode 100644 (file)
index 0000000..e793dd8
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_alarm.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverAlarmOps_t *ops; /**< Operations */
+} ZblibDriverAlarmPrivData_t;
+
+static gboolean __zblib_driver_alarm_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_alarm_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverAlarmPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_alarm_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverAlarmOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverAlarmPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ALARM);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverAlarmPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_alarm_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_alarm_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_alarm_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_custom.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_custom.c
new file mode 100644 (file)
index 0000000..8003142
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_custom.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverCustomOps_t *ops; /**< Operations */
+} ZblibDriverCustomPrivData_t;
+
+static gboolean __zblib_driver_custom_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_custom_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverCustomPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_custom_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverCustomOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverCustomPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_CUSTOM);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverCustomPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_custom_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_custom_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_custom_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_door_lock.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_door_lock.c
new file mode 100644 (file)
index 0000000..46e1227
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_door_lock.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverDoorLockOps_t *ops; /**< Operations */
+} ZblibDriverDoorLockPrivData_t;
+
+static gboolean __zblib_driver_door_lock_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_door_lock_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverDoorLockPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_door_lock_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverDoorLockOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverDoorLockPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_DOOR_LOCK);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverDoorLockPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_door_lock_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_door_lock_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_door_lock_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_fan_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_fan_control.c
new file mode 100644 (file)
index 0000000..a682f8a
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_fan_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverFanControlOps_t *ops; /**< Operations */
+} ZblibDriverFanControlPrivData_t;
+
+static gboolean __zblib_driver_fan_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_fan_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverFanControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_fan_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverFanControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverFanControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_FAN_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverFanControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_fan_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_fan_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_fan_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_level_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_level_control.c
new file mode 100644 (file)
index 0000000..027d563
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_level_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverLevelControlOps_t *ops; /**< Operations */
+} ZblibDriverLevelControlPrivData_t;
+
+static gboolean __zblib_driver_level_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_level_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverLevelControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_level_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverLevelControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverLevelControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_LEVEL_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverLevelControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_level_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_level_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_level_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_mfglib_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_mfglib_control.c
new file mode 100644 (file)
index 0000000..e8ae16e
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_mfglib_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverMfglibControlOps_t *ops; /**< Operations */
+} ZblibDriverMfglibControlPrivData_t;
+
+static gboolean __zblib_driver_mfglib_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_mfglib_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverMfglibControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_mfglib_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverMfglibControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverMfglibControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_MFGLIB_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverMfglibControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_mfglib_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_mfglib_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_mfglib_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_on_off.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_on_off.c
new file mode 100644 (file)
index 0000000..4bdfe98
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_on_off.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverOnOffOps_t *ops; /**< Operations */
+} ZblibDriverOnOffPrivData_t;
+
+static gboolean __zblib_driver_on_off_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_on_off_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverOnOffPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_on_off_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverOnOffOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverOnOffPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ON_OFF);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverOnOffPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_on_off_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_on_off_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_on_off_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_service.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_service.c
new file mode 100644 (file)
index 0000000..c2f7be9
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_service.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverServiceOps_t *ops; /**< Operations */
+} ZblibDriverServicePrivData_t;
+
+static gboolean __zblib_driver_service_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_service_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverServicePrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_service_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverServiceOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverServicePrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_SERVICE);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverServicePrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_service_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_service_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_service_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_thermostat.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_thermostat.c
new file mode 100644 (file)
index 0000000..9456ad5
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_thermostat.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverThermostatOps_t *ops; /**< Operations */
+} ZblibDriverThermostatPrivData_t;
+
+static gboolean __zblib_driver_thermostat_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_thermostat_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverThermostatPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_thermostat_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverThermostatOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverThermostatPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_THERMOSTAT);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverThermostatPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_thermostat_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_thermostat_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_thermostat_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_color.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_color.c
new file mode 100644 (file)
index 0000000..e2a6544
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zcl_color.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclColorOps_t *ops; /**< Operations */
+} ZblibDriverZclColorPrivData_t;
+
+static gboolean __zblib_driver_zcl_color_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zcl_color_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclColorPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zcl_color_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclColorOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclColorPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCL_COLOR);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclColorPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zcl_color_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zcl_color_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zcl_color_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_group.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_group.c
new file mode 100644 (file)
index 0000000..9400a58
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zcl_group.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclGroupOps_t *ops; /**< Operations */
+} ZblibDriverZclGroupPrivData_t;
+
+static gboolean __zblib_driver_zcl_group_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zcl_group_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclGroupPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zcl_group_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclGroupOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclGroupPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCL_GROUP);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclGroupPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zcl_group_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zcl_group_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zcl_group_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_poll_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_poll_control.c
new file mode 100644 (file)
index 0000000..768744b
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zcl_poll_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclPollControlOps_t *ops; /**< Operations */
+} ZblibDriverZclPollControlPrivData_t;
+
+static gboolean __zblib_driver_zcl_poll_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zcl_poll_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclPollControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zcl_poll_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclPollControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclPollControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCL_POLL_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclPollControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zcl_poll_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zcl_poll_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zcl_poll_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_scene.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zcl_scene.c
new file mode 100644 (file)
index 0000000..c036e64
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zcl_scene.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclSceneOps_t *ops; /**< Operations */
+} ZblibDriverZclScenePrivData_t;
+
+static gboolean __zblib_driver_zcl_scene_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zcl_scene_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclScenePrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zcl_scene_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclSceneOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclScenePrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCL_SCENE);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclScenePrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zcl_scene_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zcl_scene_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zcl_scene_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclbasic_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclbasic_control.c
new file mode 100644 (file)
index 0000000..d53790e
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zclbasic_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclbasicControlOps_t *ops; /**< Operations */
+} ZblibDriverZclbasicControlPrivData_t;
+
+static gboolean __zblib_driver_zclbasic_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zclbasic_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclbasicControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zclbasic_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclbasicControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclbasicControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCLBASIC_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclbasicControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zclbasic_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zclbasic_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zclbasic_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclglobal_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclglobal_control.c
new file mode 100644 (file)
index 0000000..3f9dae3
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zclglobal_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclglobalControlOps_t *ops; /**< Operations */
+} ZblibDriverZclglobalControlPrivData_t;
+
+static gboolean __zblib_driver_zclglobal_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zclglobal_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclglobalControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zclglobal_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclglobalControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclglobalControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclglobalControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zclglobal_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zclglobal_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zclglobal_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclias_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclias_control.c
new file mode 100644 (file)
index 0000000..4456ce3
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zclias_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZcliasControlOps_t *ops; /**< Operations */
+} ZblibDriverZcliasControlPrivData_t;
+
+static gboolean __zblib_driver_zclias_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zclias_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZcliasControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zclias_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZcliasControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZcliasControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCLIAS_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZcliasControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zclias_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zclias_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zclias_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclidentify_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zclidentify_control.c
new file mode 100644 (file)
index 0000000..a582c68
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zclidentify_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZclidentifyControlOps_t *ops; /**< Operations */
+} ZblibDriverZclidentifyControlPrivData_t;
+
+static gboolean __zblib_driver_zclidentify_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zclidentify_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZclidentifyControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zclidentify_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZclidentifyControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZclidentifyControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZCLIDENTIFY_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZclidentifyControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zclidentify_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zclidentify_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zclidentify_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zdo_bind.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zdo_bind.c
new file mode 100644 (file)
index 0000000..3230d2f
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zdo_bind.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZdoBindOps_t *ops; /**< Operations */
+} ZblibDriverZdoBindPrivData_t;
+
+static gboolean __zblib_driver_zdo_bind_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zdo_bind_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZdoBindPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zdo_bind_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZdoBindOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZdoBindPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZDO_BIND);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZdoBindPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zdo_bind_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zdo_bind_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zdo_bind_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
diff --git a/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zdodev_control.c b/zigbee-daemon/zigbee-lib/src/drivers/zblib_driver_zdodev_control.c
new file mode 100644 (file)
index 0000000..c49645b
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Suresh Kumar N (suresh.n@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.
+ */
+
+#include <zblib.h>
+#include <zblib_driver.h>
+
+#include "zblib_driver_zdodev_control.h"
+
+/**< Private data */
+typedef struct {
+       ZblibDriverZdodevControlOps_t *ops; /**< Operations */
+} ZblibDriverZdodevControlPrivData_t;
+
+static gboolean __zblib_driver_zdodev_control_dispatcher(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void __zblib_driver_zdodev_control_free_hook(ZigBeeDriver *driver)
+{
+       ZblibDriverZdodevControlPrivData_t *priv_data = NULL;
+
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Fetch private data */
+       priv_data = zblib_driver_ref_object(driver);
+       if (NULL == priv_data) {
+               Z_LOGE("priv_data is NULL");
+               return;
+       }
+
+       /* Free resources */
+       g_free(priv_data);
+}
+
+ZigBeeDriver *zblib_driver_zdodev_control_new(ZigBeePlugin *plugin,
+       const gchar *driver_name,
+       ZblibDriverZdodevControlOps_t *ops)
+{
+       ZigBeeDriver *driver = NULL;
+       ZblibDriverZdodevControlPrivData_t *priv_data = NULL;
+       gboolean ret;
+
+       if (NULL == plugin) {
+               Z_LOGE("plugin is NULL");
+               return NULL;
+       }
+
+       /* Create new driver */
+       driver = zblib_driver_new(plugin, driver_name, ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL);
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       /* Allocate memory for private data */
+       priv_data = g_malloc0(sizeof(ZblibDriverZdodevControlPrivData_t));
+
+       /* Update private data */
+       priv_data->ops = ops;
+
+       /* Link private data to driver */
+       ret = zblib_driver_link_object(driver, priv_data);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_link_object failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set operations dispatcher function */
+       ret = zblib_driver_set_dispatcher(driver, __zblib_driver_zdodev_control_dispatcher);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_dispatcher failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       /* Set free hook function */
+       ret = zblib_driver_set_free_hook(driver, __zblib_driver_zdodev_control_free_hook);
+       if (FALSE == ret) {
+               Z_LOGE("zblib_driver_set_free_hook failed!");
+
+               /* Free allocated resources */
+               g_free(priv_data);
+               g_free(driver);
+
+               return NULL;
+       }
+
+       return driver;
+}
+
+void zblib_driver_zdodev_control_free(ZigBeeDriver *driver)
+{
+       if (NULL == driver) {
+               Z_LOGE("driver is NULL");
+               return;
+       }
+
+       /* Free driver */
+       zblib_driver_free(driver);
+}
index 4d2bb78..2ecd48d 100644 (file)
 
 /**< ZigBee driver object */
 struct zblib_driver_type {
-       gint object_type; /**< ZigBee driver object type */
-       gchar *object_name; /**< ZigBee driver object name */
+       ZblibDriverType_e driver_type; /**< ZigBee driver type */
+       gchar *driver_name; /**< ZigBee driver name */
+       gpointer priv_object; /**< ZigBee driver private data */
+
+       ZblibDriverDispatcher_t dispatcher_fn; /**< Driver operations dispatcher function */
+       ZblibDriverFreeHook_t free_hook_fn; /**< Driver free hook function */
 
        ZigBeePlugin *plugin; /**< ZigBee Plug-in */
 
@@ -30,8 +34,8 @@ struct zblib_driver_type {
 };
 
 ZigBeeDriver *zblib_driver_new(ZigBeePlugin *plugin,
-       const gchar *object_name,
-       gint object_type)
+       const gchar *driver_name,
+       ZblibDriverType_e driver_type)
 {
        ZigBeeDriver *driver = NULL;
 
@@ -39,11 +43,11 @@ ZigBeeDriver *zblib_driver_new(ZigBeePlugin *plugin,
        driver = g_malloc0(sizeof(ZigBeeDriver));
 
        /* Update fields */
-       driver->object_type = object_type;
-       driver->object_name = g_strdup(object_name);
+       driver->driver_type = driver_type;
+       driver->driver_name = g_strdup(driver_name);
        driver->plugin = plugin;
 
-       Z_LOGI("Driver created - Name [%s]", driver->object_name);
+       Z_LOGI("Driver created - Name [%s]", driver->driver_name);
 
        return driver;
 }
@@ -55,5 +59,68 @@ void zblib_driver_free(ZigBeeDriver *driver)
                return;
        }
 
-       Z_LOGI("Freeing Driver - Name [%p]", driver->object_name);
+       /* Invoke free hook */
+       if (driver->free_hook_fn)
+               driver->free_hook_fn(driver);
+
+       Z_LOGI("Freeing Driver - Name [%p]", driver->driver_name);
+
+       /* Free driver memory */
+       g_free(driver);
+}
+
+gboolean zblib_driver_link_object(ZigBeeDriver *driver, gpointer object)
+{
+       if (driver == NULL) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       driver->priv_object = object;
+
+       return TRUE;
+}
+
+gpointer zblib_driver_ref_object(ZigBeeDriver *driver)
+{
+       if (driver == NULL) {
+               Z_LOGE("driver is NULL");
+               return NULL;
+       }
+
+       return driver->priv_object;
+}
+
+gboolean zblib_driver_set_dispatcher(ZigBeeDriver *driver, ZblibDriverDispatcher_t dispatcher_fn)
+{
+       if (driver == NULL) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       driver->dispatcher_fn = dispatcher_fn;
+
+       return TRUE;
+}
+
+gboolean zblib_driver_set_free_hook(ZigBeeDriver *driver, ZblibDriverFreeHook_t free_hook_fn)
+{
+       if (driver == NULL) {
+               Z_LOGE("driver is NULL");
+               return FALSE;
+       }
+
+       driver->free_hook_fn = free_hook_fn;
+
+       return TRUE;
 }
+
+ZblibDriverType_e zblib_driver_ref_driver_type(ZigBeeDriver *driver)
+{
+       if (driver == NULL) {
+               Z_LOGE("driver is NULL");
+               return ZBLIB_DRIVER_TYPE_NONE;
+       }
+
+       return driver->driver_type;
+}
\ No newline at end of file