--- /dev/null
+Suresh Kumar N (suresh.n@samsung.com)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(zigbee-service C)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(UNITDIR ${UNIT_INSTALL_DIR})
+SET(INCLUDEDIR "\${prefix}/include")
+
+### Set required packages ###
+INCLUDE(FindPkgConfig)
+SET(zigbee_pkgs glib-2.0 dlog gio-2.0 gio-unix-2.0)
+
+pkg_check_modules(pkgs REQUIRED "${zigbee_pkgs}")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wcast-qual -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+
+### Address-Space Layout Randomization ###
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" ")
+ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG=1")
+ADD_DEFINITIONS("-DZIGBEE_DEFAULT_PLUGINS_PATH=\"/usr/lib/zigbee/plugins/\"")
+
+### Build ###
+ADD_SUBDIRECTORY(zigbee-client)
+ADD_SUBDIRECTORY(zigbee-daemon)
--- /dev/null
+Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
--- /dev/null
+ZigBee service/daemon
--- /dev/null
+/*
+ * 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_ALARM_TYPE_H__
+#define __ZIGBEE_ALARM_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for alarm structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char alarm_code; /**< Alarm code */
+ short cluster_id; /**< Cluster ID */
+} ZigbeeAlarmAlarm_t;
+
+/**
+ * @brief Definition for reset alarm structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char alarm_code; /**< Alarm code */
+ short cluster_id; /**< Cluster ID */
+} ZigbeeAlarmResetAlarm_t;
+
+/**
+ * @brief Definition for reset all alarm structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+} ZigbeeAlarmResetAllAlarm_t;
+
+/**
+ * @brief Definition for reset all alarm logs structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+} ZigbeeAlarmResetAlarmLogs_t;
+
+/**
+ * @brief Definition for get alarm count structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeAlarmGetAlarmCount_t;
+
+
+#endif /* __ZIGBEE_ALARM_TYPE_H__ */
--- /dev/null
+/*
+ * 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_CUSTOM_TYPE_H__
+#define __ZIGBEE_CUSTOM_TYPE_H__
+
+/**
+ * @brief Definition for custom send payload/data length (128).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_CUSTOM_SEND_PAYLOAD_LEN 128
+
+/**
+ * @brief Definition for APS send structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id;
+ char aps_frame_ctl;
+ char src_ep;
+ char dest_ep;
+ short cluster_id;
+ short profile_id;
+ char zcl_frame_ctl;
+ short mfg_code;
+ char payload[ZIGBEE_CUSTOM_SEND_PAYLOAD_LEN];
+} ZigbeeCustomApsSend_t;
+
+/**
+ * @brief Definition for ZCL send structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id;
+ char src_ep;
+ char dest_ep;
+ short cluster_id;
+ char zcl_frame_ctl;
+ char cmd_id;
+ char payload[ZIGBEE_CUSTOM_SEND_PAYLOAD_LEN];
+} ZigbeeCustomZclSend_t;
+
+/**
+ * @brief Definition for send to local structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char data[ZIGBEE_CUSTOM_SEND_PAYLOAD_LEN];
+} ZigbeeCustomSendToLocal_t;
+
+#endif /* __ZIGBEE_CUSTOM_TYPE_H__ */
--- /dev/null
+/*
+ * 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_DOOR_LOCK_TYPE_H__
+#define __ZIGBEE_DOOR_LOCK_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for maximum length of door lock pin (10).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_DOOR_LOCK_MAX_PIN_LEN 10
+
+/**
+ * @brief Definition for subscriber lock event structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeDoorLockSubscriberLockEvent_t;
+
+/**
+ * @brief Definition for set door lock pin structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short uid;
+ char ustatus;
+ char utype;
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+ char pin[ZIGBEE_DOOR_LOCK_MAX_PIN_LEN + 1];
+} ZigbeeDoorLockSetDoorLockPin_t;
+
+/**
+ * @brief Definition for set door lock state structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+ char pin[ZIGBEE_DOOR_LOCK_MAX_PIN_LEN + 1];
+ int lock_unlock_type;
+} ZigbeeDoorLockSetDoorLock_t;
+
+/**
+ * @brief Definition for get door lock state structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeDoorLockGetDoorLock_t;
+
+
+#endif /* __ZIGBEE_DOOR_LOCK_TYPE_H__ */
--- /dev/null
+/*
+ * 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_FAN_CONTROL_TYPE_H__
+#define __ZIGBEE_FAN_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for fan control set fan mode structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeFanControlSetFanMode_t;
+
+/**
+ * @brief Definition for fan control get fan mode structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeFanControlGetFanMode_t;
+
+/**
+ * @brief Definition for fan control set fan mode sequence structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeFanControlSetFanModeSequence_t;
+
+/**
+ * @brief Definition for fan control get fan mode sequence structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeFanControlGetFanModeSequence_t;
+
+#endif /* __ZIGBEE_FAN_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_LEVEL_CONTROL_TYPE_H__
+#define __ZIGBEE_LEVEL_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for level control move to level structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char level; /**< Level */
+ short transition; /**< Transition time */
+} ZigbeeLevelControlMoveToLevel_t;
+
+/**
+ * @brief Definition for level control move structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char move_mode; /**< Move mode */
+ char rate; /**< Rate of movement */
+} ZigbeeLevelControlMove_t;
+
+/**
+ * @brief Definition for level control step structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char step_mode; /**< Step mode */
+ char move_mode; /**< Move mode */
+ short transition_time; /**< Transition time */
+} ZigbeeLevelControlStep_t;
+
+/**
+ * @brief Definition for level control move to level with on/off structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char level; /**< Level */
+ short transition; /**< Transition time */
+} ZigbeeLevelControlMoveToLevelWithOnOff_t;
+
+/**
+ * @brief Definition for level control move with on/off structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char move_mode; /**< Move mode */
+ char rate; /**< Rate of movement */
+} ZigbeeLevelControlMoveOnOff_t;
+
+/**
+ * @brief Definition for level control step with on/off structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char step_mode; /**< Step mode */
+ char move_mode; /**< Move mode */
+ short transition_time; /**< Transition time */
+} ZigbeeLevelControlStepWithOnOff_t;
+
+/**
+ * @brief Definition for level control stop structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+} ZigbeeLevelControlStop_t;
+
+#endif /* __ZIGBEE_LEVEL_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_MFGLIB_CONTROL_TYPE_H__
+#define __ZIGBEE_MFGLIB_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for size of mfglib control packet content (1024).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_MFGLIB_CONTROL_PACKET_CONTENT_LEN 1024
+
+/**
+ * @brief Definition for mfglib control start structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char mfglib_start; /**< 1 - Start, 0 - Stop */
+} ZigbeeMfglibControlStart_t;
+
+/**
+ * @brief Definition for structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlEnd_t;
+
+/**
+ * @brief Definition for mfglib control start tone structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlStartTone_t;
+
+/**
+ * @brief Definition for mfglib control stop tone structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlStopTone_t;
+
+/**
+ * @brief Definition for mfglib control start stream structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlStartStream_t;
+
+/**
+ * @brief Definition for mfglib control stop stream structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlStopStream_t;
+
+/**
+ * @brief Definition for mfglib control send packet structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char packet_content[ZIGBEE_MFGLIB_CONTROL_PACKET_CONTENT_LEN]; /**< Packet content */
+ int packet_length; /**< Packet length */
+} ZigbeeMfglibControlSendPacket_t;
+
+/**
+ * @brief Definition for mfglib control set channel structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char channel; /**< Channel */
+} ZigbeeMfglibControlSetChannel_t;
+
+/**
+ * @brief Definition for mfglib control get channel structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlGetChannel_t;
+
+/**
+ * @brief Definition for mfglib control set power structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ short tx_power_mode; /**< TX power mode */
+ short power; /**< Power */
+} ZigbeeMfglibControlSetPower_t;
+
+/**
+ * @brief Definition for mfglib control get power structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlGetPower_t;
+
+/**
+ * @brief Definition for mfglib control set syn offset structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char channel; /**< Test channel */
+} ZigbeeMfglibControlSetSynOffset_t;
+
+/**
+ * @brief Definition for mfglib control get syn offset structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char packet[ZIGBEE_MFGLIB_CONTROL_PACKET_CONTENT_LEN]; /**< Packet */
+ int packet_length; /**< Packet length */
+ char link_quality; /**< Link quality */
+ char rssi; /**< RSSI */
+} ZigbeeMfglibControlGetSynOffset_t;
+
+/**
+ * @brief Definition for mfglib control RX start structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlRxStart_t;
+
+/**
+ * @brief Definition for mfglib control RX stop structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlRxStop_t;
+
+/**
+ * @brief Definition for mfglib control RX verify structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlRxVerify_t;
+
+/**
+ * @brief Definition for mfglib control get rssi structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeMfglibControlGetRssi_t;
+
+#endif /* __ZIGBEE_MFGLIB_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ON_OFF_TYPE_H__
+#define __ZIGBEE_ON_OFF_TYPE_H__
+
+/**
+ * @brief Definition for on/off set on/off structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char on_off_type; /**< ON/OFF type */
+} ZigbeeOnOffSetOnOff_t;
+
+/**
+ * @brief Definition for on/off get on/off state structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+} ZigbeeOnOffGetOnOffState_t;
+
+#endif /* __ZIGBEE_ON_OFF_TYPE_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_TYPE_H__
+#define __ZIGBEE_SERVICE_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for service coex start structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char channel; /**< Channel */
+} ZigbeeServiceCoexStart_t;
+
+/**
+ * @brief Definition for service permit join structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char permit_join; /* 1 - Allow, 0 - Disallow */
+ int duration; /**< Duration */
+} ZigbeeServicePermitJoin_t;
+
+/**
+ * @brief Definition for service leave request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char remove_child; /* Remove child */
+ char rejoin; /**< Re-join */
+} ZigbeeServiceLeaveRequest_t;
+
+/**
+ * @brief Definition for service get endpoint list structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeServiceGetEndpointList_t;
+
+/**
+ * @brief Definition for service get cluster list structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeServiceGetClusterList_t;
+
+/**
+ * @brief Definition for service get node type structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+} ZigbeeServiceGetNodeType_t;
+
+#endif /* __ZIGBEE_SERVICE_TYPE_H__ */
--- /dev/null
+/*
+ * 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_THERMOSTAT_TYPE_H__
+#define __ZIGBEE_THERMOSTAT_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for maximum size of thermostat payload (128).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_THERMSTAT_PAYLOAD_MAX_LEN 128
+
+/**
+ * @brief Definition for thermostat get local temperature structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeThermostatGetLocalTemp_t;
+
+/**
+ * @brief Definition for thermostat get weekly schedule structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+ char num_of_days; /**< Number of days */
+ char mode; /**< Mode */
+} ZigbeeThermostatGetWeeklySchedule_t;
+
+/**
+ * @brief Definition for thermostat set weekly schedule structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+ char no_of_transitions; /**< Number of transitions */
+ char num_of_days; /**< Number of days */
+ char mode; /**< Mode */
+ char payload[ZIGBEE_THERMSTAT_PAYLOAD_MAX_LEN]; /**< Payload */
+ char payload_len; /**< Payload length */
+} ZigbeeThermostatSetWeeklySchedule_t;
+
+/**
+ * @brief Definition for thermostat clear weekly schedule structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char endpoint; /**< Endpoint */
+} ZigbeeThermostatClearWeeklySchedule_t;
+
+/**
+ * @brief Definition for thermostat setpoint raise lower structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+ char mode; /**< Mode */
+ char amount; /**< Amount */
+} ZigbeeThermostatSetpointRaiseLower_t;
+
+#endif /* __ZIGBEE_THERMOSTAT_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCL_COLOR_TYPE_H__
+#define __ZIGBEE_ZCL_COLOR_TYPE_H__
+
+/**
+ * @brief Definition for Zcl color move to hue structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char hue; /**< Hue */
+ char direction; /**< Direction */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorMoveToHue_t;
+
+/**
+ * @brief Definition for Zcl color move hue structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char move_mode; /**< Move mode */
+ char rate; /**< Rate */
+} ZigbeeZclColorMoveHue_t;
+
+/**
+ * @brief Definition for Zcl color step hue structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char step_mode; /**< Step mode */
+ char step_zize; /**< Step size */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorStepHue_t;
+
+/**
+ * @brief Definition for Zcl color move to staturation structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char saturation; /**< Saturation */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorMoveToSaturation_t;
+
+/**
+ * @brief Definition for Zcl color move staturation structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char move_mode; /**< Move mode */
+ char rate; /**< Rate */
+} ZigbeeZclColorMoveSaturation_t;
+
+/**
+ * @brief Definition for Zcl color step saturation structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char step_mode; /**< Step mode */
+ char step_zize; /**< Step size */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorStepSaturation_t;
+
+/**
+ * @brief Definition for Zcl color move to hue and saturation structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char hue; /**< Hue */
+ char saturation; /**< Saturation */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorMoveToHueAndSaturation_t;
+
+/**
+ * @brief Definition for Zcl color move to color structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short color_x; /**< Color X */
+ short color_y; /**< Color Y */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorMoveToColor_t;
+
+/**
+ * @brief Definition for Zcl color move color structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short rate_x; /**< Rate X */
+ short rate_y; /**< Rate Y */
+} ZigbeeZclColorMoveColor_t;
+
+/**
+ * @brief Definition for Zcl color step color structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short rate_x; /**< Rate X */
+ short rate_y; /**< Rate Y */
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorStepColor_t;
+
+/**
+ * @brief Definition for Zcl color move color temperature structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short color_temperature; /**< Color temperature*/
+ short transition_time; /**< Transtion time */
+} ZigbeeZclColorMoveColorTemperature_t;
+
+#endif /* __ZIGBEE_ZCL_COLOR_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCL_GROUP_TYPE_H__
+#define __ZIGBEE_ZCL_GROUP_TYPE_H__
+
+/**
+ * @brief Definition for maximum size of Zcl group name (16).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_ZCL_GROUP_NAME_MAX_LEN 16
+
+/**
+ * @brief Definition for Zcl group add group structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char group_name[ZIGBEE_ZCL_GROUP_NAME_MAX_LEN + 1]; /**< Group name (NULL terminated) */
+} ZigbeeZclGroupAddGroup_t;
+
+/**
+ * @brief Definition for Zcl group view group structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclGroupViewGroup_t;
+
+/**
+ * @brief Definition for Zcl group get group membership structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char group_count; /**< Group count */
+ short *group_list; /**< Group list */
+} ZigbeeZclGroupGetGroupMembership_t;
+
+/**
+ * @brief Definition for Zcl group remove group structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+} ZigbeeZclGroupRemoveGroup_t;
+
+/**
+ * @brief Definition for Zcl group remove all group structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclGroupRemoveAllGroup_t;
+
+/**
+ * @brief Definition for Zcl group add group if identifying structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char group_name[ZIGBEE_ZCL_GROUP_NAME_MAX_LEN + 1]; /**< Group name (NULL terminated) */
+} ZigbeeZclGroupAddGroupIfIdentifying_t;
+
+#endif /* __ZIGBEE_ZCL_GROUP_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCL_POLL_CONTROL_TYPE_H__
+#define __ZIGBEE_ZCL_POLL_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for Zcl poll control check in response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char start_fast_polling; /**< Start fast polling */
+ short fast_poll_timeout; /**< Fast poll timeout */
+} ZigbeeZclPollControlCheckInResponse_t;
+
+/**
+ * @brief Definition for Zcl poll control fast poll stop structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclPollControlFastPollStop_t;
+
+/**
+ * @brief Definition for Zcl poll control set long poll interval structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ unsigned int new_long_poll_interval; /**< New long poll interval */
+} ZigbeeZclPollControlSetLongPollInterval_t;
+
+/**
+ * @brief Definition for Zcl poll control set short poll interval structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ unsigned int new_short_poll_interval; /**< New short poll interval */
+} ZigbeeZclPollControlSetShortPollInterval_t;
+
+#endif /* __ZIGBEE_ZCL_POLL_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCL_SCENE_TYPE_H__
+#define __ZIGBEE_ZCL_SCENE_TYPE_H__
+
+/**
+ * @brief Definition for maximum size of Zcl scene name (16).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_ZCL_SCENE_NAME_MAX_LEN 16
+
+/**
+ * @brief Definition for Zcl scene add scene structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char scene_id; /**< Scene ID */
+ short transition_time; /**< Transition time */
+ char scene_name[ZIGBEE_ZCL_SCENE_NAME_MAX_LEN + 1]; /**< Scene name (NULL terminated */
+ short ext_field_set_len; /**< Extended field set length */
+ short *ext_field_set; /**< Extended field set */
+} ZigbeeZclSceneAddScene_t;
+
+/**
+ * @brief Definition for Zcl scene view scene structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char scene_id; /**< Scene ID */
+} ZigbeeZclSceneViewScene_t;
+
+/**
+ * @brief Definition for Zcl scene remove scene structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char scene_id; /**< Scene ID */
+} ZigbeeZclSceneRemoveScene_t;
+
+/**
+ * @brief Definition for Zcl scene store scene structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char scene_id; /**< Scene ID */
+} ZigbeeZclSceneStoreScene_t;
+
+/**
+ * @brief Definition for Zcl scene recall scene structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+ char scene_id; /**< Scene ID */
+} ZigbeeZclSceneRecallScene_t;
+
+/**
+ * @brief Definition for Zcl scene remove all scene structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+} ZigbeeZclSceneRemoveAllScene_t;
+
+/**
+ * @brief Definition for Zcl scene get scene membership structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short group_id; /**< Group ID */
+} ZigbeeZclSceneGetSceneMembership_t;
+
+#endif /* __ZIGBEE_ZCL_SCENE_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCLBASIC_CONTROL_TYPE_H__
+#define __ZIGBEE_ZCLBASIC_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for Zclbasic control reset factort default structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclbasicControlResetFactoryDefault_t;
+
+#endif /* __ZIGBEE_ZCLBASIC_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCLGLOBAL_CONTROL_TYPE_H__
+#define __ZIGBEE_ZCLGLOBAL_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for Zclglobal control read attributes request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *attribute_id; /**< Atttribute ID */
+ int attribute_id_len; /**< Atttribute ID length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlReadAttributesRequest_t;
+
+/**
+ * @brief Definition for Zclglobal control write attributes request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *write_records; /**< Write records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlWriteAttributesRequest_t;
+
+/**
+ * @brief Definition for Zclglobal control write attributes undividied request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *write_records; /**< Write records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlWriteAttributesUndividedRequest_t;
+
+/**
+ * @brief Definition for Zclglobal control write attributes no response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *write_records; /**< Write records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlWriteAttributesNoResponse_t;
+
+/**
+ * @brief Definition for Zclglobal control write attritbutes structured structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *write_records; /**< Write records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlWriteAttributesStructed_t;
+
+/**
+ * @brief Definition forZclglobal control read attributes structured structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *read_records; /**< Read records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlReadAttributesStructed_t;
+
+/**
+ * @brief Definition for Zclglobal control configure reporting request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *read_records; /**< Read records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlConfigureReportingReq_t;
+
+/**
+ * @brief Definition for Zclglobal control read configure reporting structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char *read_records; /**< Read records */
+ int records_len; /**< Records length */
+ short node_id; /**< Node ID */
+ char cluster_id; /**< Cluster ID */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char src_ep; /**< Source endpoint */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZclglobalControlReadConfigureReporting_t;
+
+/**
+ * @brief Definition for Zclglobal control discover attributes structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char cluster_id; /**< Cluster ID */
+ char start_attribute; /**< Start attribute */
+ char max; /**< Maximum */
+} ZigbeeZclglobalControlDiscoverAttributes_t;
+
+/**
+ * @brief Definition for Zclglobal control discover attributes extended structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char cluster_id; /**< Cluster ID */
+ char start_attribute; /**< Start attribute */
+ char max; /**< Maximum */
+} ZigbeeZclglobalControlDiscoverAttributesExtended_t;
+
+/**
+ * @brief Definition for Zclglobal control discover commands received structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char cluster_id; /**< Cluster ID */
+ char start_attribute; /**< Start attribute */
+ char max; /**< Maximum */
+} ZigbeeZclglobalControlDiscoverCommandsReceived_t;
+
+/**
+ * @brief Definition for Zclglobal control discover commands generated structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char zcl_frame_ctrl; /**< ZCL frame control */
+ char cluster_id; /**< Cluster ID */
+ char start_attribute; /**< Start attribute */
+ char max; /**< Maximum */
+} ZigbeeZclglobalControlDiscoverCommandsGenerated_t;
+
+
+#endif /* __ZIGBEE_ZCLGLOBAL_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCLIAS_CONTROL_TYPE_H__
+#define __ZIGBEE_ZCLIAS_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for Zclias control enrol response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ char enroll_code; /**< Enrol code */
+ char zone_id; /**< Zone ID */
+} ZigbeeZcliasControlEnrolResponse_t;
+
+#endif /* __ZIGBEE_ZCLIAS_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZCLIDENTIFY_CONTROL_TYPE_H__
+#define __ZIGBEE_ZCLIDENTIFY_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for Zclidentify control identify structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char dest_ep; /**< Destination endpoint */
+ short identify_time; /**< Identify time */
+ char zone_id; /**< Zone ID */
+} ZigbeeZclidentifyControlIdentify_t;
+
+#endif /* __ZIGBEE_ZCLIDENTIFY_CONTROL_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZDO_BIND_TYPE_H__
+#define __ZIGBEE_ZDO_BIND_TYPE_H__
+
+/**
+ * @brief Definition for maximum size of Zdo bind address length in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN 8
+
+/**
+ * @brief Definition for Zdo bind bind request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char src_addr[ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1]; /**< Source address */
+ char src_ep; /**< Source endpoint */
+ short cluster_id; /**< Cluster ID */
+ char dst_addr[ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1]; /**< Destination address */
+ char bind_type; /**< Bind type */
+ short group_addr; /**< Group address */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZdoBindBindReq_t;
+
+/**
+ * @brief Definition for Zdo bind unbind request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char src_addr[ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1]; /**< Source address */
+ char src_ep; /**< Source endpoint */
+ short cluster_id; /**< Cluster ID */
+ char dst_addr[ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1]; /**< Destination address */
+ char bind_type; /**< Bind type */
+ short group_addr; /**< Group address */
+ char dest_ep; /**< Destination endpoint */
+} ZigbeeZdoBindUnbindReq_t;
+
+#endif /* __ZIGBEE_ZDO_BIND_TYPE_H__ */
--- /dev/null
+/*
+ * 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_ZDODEV_CONTROL_TYPE_H__
+#define __ZIGBEE_ZDODEV_CONTROL_TYPE_H__
+
+/**
+ * @brief Definition for size of EUI64 (an IEEE address) in bytes (8).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_EUI64_SIZE 8
+
+/**
+ * @brief Definition for maximum size of Zdodev control user
+ * descriptor length in bytes (16).
+ * @since_tizen 3.0
+ */
+#define ZIGBEE_ZDODEV_CONTROL_USER_DECRIPTOR_MAX_LEN 16
+
+/**
+ * @brief Definition for Zdodev control network address request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */
+ char request_type; /**< Request type */
+ char start_index; /**< Start index */
+} ZigbeeZdodevControlNwkAddrReq_t;
+
+/**
+ * @brief Definition for Zdodev control matched descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ short profile_id; /**< Profile ID */
+ char num_in_cl; /**< Number of int CL */
+ char *in_cl; /**< In CL */
+ char num_out_cl; /**< Number of out CL */
+ char *out_cl; /**< Out CL */
+ char request_type; /**< Request type */
+ char start_index; /**< Start index */
+} ZigbeeZdodevControlMatchedDescriptorReq_t;
+
+/**
+ * @brief Definition for Zdodev control IEEE address request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+} ZigbeeZdodevControlIeeeAddrReq_t;
+
+/**
+ * @brief Definition for Zdodev control active endpoint structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+} ZigbeeZdodevControlActiveEpReq_t;
+
+/**
+ * @brief Definition for Zdodev control node descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+} ZigbeeZdodevControlNodeDescriptorReq_t;
+
+/**
+ * @brief Definition for Zdodev control power descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+} ZigbeeZdodevControlPowerDescriptorReq_t;
+
+/**
+ * @brief Definition for Zdodev control complex descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+} ZigbeeZdodevControlComplexDescriptorReq_t;
+
+/**
+ * @brief Definition for Zdodev control user descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+} ZigbeeZdodevControlUserDescriptorReq_t;
+
+/**
+ * @brief Definition for Zdodev control user descriptor set request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char user_descriptor_len; /**< User descriptor length */
+ char user_descriptor[ZIGBEE_ZDODEV_CONTROL_USER_DECRIPTOR_MAX_LEN];
+ /**< User descriptor */
+} ZigbeeZdodevControlUserDescriptorSetReq_t;
+
+/**
+ * @brief Definition for Zdodev control device announce structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char mac_addr[ZIGBEE_EUI64_SIZE]; /**< MAC address */
+ char capability; /**< Capability */
+} ZigbeeZdodevControlDeviceAnnounce_t;
+
+/**
+ * @brief Definition for Zdodev control simple descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char endpoint; /**< Endpoint */
+} ZigbeeZdodevControlSimpleDescriptorReq_t;
+
+/**
+ * @brief Definition for Zdodev control management LQI request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char start_index; /**< Start index */
+} ZigbeeZdodevControlMgmtLqiReq_t;
+
+/**
+ * @brief Definition for Zdodev control management RTG request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char start_index; /**< Start index */
+} ZigbeeZdodevControlMgmtRtgReq_t;
+
+/**
+ * @brief Definition for Zdodev control management bind request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ char start_index; /**< Start index */
+} ZigbeeZdodevControlMgmtBindReq_t;
+
+/**
+ * @brief Definition for Zdodev control management permit join request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short addr; /**< Address */
+ char duration; /**< Duration */
+ char tc_significance; /**< TC significance */
+} ZigbeeZdodevControlMgmtPermitJoinReq_t;
+
+/**
+ * @brief Definition for Zdodev control network update request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ unsigned int scan_channel; /**< Scan channel */
+ char scan_duration; /**< Scan duration */
+ char scan_count; /**< Scan count */
+ char network_update_id; /**< Network update ID */
+} ZigbeeZdodevControlNwkUpdateReq_t;
+
+/**
+ * @brief Definition for Zdodev control network descriptor request structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ short node_id; /**< Node ID */
+ unsigned int scan_channel; /**< Scan channel */
+ char scan_duration; /**< Scan duration */
+ short scan_count; /**< Scan count */
+ char start_index; /**< Start index */
+} ZigbeeZdodevControlNwkDescriptorReq_t;
+
+#endif /* __ZIGBEE_ZDODEV_CONTROL_TYPE_H__ */
--- /dev/null
+%define major 0
+%define minor 0
+%define patchlevel 1
+
+Name: zigbee-manager
+Version: %{major}.%{minor}.%{patchlevel}
+Release: 1
+License: Apache-2.0
+Summary: ZigBee Daemon
+Group: System/Network
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(gio-unix-2.0)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(vconf)
+
+%description
+Description: ZigBee Daemon
+
+%package -n zigbee-lib
+Summary: ZigBee library
+Group: System/Libraries
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(dlog)
+
+%description -n zigbee-lib
+ZigBee library
+
+%package -n zigbee-lib-devel
+Summary: ZigBee library (devel)
+Group: System/Libraries
+Requires: %{name} = %{version}
+
+%description -n zigbee-lib-devel
+ZigBee library (devel)
+
+%package -n zigbee-client
+Summary: ZigBee Client API
+Group: System/Libraries
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(dlog)
+
+%description -n zigbee-client
+ZigBee Client library
+
+%package -n zigbee-client-devel
+Summary: ZigBee Client API (devel)
+Group: System/Libraries
+Requires: %{name} = %{version}
+
+%description -n zigbee-client-devel
+ZigBee Client library (devel)
+
+%prep
+%setup -q
+
+%build
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=%{version} \
+
+make %{?_smp_mflags}
+
+%install
+
+%make_install
+
+mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+ln -s %{_libdir}/systemd/system/zigbee-daemon.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/zigbee-daemon.service
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest zigbee-daemon.manifest
+%defattr(644,system,system,-)
+%attr(755,system,system) %{_bindir}/zigbee-daemon
+%{_libdir}/systemd/system/zigbee-daemon.service
+%{_libdir}/systemd/system/multi-user.target.wants/zigbee-daemon.service
+%{_datadir}/license/zigbee-daemon
+
+%files -n zigbee-client
+#%manifest zigbee-client/zigbee-client.manifest
+%defattr(644,system,system,-)
+%{_libdir}/libzigbee-client.so*
+%{_datadir}/license/zigbee-client
+#%attr(755,system,system) %{_testbindir}/zigbeetest
+
+%files -n zigbee-client-devel
+%defattr(644,system,system,-)
+%{_includedir}/zigbee/client/*.h
+%{_includedir}/zigbee/common/*.h
+%{_libdir}/pkgconfig/zigbee-client.pc
+%{_libdir}/libzigbee-client.so
+
+%files -n zigbee-lib
+#%manifest lib-zigbee/lib-zigbee.manifest
+%defattr(644,system,system,-)
+%{_libdir}/libzigbee-lib.so*
+%{_datadir}/license/zigbee-lib
+
+%files -n zigbee-lib-devel
+%defattr(644,system,system,-)
+%{_includedir}/zigbee/lib/*.h
+%{_includedir}/zigbee/common/*.h
+%{_libdir}/pkgconfig/zigbee-lib.pc
+%{_libdir}/libzigbee-lib.so
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(zigbee-client C)
+
+MESSAGE(===================================================================)
+MESSAGE(Building...zigbee-client)
+MESSAGE(===================================================================)
+
+### Set required packages ###
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED glib-2.0 dlog)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ MESSAGE(flag-${flag})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ MESSAGE(EXTRA_CFLAGS-${EXTRA_CFLAGS})
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs -fvisibility=hidden ")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Wredundant-decls -Wcast-align")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
+
+### Include directories ###
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/common/include
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/include_private
+)
+
+MESSAGE(${CMAKE_C_FLAGS})
+MESSAGE(${CMAKE_EXE_LINKER_FLAGS})
+MESSAGE(${pkgs_LDFLAGS})
+
+### Build Sources ###
+SET(SRCS
+ src/zigbee_client.c
+ src/zigbee_log.c
+)
+
+### Add Library - zigbee-client ###
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION 0.0.0 SOVERSION 0 OUTPUT_NAME ${PROJECT_NAME})
+
+### pkgconfig file ###
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+CONFIGURE_FILE(zigbee-client.pc.in zigbee-client.pc @ONLY)
+
+### Install files ###
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include/zigbee/client)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/common/include/ DESTINATION include/zigbee/common)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zigbee-client.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME zigbee-client)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT Runtime)
+IF (TIZEN_ENGINEER_MODE)
+ADD_SUBDIRECTORY(test_src)
+ENDIF (TIZEN_ENGINEER_MODE)
--- /dev/null
+Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
--- /dev/null
+/*
+ * 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_CLIENT_H__
+#define __ZIGBEE_CLIENT_H__
+
+#endif /* __ZIGBEE_CLIENT_H__ */
--- /dev/null
+/*
+ * 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_LOG_H__
+#define __ZIGBEE_LOG_H__
+
+#include <glib.h>
+
+#define TIZEN_DEBUG_ENABLE
+
+#ifndef ZIGBEE_LOG_TAG
+#define ZIGBEE_LOG_TAG "UNKNOWN"
+#endif
+
+enum zigbee_log_type {
+ ZIGBEE_LOG_TYPE_MAIN = 0,
+ ZIGBEE_LOG_TYPE_RADIO,
+ ZIGBEE_LOG_TYPE_SYSTEM,
+ ZIGBEE_LOG_TYPE_TIME_CHECK
+};
+
+enum zigbee_log_priority {
+ ZIGBEE_LOG_UNKNOWN = 0,
+ ZIGBEE_LOG_DEFAULT,
+ ZIGBEE_LOG_VERBOSE,
+ ZIGBEE_LOG_DEBUG,
+ ZIGBEE_LOG_INFO,
+ ZIGBEE_LOG_WARN,
+ ZIGBEE_LOG_ERROR,
+ ZIGBEE_LOG_FATAL,
+ ZIGBEE_LOG_SILENT
+};
+
+void zigbee_log(enum zigbee_log_type type, enum zigbee_log_priority priority, const char *tag, const char *fmt, ...);
+
+/* Logs would be available in system logs */
+#define Z_LOGI(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_INFO, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGM(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_INFO, ZIGBEE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define Z_LOGD(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_DEBUG, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGW(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_WARN, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGE(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_ERROR, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGF(fmt,args...) do { zigbee_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_FATAL, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+
+#endif /* __ZIGBEE_LOG_H__ */
--- /dev/null
+/*
+ * 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 <zigbee_client.h>
+
--- /dev/null
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <dlog.h>
+
+#include <zigbee_log.h>
+
+#define BUFFER_SIZE 1024
+
+void zigbee_log(enum zigbee_log_type type, enum zigbee_log_priority priority, const char *tag, const char *fmt, ...)
+{
+ va_list ap;
+ char buf[BUFFER_SIZE];
+ int log_id = LOG_ID_RADIO;
+
+ switch (type) {
+ case ZIGBEE_LOG_TYPE_SYSTEM: {
+ if (priority >= ZIGBEE_LOG_INFO) {
+ va_start(ap, fmt);
+ vsnprintf(buf, BUFFER_SIZE-1, fmt, ap);
+ va_end(ap);
+ __dlog_print(log_id, priority, tag, "%s", buf);
+ } else {
+#ifdef TIZEN_DEBUG_ENABLE
+ va_start(ap, fmt);
+ vsnprintf(buf, BUFFER_SIZE-1, fmt, ap);
+ va_end(ap);
+ __dlog_print(log_id, priority, tag, "%s", buf);
+#endif
+ }
+ }
+ break;
+
+ case ZIGBEE_LOG_TYPE_TIME_CHECK: {
+#ifdef TIZEN_DEBUG_ENABLE /* User Mode should not log performance data */
+ float a = 0.00, b = 0.00;
+ int next = 0;
+ FILE *fp = fopen("/proc/uptime", "r");
+ if (NULL == fp) {
+ Z_LOGE("fopen() failed");
+ return;
+ }
+ if (fscanf(fp, "%f %f", &a, &b) != 1)
+ next = snprintf(buf, BUFFER_SIZE, "[UPTIME] [Not Set] ");
+ else
+ next = snprintf(buf, BUFFER_SIZE, "[UPTIME] %f ", a);
+ fclose(fp);
+ if (next < 0)
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(buf + next, (BUFFER_SIZE-1) - next, fmt, ap);
+ va_end(ap);
+ __dlog_print(log_id, priority, tag, "%s", buf);
+#endif
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
--- /dev/null
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: ZigBee Client Library
+Description: ZigBee DBUS Client
+Version: 0.1
+Requires: glib-2.0 gobject-2.0
+Libs: -L${libdir} -lzigbee-client
+Cflags: -I${includedir}/zigbee/client -I${includedir}/zigbee/common
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(zigbee-daemon C)
+
+MESSAGE(===================================================================)
+MESSAGE(Building...)
+MESSAGE(===================================================================)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(UNITDIR ${UNIT_INSTALL_DIR})
+SET(INCLUDEDIR "\${prefix}/include")
+
+# Set required packages
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wcast-qual -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+
+##Address-Space Layout Randomization
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+ADD_DEFINITIONS("-DZIGBEE_LOG_TAG=\"ZIGBEE-SVC\"")
+
+IF (TIZEN_DEBUG_ENABLE)
+ ADD_DEFINITIONS ("-DTIZEN_DEBUG_ENABLE")
+ENDIF (TIZEN_DEBUG_ENABLE)
+
+MESSAGE(${CMAKE_C_FLAGS})
+MESSAGE(${pkgs_LDFLAGS})
+
+### Include directories ###
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/zigbee-lib/include
+ ${CMAKE_SOURCE_DIR}/common/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/zigbee-service/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/zigbee-interface/include
+
+)
+
+### Sources ###
+SET(SRCS
+ src/main.c
+)
+
+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
+)
+
+### Sub-directotries ###
+ADD_SUBDIRECTORY(zigbee-lib)
+ADD_SUBDIRECTORY(zigbee-service)
+ADD_SUBDIRECTORY(zigbee-interface)
+
+### Binary build ###
+### zigbee-lib ###
+ADD_LIBRARY(zigbee-lib SHARED ${ZIGBEE_LIB_SRCS})
+TARGET_LINK_LIBRARIES(zigbee-lib PRIVATE ${pkgs_LDFLAGS} "-ldl")
+SET_TARGET_PROPERTIES(zigbee-lib PROPERTIES VERSION 0.0.0 SOVERSION 0 OUTPUT_NAME zigbee-lib)
+
+### zigbee-daemon ###
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS} ${ZIGBEE_LIB_SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} zigbee-service zigbee-interface ${pkgs_LDFLAGS} "-ldl")
+
+### Install files ###
+INSTALL(TARGETS zigbee-lib DESTINATION lib COMPONENT Runtime)
+INSTALL(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME zigbee-daemon)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/resources/zigbee-daemon.service DESTINATION /usr/lib/systemd/system)
+
--- /dev/null
+Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
--- /dev/null
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <zblib.h>
+#include <zblib_service.h>
+#include <zblib_plugin.h>
+
+#include <zigbee_service_interface.h>
+#include <zigbee_service.h>
+
+#define NOTUSED(var) (var = var)
+
+/**< ZigBee Service */
+ZigBeeService *zigbee_service;
+
+int main(int arg, char **argv)
+{
+ ZigBeeService *service = NULL;
+ int ret_code = 0;
+ gboolean ret;
+
+#if !GLIB_CHECK_VERSION(2, 35, 0)
+ g_type_init();
+#endif
+#if !GLIB_CHECK_VERSION(2, 31, 0)
+ g_thread_init(NULL);
+#endif
+ NOTUSED(arg);
+ NOTUSED(argv);
+
+ Z_LOGI("service mainloop start");
+
+ /* Create ZigBee service */
+ zigbee_service = service = zblib_service_new();
+
+ /* Initialize ZigBee service interface layer */
+ ret = zigbee_service_interface_init(service);
+ if (G_UNLIKELY(FALSE == ret)) {
+ Z_LOGE("zigbee_service_interface_init failed!");
+ goto END;
+ }
+
+ /* Initialize ZigBee service */
+ ret = zigbee_service_init(service);
+ if (G_UNLIKELY(FALSE == ret)) {
+ Z_LOGE("zigbee_service_init failed!");
+ goto END;
+ }
+
+ /* Run ZigBee service */
+ ret = zblib_service_run(service);
+ if (G_UNLIKELY(FALSE == ret)) {
+ Z_LOGE("Run service failed!");
+ ret_code = EXIT_FAILURE;
+ }
+
+END:
+ /* De-initialize ZigBee service */
+ zigbee_service_deinit(service);
+
+ /* De-initialize ZigBee service interface layer */
+ zigbee_service_interface_deinit(service);
+
+ /* Free ZigBee service */
+ zblib_service_free(service);
+ zigbee_service = NULL;
+
+ return ret_code;
+}
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(zigbee-interface C)
+
+MESSAGE(===================================================================)
+MESSAGE(Building...zigbee-interface)
+MESSAGE(===================================================================)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(UNITDIR ${UNIT_INSTALL_DIR})
+SET(INCLUDEDIR "\${prefix}/include")
+
+# Set required packages
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0 dlog)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wcast-qual -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+
+##Address-Space Layout Randomization
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+ADD_DEFINITIONS("-DZIGBEE_LOG_TAG=\"ZIGBEE-SVC\"")
+
+IF (TIZEN_DEBUG_ENABLE)
+ ADD_DEFINITIONS ("-DTIZEN_DEBUG_ENABLE")
+ENDIF (TIZEN_DEBUG_ENABLE)
+
+MESSAGE(${CMAKE_C_FLAGS})
+MESSAGE(${pkgs_LDFLAGS})
+
+### Include directories ###
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_BINARY_DIR}/
+ ${CMAKE_CURRENT_SOURCE_DIR}/../zigbee-lib/include
+ ${CMAKE_SOURCE_DIR}/common/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/../zigbee-service/include
+)
+
+SET(INTROSPECTION_PATH ${CMAKE_CURRENT_SOURCE_DIR}/introspection)
+
+### Generate GDBus .c/.h ###
+ADD_CUSTOM_COMMAND(
+ WORKING_DIRECTORY
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zigbee_generated_code.c
+ COMMAND gdbus-codegen
+ --interface-prefix org.tizen.zigbee.
+ --generate-c-code zigbee_generated_code
+ --c-namespace Zigbee
+ --c-generate-object-manager --generate-docbook zigbee-generated-docs
+ ${INTROSPECTION_PATH}/manager.xml
+ ${INTROSPECTION_PATH}/service.xml
+ ${INTROSPECTION_PATH}/on_off.xml
+ ${INTROSPECTION_PATH}/door_lock.xml
+ ${INTROSPECTION_PATH}/level_control.xml
+ ${INTROSPECTION_PATH}/thermostat.xml
+ ${INTROSPECTION_PATH}/fan_control.xml
+ ${INTROSPECTION_PATH}/alarm.xml
+ ${INTROSPECTION_PATH}/mfglib_control.xml
+ ${INTROSPECTION_PATH}/zclglobal_control.xml
+ ${INTROSPECTION_PATH}/zdodev_control.xml
+ ${INTROSPECTION_PATH}/zclbasic_control.xml
+ ${INTROSPECTION_PATH}/zclidentify_control.xml
+ ${INTROSPECTION_PATH}/zclias_control.xml
+ ${INTROSPECTION_PATH}/zcl_poll_control.xml
+ ${INTROSPECTION_PATH}/zcl_group.xml
+ ${INTROSPECTION_PATH}/zcl_scene.xml
+ ${INTROSPECTION_PATH}/zdo_bind.xml
+ ${INTROSPECTION_PATH}/zcl_color.xml
+ ${INTROSPECTION_PATH}/custom.xml
+ COMMENT "Generating ZigBee GDBus .c/.h"
+)
+
+### Sources ###
+SET(ZIGBEE_INTERFACE_SRCS
+ ${CMAKE_CURRENT_BINARY_DIR}/zigbee_generated_code.c
+ src/zigbee_service_interface.c
+ src/zigbee_service_dbus_interface.c
+ src/zigbee_service_dbus_interface_alarm.c
+ src/zigbee_service_dbus_interface_custom.c
+ src/zigbee_service_dbus_interface_door_lock.c
+ src/zigbee_service_dbus_interface_fan_control.c
+ src/zigbee_service_dbus_interface_level_control.c
+ src/zigbee_service_dbus_interface_mfglib_control.c
+ src/zigbee_service_dbus_interface_on_off.c
+ src/zigbee_service_dbus_interface_service.c
+ src/zigbee_service_dbus_interface_thermostat.c
+ src/zigbee_service_dbus_interface_zclbasic_control.c
+ src/zigbee_service_dbus_interface_zcl_color.c
+ src/zigbee_service_dbus_interface_zclglobal_control.c
+ src/zigbee_service_dbus_interface_zcl_group.c
+ src/zigbee_service_dbus_interface_zclias_control.c
+ src/zigbee_service_dbus_interface_zclidentify_control.c
+ src/zigbee_service_dbus_interface_zcl_poll_control.c
+ src/zigbee_service_dbus_interface_zcl_scene.c
+ src/zigbee_service_dbus_interface_zdo_bind.c
+ src/zigbee_service_dbus_interface_zdodev_control.c
+)
+
+### Binary build ###
+### zigbee-service ###
+ADD_LIBRARY(${PROJECT_NAME} ${ZIGBEE_INTERFACE_SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE ${pkgs_LDFLAGS})
+
+### Install files ###
+#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT Runtime)
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_H__
+
+gboolean zigbee_service_dbus_interface_init(ZigBeeService *service);
+void zigbee_service_dbus_interface_deinit(ZigBeeService *service);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ALARM_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ALARM_H__
+
+gboolean zigbee_service_dbus_interface_alarm_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ALARM_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_CUSTOM_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_CUSTOM_H__
+
+gboolean zigbee_service_dbus_interface_custom_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_CUSTOM_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_DOOR_LOCK_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_DOOR_LOCK_H__
+
+gboolean zigbee_service_dbus_interface_door_lock_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_DOOR_LOCK_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_FAN_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_FAN_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_fan_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_FAN_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_LEVEL_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_LEVEL_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_level_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_LEVEL_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_MFGLIB_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_MFGLIB_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_mfglib_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_MFGLIB_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ON_OFF_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ON_OFF_H__
+
+gboolean zigbee_service_dbus_interface_on_off_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ON_OFF_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_SERVICE_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_SERVICE_H__
+
+gboolean zigbee_service_dbus_interface_service_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_SERVICE_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_THERMOSTAT_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_THERMOSTAT_H__
+
+gboolean zigbee_service_dbus_interface_thermostat_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_THERMOSTAT_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCL_COLOR_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_COLOR_H__
+
+gboolean zigbee_service_dbus_interface_zcl_color_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_COLOR_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCL_GROUP_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_GROUP_H__
+
+gboolean zigbee_service_dbus_interface_zcl_group_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_GROUP_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCL_POLL_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_POLL_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_zcl_poll_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_POLL_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCL_SCENE_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_SCENE_H__
+
+gboolean zigbee_service_dbus_interface_zcl_scene_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCL_SCENE_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCLBASIC_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLBASIC_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_zclbasic_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLBASIC_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCLGLOBAL_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLGLOBAL_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_zclglobal_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLGLOBAL_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCLIAS_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLIAS_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_zclias_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLIAS_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZCLIDENTIFY_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLIDENTIFY_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_zclidentify_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZCLIDENTIFY_CONTROL_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZDO_BIND_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZDO_BIND_H__
+
+gboolean zigbee_service_dbus_interface_zdo_bind_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZDO_BIND_H__ */
--- /dev/null
+/*
+ * 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_SERVICE_DBUS_INTERFACE_ZDODEV_CONTROL_H__
+#define __ZIGBEE_SERVICE_DBUS_INTERFACE_ZDODEV_CONTROL_H__
+
+gboolean zigbee_service_dbus_interface_zdodev_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object);
+
+#endif /* __ZIGBEE_SERVICE_DBUS_INTERFACE_ZDODEV_CONTROL_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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_SERVICE_INTERFACE_H__
+#define __ZIGBEE_SERVICE_INTERFACE_H__
+
+gboolean zigbee_service_interface_init(ZigBeeService *service);
+void zigbee_service_interface_deinit(ZigBeeService *service);
+
+#endif /* __ZIGBEE_SERVICE_INTERFACE_H__ */
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.alarm'>
+ <method name='get_alarm_count'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='reset_alarm'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='alarmcode' direction='in'/>
+ <arg type='q' name='cluster_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='reset_all_alarm'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='alarm'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='alarmcode' direction='in'/>
+ <arg type='y' name='cluster_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='reset_alarm_log'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_alarm'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+
+ <signal name='alarm_count'>
+ <arg type='q' name='alarm_count'/>
+ </signal>
+ <signal name='get_alarm_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='endpoint'/>
+ <arg type='y' name='status'/>
+ <arg type='y' name='alarm_code'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='u' name='timeStamp'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.custom'>
+ <method name='aps_send'>
+ <arg type='q' name='node_id' direction='in'/>
+ <arg type='y' name='aps_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='cluster_id' direction='in'/>
+ <arg type='q' name='profile_id' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='q' name='mfg_code' direction='in'/>
+ <arg type='ay' name='payload' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='zcl_send'>
+ <arg type='q' name='node_id' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='cluster_id' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='cmd_id' direction='in'/>
+ <arg type='ay' name='payload' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='send_to_local'>
+ <arg type='ay' name='data' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='aps_send_rsp'>
+ <arg type='q' name='node_id'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='dst_ep'/>
+ <arg type='q' name='cluster_id'/>
+ <arg type='q' name='profile_id'/>
+ <arg type='ay' name='payload'/>
+ <arg type='q' name='payload_len'/>
+ </signal>
+ <signal name='zcl_send_rsp'>
+ <arg type='q' name='node_id'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='dst_ep'/>
+ <arg type='q' name='cluster_id'/>
+ <arg type='q' name='profile_id'/>
+ <arg type='ay' name='payload'/>
+ <arg type='q' name='payload_len'/>
+ </signal>
+ <signal name='send_to_local_rsp'>
+ <arg type='ay' name='data'/>
+ <arg type='q' name='length'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.door_lock'>
+ <method name='subscribe_lock_event'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_door_lock_pin'>
+ <arg type='q' name='uid' direction='in'/>
+ <arg type='y' name='ustatus' direction='in'/>
+ <arg type='y' name='utype' direction='in'/>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='s' name='pin' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_door_lock'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='s' name='pin' direction='in'/>
+ <arg type='i' name='lock_unlock_type' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_lock_state'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='lock_state'>
+ <arg type='y' name='state'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.fan_control'>
+ <method name='set_fan_mode'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_fan_mode'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_fan_mode_sequence'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_fan_mode_sequence'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='fan_mode_level'>
+ <arg type='y' name='fan_level'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+gdbus-codegen --interface-prefix org.tizen.zigbee. \\r
+ --generate-c-code zigbee_generated_code \\r
+ --c-namespace Zigbee \\r
+ --c-generate-object-manager \\r
+ --generate-docbook generated-docs \\r
+ manager.xml \\r
+ service.xml \\r
+ on_off.xml \\r
+ door_lock.xml \\r
+ level_control.xml \\r
+ thermostat.xml \\r
+ fan_control.xml \\r
+ alarm.xml \\r
+ mfglib_control.xml \\r
+ zclglobal_control.xml \\r
+ zdodev_control.xml \\r
+ zclbasic_control.xml \\r
+ zclidentify_control.xml \\r
+ zclias_control.xml \\r
+ zcl_poll_control.xml \\r
+ zcl_group.xml \\r
+ zcl_scene.xml \\r
+ zdo_bind.xml \\r
+ zcl_color.xml \\r
+ custom.xml\r
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.level_control'>
+ <method name='move_to_level'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='level' direction='in'/>
+ <arg type='q' name='transition' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='move'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='move_mode' direction='in'/>
+ <arg type='y' name='rate' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='step'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='step_mode' direction='in'/>
+ <arg type='y' name='move_mode' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='move_to_level_with_on_off'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='level' direction='in'/>
+ <arg type='q' name='transition' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='move_with_on_off'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='move_mode' direction='in'/>
+ <arg type='y' name='rate' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='step_with_on_off'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='step_mode' direction='in'/>
+ <arg type='y' name='move_mode' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='stop'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='current_level'>
+ <arg type='y' name='level'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name="org.tizen.zigbee.manager">
+ <method name='get_zigbee_state'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='b' name='zigbee_state' direction='out'/>
+ </method>
+
+ <signal name='zigbee_state'>
+ <arg type='b' name='state'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.mfglib_control'>
+ <method name='start'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='b' name='mfglib_start' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='end'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='start_tone'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='stop_tone'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='start_stream'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='stop_stream'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='send_packet'>
+ <arg type='ay' name='packetContents' direction='in'/>
+ <arg type='i' name='packetLength' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_channel'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='channel' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_channel'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_power'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='q' name='txPowerMode' direction='in'/>
+ <arg type='n' name='power' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_power'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_synoffset'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='testChannel' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_synoffset'>
+ <arg type='ay' name='pkt' direction='in'/>
+ <arg type='i' name='pktLength' direction='in'/>
+ <arg type='y' name='linkQuality' direction='in'/>
+ <arg type='y' name='rssi' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='rx_start'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='rx_stop'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='rx_verify'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='q' name='cntGoodFrame' direction='out'/>
+ </method>
+ <method name='get_rssi'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='s' name='rssi' direction='out'/>
+ </method>
+
+ <signal name='mfglib'>
+ <arg type='y' name='status'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.on_off'>
+ <method name='set_on_off'>
+ <arg type='q' name='node_id' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='on_off_type' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_on_off_state'>
+ <arg type='q' name='node_id' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='on_off_state'>
+ <arg type='y' name='status'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.service'>
+ <method name='enable'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='disable'>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='zb_hw_reset'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='form_network'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='coex_start'>
+ <arg type='y' name='channel' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='coex_stop'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='q' name='ret' direction='out'/>
+ </method>
+ <method name='leave_network'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_network_info'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='ay' name='macAddress' direction='out'/>
+ <arg type='q' name='nodeId' direction='out'/>
+ <arg type='q' name='panId' direction='out'/>
+ <arg type='y' name='channel' direction='out'/>
+ <arg type='y' name='radio_tx_power' direction='out'/>
+ </method>
+ <method name='permit_join'>
+ <arg type='i' name='duration' direction='in'/>
+ <arg type='b' name='broadcastMgmtPermitJoin' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='leave_request'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='remove_child' direction='in'/>
+ <arg type='y' name='rejoin' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='b' name='status' direction='out'/>
+ </method>
+ <method name='get_device_list'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='a(ay)' name='device_list' direction='out'/>
+ </method>
+ <method name='get_mac'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='ay' name='mac_addr' direction='out'/>
+ </method>
+ <method name='get_device_info'>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='a(qyayyay)' name='device_list' direction='out'/>
+ </method>
+ <method name='get_endpoint_list'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='ay' name='endpoint_list' direction='out'/>
+ </method>
+ <method name='get_cluster_list'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='aq' name='cluster_list' direction='out'/>
+ </method>
+ <method name='get_node_type'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='node_type' direction='out'/>
+ </method>
+
+ <signal name='service_enabled'>
+ <arg type='b' name='enabled'/>
+ </signal>
+ <signal name='form_network_done'>
+ <arg type='q' name='panid'/>
+ </signal>
+ <signal name='child_joined'>
+ <arg type='ayyayq' name='child_addr'/>
+ </signal>
+ <signal name='child_rejoined'>
+ <arg type='ay' name='child_addr'/>
+ </signal>
+ <signal name='child_left'>
+ <arg type='ay' name='child_addr'/>
+ <arg type='y' name='status'/>
+ </signal>
+ <signal name='leave_network_done'>
+ <arg type='q' name='panid'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.thermostat'>
+ <method name='get_local_temp'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='get_weekly_schedule'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='no_of_days' direction='in'/>
+ <arg type='y' name='mode' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_weekly_schedule'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='no_of_transitions' direction='in'/>
+ <arg type='y' name='no_of_days' direction='in'/>
+ <arg type='y' name='mode' direction='in'/>
+ <arg type='ay' name='payload' direction='in'/>
+ <arg type='y' name='payload_len' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='clear_weekly_schedule'>
+ <arg type='ay' name='eui64' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='setpoint_raise_lower'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='mode' direction='in'/>
+ <arg type='y' name='amount' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='local_temp'>
+ <arg type='i' name='local_temp'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zcl_color'>
+ <method name='move_to_hue'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='hue' direction='in'/>
+ <arg type='y' name='direction' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_hue'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='move_mode' direction='in'/>
+ <arg type='y' name='rate' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='step_hue'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='step_mode' direction='in'/>
+ <arg type='y' name='step_size' direction='in'/>
+ <arg type='y' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_to_saturation'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='saturation' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_saturation'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='move_mode' direction='in'/>
+ <arg type='y' name='rate' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='step_saturation'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='step_mode' direction='in'/>
+ <arg type='y' name='step_size' direction='in'/>
+ <arg type='y' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_to_hue_and_saturation'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='y' name='hue' direction='in'/>
+ <arg type='y' name='saturation' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_to_color'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='q' name='color_x' direction='in'/>
+ <arg type='q' name='color_y' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_color'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='q' name='rate_x' direction='in'/>
+ <arg type='q' name='rate_y' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='step_color'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='q' name='rate_x' direction='in'/>
+ <arg type='q' name='rate_y' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='move_color_temperature'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='q' name='color_temperature' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zcl_group'>
+ <method name='add_group'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='ay' name='group_name' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='view_group'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='get_group_membership'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='y' name='group_count' direction='in'/>
+ <arg type='aq' name='group_list' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='remove_group'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='remove_all_group'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='add_group_if_identifying'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='ay' name='group_name' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='add_group_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ </signal>
+ <signal name='view_group_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ <arg type='ay' name='name'/>
+ </signal>
+ <signal name='get_group_membership_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='capacity'/>
+ <arg type='y' name='grp_cnt'/>
+ <arg type='aq' name='group_list'/>
+ </signal>
+ <signal name='remove_group_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zcl_poll_control'>
+ <method name='check_in_response'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='y' name='start_fast_polling' direction='in'/>
+ <arg type='q' name='fast_poll_timeout' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='fast_poll_stop'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='set_long_poll_interval'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='u' name='new_long_poll_interval' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='set_short_poll_interval'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='u' name='new_short_poll_interval' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+
+ <signal name='checkin_response'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zcl_scene'>
+ <method name='add_scene'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='y' name='scene_id' direction='in'/>
+ <arg type='q' name='transition_time' direction='in'/>
+ <arg type='q' name='extLen' direction='in'/>
+ <arg type='ay' name='sceneName' direction='in'/>
+ <arg type='ay' name='extFieldSet' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='view_scene'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='y' name='scene_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='remove_scene'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='y' name='scene_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='store_scene'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='y' name='scene_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='recall_scene'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='y' name='scene_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='remove_all_scene'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='get_scene_membership'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='group_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+
+ <signal name='add_scene_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ <arg type='y' name='sceneId'/>
+ </signal>
+ <signal name='view_scene_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ <arg type='y' name='sceneId'/>
+ <arg type='q' name='transitionTime'/>
+ <arg type='ay' name='name'/>
+ <arg type='y' name='extLen'/>
+ <arg type='ay' name='extLenSet'/>
+ </signal>
+ <signal name='remove_scene_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ <arg type='y' name='sceneId'/>
+ </signal>
+ <signal name='store_scene_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ <arg type='y' name='sceneId'/>
+ </signal>
+ <signal name='remove_all_scene_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='q' name='groupId'/>
+ <arg type='y' name='sceneId'/>
+ </signal>
+ <signal name='get_scene_membership_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='y' name='status'/>
+ <arg type='y' name='capacity'/>
+ <arg type='q' name='groupId'/>
+ <arg type='y' name='scenecount'/>
+ <arg type='ay' name='sceneList'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zclbasic_control'>
+ <method name='reset_factory_default'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zclglobal_control'>
+ <method name='read_attributes_req'>
+ <arg type='ay' name='attributeId' direction='in'/>
+ <arg type='i' name='attributeIdsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='write_attributes_req'>
+ <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='i' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='write_attributes_undivided_req'>
+ <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='i' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='write_attributes_no_resp'>
+ <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='i' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='write_attributes_structured'>
+ <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='q' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='read_attributes_structured'>
+ <arg type='ay' name='ReadAttribute' direction='in'/>
+ <arg type='q' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='configure_reporting_req'>
+ <arg type='ay' name='ReadAttribute' direction='in'/>
+ <arg type='q' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='read_configure_reporting'>
+ <arg type='ay' name='ReadAttribute' direction='in'/>
+ <arg type='q' name='recordsLen' direction='in'/>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='discover_attributes'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='q' name='startAttr' direction='in'/>
+ <arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='discover_attributes_extended'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='q' name='startAttr' direction='in'/>
+ <arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='discover_commands_received'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='q' name='startAttr' direction='in'/>
+ <arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='discover_commands_generated'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dest_ep' direction='in'/>
+ <arg type='y' name='zcl_frame_ctrl' direction='in'/>
+ <arg type='q' name='clusterId' direction='in'/>
+ <arg type='q' name='startAttr' direction='in'/>
+ <arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='read_attributes_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='endpoint'/>
+ <arg type='ay' name='value'/>
+ <arg type='q' name='attribute_id'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='y' name='status'/>
+ <arg type='y' name='type'/>
+ <arg type='q' name='record_len'/>
+ <arg type='i' name='isString'/>
+ </signal>
+ <signal name='write_attributes_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='endpoint'/>
+ <arg type='ay' name='value'/>
+ <arg type='aq' name='attribute_id'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='i' name='record_len'/>
+ </signal>
+ <signal name='configure_reporting_rsp'>
+ <arg type='ay' name='status'/>
+ <arg type='aq' name='attribute_id'/>
+ <arg type='ay' name='dir'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='i' name='record_len'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ </signal>
+ <signal name='discover_attribute_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='endpoint'/>
+ <arg type='ay' name='type'/>
+ <arg type='aq' name='attribute_id'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='i' name='record_len'/>
+ <arg type='i' name='discoveryComplete'/>
+ </signal>
+ <signal name='write_attribute_structured_rsp'>
+ <arg type='ay' name='type'/>
+ <arg type='aq' name='attribute_id'/>
+ <arg type='ay' name='indicator'/>
+ <arg type='aq' name='index'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='i' name='record_len'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ </signal>
+ <signal name='discover_commands_received_rsp'>
+ <arg type='ay' name='type'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='q' name='commandLen'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='srcep'/>
+ <arg type='y' name='discoveryComplete'/>
+ </signal>
+ <signal name='discover_commands_generated_rsp'>
+ <arg type='ay' name='type'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='q' name='commandLen'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='srcep'/>
+ <arg type='y' name='discoveryComplete'/>
+ </signal>
+ <signal name='discover_attributes_extended_rsp'>
+ <arg type='aq' name='attrId'/>
+ <arg type='ay' name='attrtype'/>
+ <arg type='ay' name='access'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='q' name='commandLen'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='srcep'/>
+ <arg type='y' name='discoveryComplete'/>
+ </signal>
+ <signal name='zcl_global_default_response'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='ep'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='y' name='command_id'/>
+ <arg type='y' name='status'/>
+ </signal>
+ <signal name='report_attr_handler_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='q' name='cluster_id'/>
+ <arg type='aq' name='attribute_id'/>
+ <arg type='ay' name='dataType'/>
+ <arg type='ay' name='value'/>
+ <arg type='i' name='recordLength'/>
+ </signal>
+ <signal name='read_configure_reporting_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='ep'/>
+ <arg type='q' name='clusterId'/>
+ <arg type='q' name='recLen'/>
+ <arg type='a(yyqyqqayq)' name='resp'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zclias_control'>
+ <method name='enroll_response'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='y' name='enroll_code' direction='in'/>
+ <arg type='y' name='zone_id' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+
+ <signal name='status_change_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='q' name='zoneStatus'/>
+ <arg type='y' name='extendedStatus'/>
+ <arg type='y' name='zoneId'/>
+ <arg type='q' name='delay'/>
+ </signal>
+ <signal name='enroll_request'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='q' name='zone_type'/>
+ <arg type='y' name='mfg_code'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zclidentify_control'>
+ <method name='identify'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='q' name='identifytime' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='query'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+
+ <signal name='query_sp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='q' name='identify_time'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zdo_bind'>
+ <method name='bind_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='ay' name='src_addr' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='q' name='cluster_id' direction='in'/>
+ <arg type='ay' name='dst_addr' direction='in'/>
+ <arg type='y' name='bind_type' direction='in'/>
+ <arg type='q' name='group_addr' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='unbind_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='ay' name='src_addr' direction='in'/>
+ <arg type='y' name='src_ep' direction='in'/>
+ <arg type='q' name='cluster_id' direction='in'/>
+ <arg type='ay' name='dst_addr' direction='in'/>
+ <arg type='y' name='bind_type' direction='in'/>
+ <arg type='q' name='group_addr' direction='in'/>
+ <arg type='y' name='dst_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+
+ <signal name='binding_rsp'>
+ <arg type='y' name='status'/>
+ </signal>
+ <signal name='unbinding_rsp'>
+ <arg type='y' name='status'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<node>
+ <interface name='org.tizen.zigbee.zdodev_control'>
+ <method name='nwk_addr_req'>
+ <arg type='ay' name='EUI64' direction='in'/>
+ <arg type='y' name='requestType' direction='in'/>
+ <arg type='y' name='start_index' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='matched_descriptor_req'>
+ <arg type='q' name='NodeId' direction='in'/>
+ <arg type='q' name='profileId' direction='in'/>
+ <arg type='y' name='num_in_cl' direction='in'/>
+ <arg type='aq' name='in_cl' direction='in'/>
+ <arg type='y' name='num_out_cl' direction='in'/>
+ <arg type='aq' name='out_cl' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='ieee_addr_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='active_ep_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='node_desc_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='power_desc_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='complex_desc_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='user_desc_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='user_desc_set_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='length' direction='in'/>
+ <arg type='ay' name='user_desc' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='device_announce'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='ay' name='mac_addr' direction='in'/>
+ <arg type='y' name='capability' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='simple_desc_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='endpoint' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='mgmt_lqi_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='start_idx' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='mgmt_rtg_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='start_idx' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='mgmt_bind_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='y' name='start_idx' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='mgmt_permit_join_req'>
+ <arg type='q' name='addr16' direction='in'/>
+ <arg type='y' name='duration' direction='in'/>
+ <arg type='y' name='tc_significance' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ <arg type='y' name='status' direction='out'/>
+ </method>
+ <method name='nwk_update_req'>
+ <arg type='q' name='nodeId' direction='in'/>
+ <arg type='u' name='scan_channel' direction='in'/>
+ <arg type='y' name='scan_duration' direction='in'/>
+ <arg type='y' name='scan_count' direction='in'/>
+ <arg type='y' name='nwkUpdateId' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+ <method name='nwk_disc_req'>
+ <arg type='q' name='nwkaddr' direction='in'/>
+ <arg type='u' name='scan_channel' direction='in'/>
+ <arg type='y' name='scan_duration' direction='in'/>
+ <arg type='q' name='scan_count' direction='in'/>
+ <arg type='y' name='start_idx' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
+ </method>
+
+ <signal name='nwk_addr_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='ay' name='EUI64'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='num_of_assoc'/>
+ <arg type='y' name='startIds'/>
+ </signal>
+ <signal name='nwk_addr_ext_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='ay' name='EUI64'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='num_of_assoc'/>
+ <arg type='y' name='startIds'/>
+ <arg type='aq' name='nwkaddr'/>
+ </signal>
+ <signal name='active_ep_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='status'/>
+ <arg type='ay' name='endpoint'/>
+ <arg type='y' name='endpointCount'/>
+ </signal>
+ <signal name='simple_desc_rsp'>
+ <arg type='q' name='nodeId'/>
+ <arg type='i' name='length'/>
+ <arg type='y' name='deviceVersion'/>
+ <arg type='y' name='endpoint'/>
+ <arg type='q' name='profileId'/>
+ <arg type='q' name='deviceId'/>
+ <arg type='y' name='inClusterCount'/>
+ <arg type='y' name='outClusterCount'/>
+ <arg type='aq' name='outClusterList'/>
+ </signal>
+ <signal name='matched_descriptor_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='length'/>
+ <arg type='ay' name='matchList'/>
+ </signal>
+ <signal name='mgmt_bind_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='y' name='tot'/>
+ <arg type='y' name='start'/>
+ <arg type='y' name='inc'/>
+ <arg type='a(ayyqyay)' name='response'/>
+ </signal>
+ <signal name='mgmt_lqi_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='y' name='tot'/>
+ <arg type='y' name='start'/>
+ <arg type='y' name='inc'/>
+ <arg type='a(ayayyqyyyy)' name='response'/>
+ </signal>
+ <signal name='nwk_disc_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='y' name='nwkCount'/>
+ <arg type='y' name='startIndex'/>
+ <arg type='y' name='nwkListCount'/>
+ <arg type='a(ayayyqyyyyy)' name='response'/>
+ </signal>
+ <signal name='mgmt_rtg_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='y' name='tot'/>
+ <arg type='y' name='start'/>
+ <arg type='y' name='inc'/>
+ <arg type='a(qyyyyq)' name='response'/>
+ </signal>
+ <signal name='mgmt_permit_join_rsp'>
+ <arg type='y' name='status'/>
+ </signal>
+ <signal name='mgmt_left_rsp'>
+ <arg type='y' name='status'/>
+ </signal>
+ <signal name='node_desc_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='logical_type'/>
+ <arg type='y' name='com_des_ava'/>
+ <arg type='y' name='user_des_ava'/>
+ <arg type='y' name='aps_frame'/>
+ <arg type='y' name='frequency_b'/>
+ <arg type='y' name='mac_cap'/>
+ <arg type='q' name='manufact_cd'/>
+ <arg type='y' name='max_buffer_size'/>
+ <arg type='q' name='max_i'/>
+ <arg type='q' name='server_mask'/>
+ <arg type='q' name='max_o'/>
+ <arg type='y' name='descr_flags'/>
+ </signal>
+ <signal name='power_desc_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='current_power_mode'/>
+ <arg type='y' name='available_power_sources'/>
+ <arg type='y' name='current_power_source'/>
+ <arg type='y' name='current_power_source_level'/>
+ </signal>
+ <signal name='complex_desc_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='length'/>
+ <arg type='ay' name='complex_desc'/>
+ </signal>
+ <signal name='user_desc_rsp'>
+ <arg type='y' name='status'/>
+ <arg type='q' name='nodeId'/>
+ <arg type='y' name='length'/>
+ <arg type='ay' name='user_desc'/>
+ </signal>
+ <signal name='user_desc_confirm'>
+ <arg type='y' name='status'/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+#include <dlog.h>
+
+#include <zblib.h>
+#include <zblib_service.h>
+#include <zblib_service_interface.h>
+
+#include "zigbee_service_interface.h"
+#include "zigbee_service_interface_common.h"
+#include "zigbee_service_dbus_interface.h"
+
+#define ZIGBEE_DBUS_SERVICE_INTERFACE_NAME "zigbee-dbus"
+
+static gboolean zigbee_on_manager_get_zigbee_state(ZigbeeManager *zigbee_mgr,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ Z_LOGI("Entered");
+
+ NOT_USED(zigbee_mgr);
+ NOT_USED(invocation);
+ NOT_USED(user_data);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static void zigbee_service_dbus_interface_initialize_interfaces(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ gboolean ret;
+
+ ret = zigbee_service_dbus_interface_alarm_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_custom_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_door_lock_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_fan_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_level_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_mfglib_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_on_off_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_service_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_thermostat_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zclbasic_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zcl_color_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zclglobal_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zcl_group_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zclias_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zclidentify_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zcl_poll_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zcl_scene_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zdo_bind_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+
+ ret = zigbee_service_dbus_interface_zdodev_control_init(service, zigbee_object);
+ Z_LOGD("ret: %d", ret);
+}
+
+static void zigbee_on_name_lost(GDBusConnection *connection,
+ const gchar *name, gpointer user_data)
+{
+ ZigbeeCustomData_t *custom_data = user_data;
+
+ Z_LOGW("'%s' - [Name Lost]", name);
+
+ NOT_USED(connection);
+
+ /* Bus name is 'lost' */
+ custom_data->name_acquired = FALSE;
+}
+
+static void zigbee_on_name_acquired(GDBusConnection *connection,
+ const gchar *name, gpointer user_data)
+{
+ ZigbeeCustomData_t *custom_data = user_data;
+
+ Z_LOGI("'%s' - [Name Acquired]", name);
+
+ NOT_USED(connection);
+
+ /* Bus name is 'acquired' */
+ custom_data->name_acquired = TRUE;
+
+ if (TRUE == custom_data->sevice_interface_init_complete) {
+ /* TODO - Emit zigbee_state signal */
+ }
+}
+
+static void zigbee_on_bus_acquired(GDBusConnection *connection,
+ const gchar *name, gpointer user_data)
+{
+ ZigbeeObjectSkeleton *zigbee_object;
+ ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+ ZigBeeService *service = NULL;
+ ZigbeeCustomData_t *custom_data = NULL;
+ char *path = NULL;
+
+ Z_LOGI("'%s' - [BUS Acquired]", name);
+
+ if (NULL == service_interface) {
+ Z_LOGE("service_interface is NULL!");
+ return;
+ }
+
+ service = zblib_service_interface_ref_service(service_interface);
+ if (NULL == service) {
+ Z_LOGE("service is NULL!");
+ return;
+ }
+
+ custom_data = (ZigbeeCustomData_t *)zblib_service_interface_ref_user_data(service_interface);
+ if (NULL == custom_data) {
+ Z_LOGE("D-BUS service interface custom_data is NULL!");
+ return;
+ }
+
+ /*
+ * Create ZigBee 'manager' D-BUS object
+ */
+ custom_data->zigbee_mgr = zigbee_manager_skeleton_new();
+
+ /*
+ * Set ZigBee 'manager' D-BUS object method(s)
+ */
+ g_signal_connect(custom_data->zigbee_mgr,
+ "handle-get-zigbee-state",
+ G_CALLBACK(zigbee_on_manager_get_zigbee_state),
+ custom_data);
+
+ /*
+ * Export 'manager' interface on ZigBee D-BUS
+ */
+ g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(custom_data->zigbee_mgr),
+ connection, ZIGBEE_DBUS_PATH, NULL);
+
+ /*
+ * Exports all objects managed by 'manager' on Connection (connection)
+ */
+ g_dbus_object_manager_server_set_connection(custom_data->manager, connection);
+
+ path = g_strdup_printf("%s/service", ZIGBEE_DBUS_PATH);
+ Z_LOGI("dbus object path: [%s]", path);
+
+ /*
+ * Create 'object' for specific path only once.
+ */
+ zigbee_object = g_hash_table_lookup(custom_data->objects, path);
+ if (zigbee_object) {
+ Z_LOGW("ZigBee D-BUS interface object already created (object: %p)", zigbee_object);
+ goto OUT;
+ }
+
+ /*
+ * Create ZigBee D-BUS object
+ */
+ zigbee_object = zigbee_object_skeleton_new(path);
+ Z_LOGI("ZigBee D-BUS object created (zigbee_object: [%p])", zigbee_object);
+
+ /*
+ * Insert ZigBee object to HASH table
+ */
+ g_hash_table_insert(custom_data->objects, g_strdup(path), zigbee_object);
+
+ /*
+ * Initialize interfaces
+ */
+ zigbee_service_dbus_interface_initialize_interfaces(service, zigbee_object);
+ Z_LOGI("ZigBee service interfaces initialized!!!");
+
+ /* Export the Object to Manager */
+ g_dbus_object_manager_server_export(custom_data->manager,
+ G_DBUS_OBJECT_SKELETON(zigbee_object));
+
+ /* Servcie interface initialization completed */
+ custom_data->sevice_interface_init_complete = TRUE;
+
+ if (TRUE == custom_data->name_acquired) {
+ /* TODO - Emit zigbee_state signal */
+ }
+OUT:
+ g_free(path);
+}
+
+/**< ZigBee D-BUS Service interface methods */
+struct zblib_service_interface_methods dbus_service_interface_methods = {
+ .send_response = NULL,
+ .send_notification = NULL,
+};
+
+
+/**< Zigbee service dbus interface initialization */
+gboolean zigbee_service_dbus_interface_init(ZigBeeService *service)
+{
+ ZigBeeServiceInterface *service_interface = NULL;
+ ZigbeeCustomData_t *interface_data = NULL;
+ gboolean ret;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ /*
+ * Create ZigBee service interface object
+ */
+ service_interface = zblib_service_interface_new(service,
+ ZIGBEE_DBUS_SERVICE_INTERFACE_NAME,
+ &dbus_service_interface_methods);
+ if (NULL == service_interface) {
+ Z_LOGE("Create D-BUS service interface failed!");
+
+ return FALSE;
+ }
+
+ /*
+ * Add Service interface object to 'service'
+ */
+ ret = zblib_service_add_service_interface(service,
+ service_interface);
+ if (FALSE == ret) {
+ Z_LOGE("Add D-BUS service interface failed!");
+
+ goto EXIT;
+ }
+
+ /*
+ * ZigBee D-BUS interface custom data
+ */
+ interface_data = g_malloc0(sizeof(ZigbeeCustomData_t));
+
+ /*
+ * Link interface data to service
+ */
+ ret = zblib_service_interface_link_user_data(service_interface,
+ interface_data);
+ if (FALSE == ret) {
+ Z_LOGE("Link D-BUS service interface data failed!");
+
+ goto EXIT;
+ }
+
+ /* HASH table for maintaining 'objects' list */
+ interface_data->objects = g_hash_table_new(g_str_hash, g_str_equal);
+
+ /*
+ * Acquire "org.tizen.zigbee" named bus on D-BUS SYSTEM bus.
+ */
+ interface_data->bus_id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+ ZIGBEE_DBUS_SERVICE,
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ zigbee_on_bus_acquired,
+ zigbee_on_name_acquired,
+ zigbee_on_name_lost,
+ service_interface,
+ NULL);
+ Z_LOGI("ZigBee D-BUS ID: [%d]", interface_data->bus_id);
+
+ interface_data->manager = g_dbus_object_manager_server_new(ZIGBEE_DBUS_PATH);
+
+ return TRUE;
+
+EXIT:
+ g_free(interface_data);
+
+ /*
+ * Remove Service interface object from 'service'
+ */
+ ret = zblib_service_remove_service_interface(service,
+ service_interface);
+ if (FALSE == ret) {
+ Z_LOGE("Remove service interface failed!");
+ }
+
+ /*
+ * Free Service interface object
+ */
+ zblib_service_interface_free(service,
+ service_interface);
+
+ return FALSE;
+}
+
+/**< Zigbee service dbus interface de-initialization */
+void zigbee_service_dbus_interface_deinit(ZigBeeService *service)
+{
+ ZigBeeServiceInterface *service_interface = NULL;
+ ZigbeeCustomData_t *interface_data = NULL;
+ gboolean ret;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return;
+ }
+
+ service_interface = zblib_service_ref_service_interface(service,
+ ZIGBEE_DBUS_SERVICE_INTERFACE_NAME);
+ if (NULL == service_interface) {
+ Z_LOGE("D-BUS service interface not found!");
+
+ return;
+ }
+
+ interface_data = (ZigbeeCustomData_t *)zblib_service_interface_ref_user_data(service_interface);
+ if (NULL == service_interface) {
+ Z_LOGE("D-BUS service interface not found!");
+
+ goto EXIT;
+ }
+
+ /*
+ * Unown "org.tizen.zigbee" named bus on D-BUS SYSTEM bus
+ */
+ if (interface_data->bus_id > 0) {
+ Z_LOGI("Unowning ZigBee Service interface D-BUS ID: [%d]", interface_data->bus_id);
+ g_bus_unown_name(interface_data->bus_id);
+ }
+
+ /* Free resources */
+ g_hash_table_destroy(interface_data->objects);
+ g_free(interface_data);
+
+EXIT:
+ /*
+ * Remove Service interface object from 'service'
+ */
+ ret = zblib_service_remove_service_interface(service,
+ service_interface);
+ if (FALSE == ret) {
+ Z_LOGE("Remove service interface failed!");
+ }
+
+ /*
+ * Free Service interface object
+ */
+ zblib_service_interface_free(service,
+ service_interface);
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_alarm_get_alarm_count(ZigbeeAlarm *alarm_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(alarm_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_alarm_reset_alarm(ZigbeeAlarm *alarm_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar alarmcode,
+ gshort cluster_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(alarm_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(alarmcode);
+ NOT_USED(cluster_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_alarm_reset_all_alarm(ZigbeeAlarm *alarm_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(alarm_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_alarm_alarm(ZigbeeAlarm *alarm_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gchar alarmcode,
+ gshort cluster_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(alarm_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+ NOT_USED(alarmcode);
+ NOT_USED(cluster_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_alarm_reset_alarm_log(ZigbeeAlarm *alarm_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(alarm_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_alarm_get_alarm(ZigbeeAlarm *alarm_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(alarm_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_alarm_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeAlarm *alarm_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ alarm_object = zigbee_alarm_skeleton_new();
+ zigbee_object_skeleton_set_alarm(zigbee_object, alarm_object);
+ g_object_unref(alarm_object);
+
+ Z_LOGI("alarm_object: [%p]", alarm_object);
+
+ /*
+ * Register signal handlers for 'alarm' interface
+ */
+ g_signal_connect(alarm_object,
+ "handle-get-alarm-count",
+ G_CALLBACK(on_alarm_get_alarm_count), service);
+
+ g_signal_connect(alarm_object,
+ "handle-reset-alarm",
+ G_CALLBACK(on_alarm_reset_alarm), service);
+
+ g_signal_connect(alarm_object,
+ "handle-reset-all-alarm",
+ G_CALLBACK(on_alarm_reset_all_alarm), service);
+
+ g_signal_connect(alarm_object,
+ "handle-alarm",
+ G_CALLBACK(on_alarm_alarm), service);
+
+ g_signal_connect(alarm_object,
+ "handle-reset-alarm-log",
+ G_CALLBACK(on_alarm_reset_alarm_log), service);
+
+ g_signal_connect(alarm_object,
+ "handle-get-alarm",
+ G_CALLBACK(on_alarm_get_alarm), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_custom_aps_send(ZigbeeCustom *custom_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar aps_frame_ctrl,
+ gchar src_ep,
+ gchar dst_ep,
+ gshort cluster_id,
+ gshort profile_id,
+ gchar zcl_frame_ctrl,
+ gshort mfg_code,
+ GVariant *payload,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(custom_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(aps_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dst_ep);
+ NOT_USED(cluster_id);
+ NOT_USED(profile_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(mfg_code);
+ NOT_USED(payload);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_custom_zcl_send(ZigbeeCustom *custom_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar src_ep,
+ gchar dst_ep,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar cmd_id,
+ GVariant *payload,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(custom_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(src_ep);
+ NOT_USED(dst_ep);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(cmd_id);
+ NOT_USED(payload);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_custom_send_to_local(ZigbeeCustom *custom_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *data,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(custom_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(data);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_custom_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeCustom *custom_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ custom_object = zigbee_custom_skeleton_new();
+ zigbee_object_skeleton_set_custom(zigbee_object, custom_object);
+ g_object_unref(custom_object);
+
+ Z_LOGI("custom_object: [%p]", custom_object);
+
+ /*
+ * Register signal handlers for 'custom' interface
+ */
+ g_signal_connect(custom_object,
+ "handle-aps-send",
+ G_CALLBACK(on_custom_aps_send), service);
+
+ g_signal_connect(custom_object,
+ "handle-zcl-send",
+ G_CALLBACK(on_custom_zcl_send), service);
+
+ g_signal_connect(custom_object,
+ "handle-send-to-local",
+ G_CALLBACK(on_custom_send_to_local), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_door_lock_subscribe_lock_event(ZigbeeDoor_lock *door_lock_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(door_lock_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_door_lock_set_door_lock_pin(ZigbeeDoor_lock *door_lock_object,
+ GDBusMethodInvocation *invocation,
+ gshort uid,
+ gchar ustatus,
+ gchar utype,
+ GVariant *eui64,
+ gchar endpoint,
+ gchar *pin,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(door_lock_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(uid);
+ NOT_USED(ustatus);
+ NOT_USED(utype);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+ NOT_USED(pin);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_door_lock_set_door_lock(ZigbeeDoor_lock *door_lock_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gchar *pin,
+ gint lock_unlock_type,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(door_lock_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+ NOT_USED(pin);
+ NOT_USED(lock_unlock_type);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_door_lock_get_lock_state(ZigbeeDoor_lock *door_lock_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(door_lock_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_door_lock_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeDoor_lock *door_lock_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ door_lock_object = zigbee_door_lock_skeleton_new();
+ zigbee_object_skeleton_set_door_lock(zigbee_object, door_lock_object);
+ g_object_unref(door_lock_object);
+
+ Z_LOGI("door_lock_object: [%p]", door_lock_object);
+
+ /*
+ * Register signal handlers for 'door_lock' interface
+ */
+ g_signal_connect(door_lock_object,
+ "handle-subscribe-lock-event",
+ G_CALLBACK(on_door_lock_subscribe_lock_event), service);
+
+ g_signal_connect(door_lock_object,
+ "handle-set-door-lock-pin",
+ G_CALLBACK(on_door_lock_set_door_lock_pin), service);
+
+ g_signal_connect(door_lock_object,
+ "handle-set-door-lock",
+ G_CALLBACK(on_door_lock_set_door_lock), service);
+
+ g_signal_connect(door_lock_object,
+ "handle-get-lock-state",
+ G_CALLBACK(on_door_lock_get_lock_state), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_fan_control_set_fan_mode(ZigbeeFan_control *fan_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(fan_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_fan_control_get_fan_mode(ZigbeeFan_control *fan_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(fan_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_fan_control_set_fan_mode_sequence(ZigbeeFan_control *fan_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(fan_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_fan_control_get_fan_mode_sequence(ZigbeeFan_control *fan_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(fan_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_fan_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeFan_control *fan_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ fan_control_object = zigbee_fan_control_skeleton_new();
+ zigbee_object_skeleton_set_fan_control(zigbee_object, fan_control_object);
+ g_object_unref(fan_control_object);
+
+ Z_LOGI("fan_control_object: [%p]", fan_control_object);
+
+ /*
+ * Register signal handlers for 'fan_control' interface
+ */
+ g_signal_connect(fan_control_object,
+ "handle-set-fan-mode",
+ G_CALLBACK(on_fan_control_set_fan_mode), service);
+
+ g_signal_connect(fan_control_object,
+ "handle-get-fan-mode",
+ G_CALLBACK(on_fan_control_get_fan_mode), service);
+
+ g_signal_connect(fan_control_object,
+ "handle-set-fan-mode-sequence",
+ G_CALLBACK(on_fan_control_set_fan_mode_sequence), service);
+
+ g_signal_connect(fan_control_object,
+ "handle-get-fan-mode-sequence",
+ G_CALLBACK(on_fan_control_get_fan_mode_sequence), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_level_control_move_to_level(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar level,
+ gshort transition,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(level);
+ NOT_USED(transition);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_level_control_move(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar move_mode,
+ gchar rate,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(move_mode);
+ NOT_USED(rate);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_level_control_step(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar step_mode,
+ gchar move_mode,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(step_mode);
+ NOT_USED(move_mode);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_level_control_move_to_level_with_on_off(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar level,
+ gshort transition,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(level);
+ NOT_USED(transition);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_level_control_move_with_on_off(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar move_mode,
+ gchar rate,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(move_mode);
+ NOT_USED(rate);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_level_control_step_with_on_off(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar step_mode,
+ gchar move_mode,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(step_mode);
+ NOT_USED(move_mode);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_level_control_stop(ZigbeeLevel_control *level_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(level_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_level_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeLevel_control *level_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ level_control_object = zigbee_level_control_skeleton_new();
+ zigbee_object_skeleton_set_level_control(zigbee_object, level_control_object);
+ g_object_unref(level_control_object);
+
+ Z_LOGI("level_control_object: [%p]", level_control_object);
+
+ /*
+ * Register signal handlers for 'level_control' interface
+ */
+ g_signal_connect(level_control_object,
+ "handle-move-to-level",
+ G_CALLBACK(on_level_control_move_to_level), service);
+
+ g_signal_connect(level_control_object,
+ "handle-move",
+ G_CALLBACK(on_level_control_move), service);
+
+ g_signal_connect(level_control_object,
+ "handle-step",
+ G_CALLBACK(on_level_control_step), service);
+
+ g_signal_connect(level_control_object,
+ "handle-move-to-level-with-on-off",
+ G_CALLBACK(on_level_control_move_to_level_with_on_off), service);
+
+ g_signal_connect(level_control_object,
+ "handle-move-with-on-off",
+ G_CALLBACK(on_level_control_move_with_on_off), service);
+
+ g_signal_connect(level_control_object,
+ "handle-step-with-on-off",
+ G_CALLBACK(on_level_control_step_with_on_off), service);
+
+ g_signal_connect(level_control_object,
+ "handle-stop",
+ G_CALLBACK(on_level_control_stop), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_mfglib_control_start(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gboolean mfglib_start,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(mfglib_start);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_end(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_start_tone(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_stop_tone(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_start_stream(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_stop_stream(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_send_packet(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *packet_content,
+ gint packet_length,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(packet_content);
+ NOT_USED(packet_length);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_set_channel(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar channel,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(channel);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_get_channel(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_set_power(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gshort tx_power_mode,
+ guint power,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(tx_power_mode);
+ NOT_USED(power);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_get_power(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_set_synoffset(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar test_channel,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(test_channel);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_get_synoffset(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *packet,
+ gint packet_length,
+ gchar link_quality,
+ gchar rssi,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(packet);
+ NOT_USED(packet_length);
+ NOT_USED(link_quality);
+ NOT_USED(rssi);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_rx_start(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_rx_stop(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_rx_verify(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_mfglib_control_get_rssi(ZigbeeMfglib_control *mfglib_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(mfglib_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_mfglib_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeMfglib_control *mfglib_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ mfglib_control_object = zigbee_mfglib_control_skeleton_new();
+ zigbee_object_skeleton_set_mfglib_control(zigbee_object, mfglib_control_object);
+ g_object_unref(mfglib_control_object);
+
+ Z_LOGI("mfglib_control_object: [%p]", mfglib_control_object);
+
+ /*
+ * Register signal handlers for 'mfglib_control' interface
+ */
+ g_signal_connect(mfglib_control_object,
+ "handle-start",
+ G_CALLBACK(on_mfglib_control_start), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-end",
+ G_CALLBACK(on_mfglib_control_end), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-start-tone",
+ G_CALLBACK(on_mfglib_control_start_tone), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-stop-tone",
+ G_CALLBACK(on_mfglib_control_stop_tone), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-start-stream",
+ G_CALLBACK(on_mfglib_control_start_stream), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-stop-stream",
+ G_CALLBACK(on_mfglib_control_stop_stream), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-send-packet",
+ G_CALLBACK(on_mfglib_control_send_packet), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-set-channel",
+ G_CALLBACK(on_mfglib_control_set_channel), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-get-channel",
+ G_CALLBACK(on_mfglib_control_get_channel), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-set-power",
+ G_CALLBACK(on_mfglib_control_set_power), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-get-power",
+ G_CALLBACK(on_mfglib_control_get_power), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-set-synoffset",
+ G_CALLBACK(on_mfglib_control_set_synoffset), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-get-synoffset",
+ G_CALLBACK(on_mfglib_control_get_synoffset), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-rx-start",
+ G_CALLBACK(on_mfglib_control_rx_start), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-rx-stop",
+ G_CALLBACK(on_mfglib_control_rx_stop), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-rx-verify",
+ G_CALLBACK(on_mfglib_control_rx_verify), service);
+
+ g_signal_connect(mfglib_control_object,
+ "handle-get-rssi",
+ G_CALLBACK(on_mfglib_control_get_rssi), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_on_off_set_on_off(ZigbeeOn_off *on_off_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar on_off_type,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(on_off_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(on_off_type);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_on_off_get_on_off_state(ZigbeeOn_off *on_off_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(on_off_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_on_off_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeOn_off *on_off_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ on_off_object = zigbee_on_off_skeleton_new();
+ zigbee_object_skeleton_set_on_off(zigbee_object, on_off_object);
+ g_object_unref(on_off_object);
+
+ Z_LOGI("on_off_object: [%p]", on_off_object);
+
+ /*
+ * Register signal handlers for 'on_off' interface
+ */
+ g_signal_connect(on_off_object,
+ "handle-set-on-off",
+ G_CALLBACK(on_on_off_set_on_off), service);
+
+ g_signal_connect(on_off_object,
+ "handle-get-on-off-state",
+ G_CALLBACK(on_on_off_get_on_off_state), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_service_enable(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_disable(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_zb_hw_reset(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_form_network(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_coex_start(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gchar channel,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(channel);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_coex_stop(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_leave_network(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_network_info(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_permit_join(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gint duration,
+ gboolean broadcast_mgmt_permit_join,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(duration);
+ NOT_USED(broadcast_mgmt_permit_join);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_leave_request(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar remove_child,
+ gchar rejoin,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(remove_child);
+ NOT_USED(rejoin);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_device_list(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_mac(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_device_info(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_endpoint_list(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_cluster_list(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_service_get_node_type(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(service_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_service_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeService *service_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ service_object = zigbee_service_skeleton_new();
+ zigbee_object_skeleton_set_service(zigbee_object, service_object);
+ g_object_unref(service_object);
+
+ Z_LOGI("service_object: [%p]", service_object);
+
+ /*
+ * Register signal handlers for 'service' interface
+ */
+ g_signal_connect(service_object,
+ "handle-enable",
+ G_CALLBACK(on_service_enable), service);
+
+ g_signal_connect(service_object,
+ "handle-disable",
+ G_CALLBACK(on_service_disable), service);
+
+ g_signal_connect(service_object,
+ "handle-zb-hw-reset",
+ G_CALLBACK(on_service_zb_hw_reset), service);
+
+ g_signal_connect(service_object,
+ "handle-form-network",
+ G_CALLBACK(on_service_form_network), service);
+
+ g_signal_connect(service_object,
+ "handle-coex-start",
+ G_CALLBACK(on_service_coex_start), service);
+
+ g_signal_connect(service_object,
+ "handle-coex-stop",
+ G_CALLBACK(on_service_coex_stop), service);
+
+ g_signal_connect(service_object,
+ "handle-leave-network",
+ G_CALLBACK(on_service_leave_network), service);
+
+ g_signal_connect(service_object,
+ "handle-get-network-info",
+ G_CALLBACK(on_service_get_network_info), service);
+
+ g_signal_connect(service_object,
+ "handle-permit-join",
+ G_CALLBACK(on_service_permit_join), service);
+
+ g_signal_connect(service_object,
+ "handle-leave-request",
+ G_CALLBACK(on_service_leave_request), service);
+
+ g_signal_connect(service_object,
+ "handle-get-device-list",
+ G_CALLBACK(on_service_get_device_list), service);
+
+ g_signal_connect(service_object,
+ "handle-get-mac",
+ G_CALLBACK(on_service_get_mac), service);
+
+ g_signal_connect(service_object,
+ "handle-get-device-info",
+ G_CALLBACK(on_service_get_device_info), service);
+
+ g_signal_connect(service_object,
+ "handle-get-endpoint-list",
+ G_CALLBACK(on_service_get_endpoint_list), service);
+
+ g_signal_connect(service_object,
+ "handle-get-cluster-list",
+ G_CALLBACK(on_service_get_cluster_list), service);
+
+ g_signal_connect(service_object,
+ "handle-get-node-type",
+ G_CALLBACK(on_service_get_node_type), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_thermostat_get_local_temp(ZigbeeThermostat *thermostat_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(thermostat_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_thermostat_get_weekly_schedule(ZigbeeThermostat *thermostat_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gchar no_of_days,
+ gchar mode,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(thermostat_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+ NOT_USED(no_of_days);
+ NOT_USED(mode);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_thermostat_set_weekly_schedule(ZigbeeThermostat *thermostat_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gchar no_of_transitions,
+ gchar no_of_days,
+ gchar mode,
+ GVariant *payload,
+ gchar payload_len,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(thermostat_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+ NOT_USED(no_of_transitions);
+ NOT_USED(no_of_days);
+ NOT_USED(mode);
+ NOT_USED(payload);
+ NOT_USED(payload_len);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_thermostat_clear_weekly_schedule(ZigbeeThermostat *thermostat_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(thermostat_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_thermostat_setpoint_raise_lower(ZigbeeThermostat *thermostat_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar mode,
+ gchar amount,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(thermostat_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(mode);
+ NOT_USED(amount);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_thermostat_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeThermostat *thermostat_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ thermostat_object = zigbee_thermostat_skeleton_new();
+ zigbee_object_skeleton_set_thermostat(zigbee_object, thermostat_object);
+ g_object_unref(thermostat_object);
+
+ Z_LOGI("thermostat_object: [%p]", thermostat_object);
+
+ /*
+ * Register signal handlers for 'thermostat' interface
+ */
+ g_signal_connect(thermostat_object,
+ "handle-get-local-temp",
+ G_CALLBACK(on_thermostat_get_local_temp), service);
+
+ g_signal_connect(thermostat_object,
+ "handle-get-weekly-schedule",
+ G_CALLBACK(on_thermostat_get_weekly_schedule), service);
+
+ g_signal_connect(thermostat_object,
+ "handle-set-weekly-schedule",
+ G_CALLBACK(on_thermostat_set_weekly_schedule), service);
+
+ g_signal_connect(thermostat_object,
+ "handle-clear-weekly-schedule",
+ G_CALLBACK(on_thermostat_clear_weekly_schedule), service);
+
+ g_signal_connect(thermostat_object,
+ "handle-setpoint-raise-lower",
+ G_CALLBACK(on_thermostat_setpoint_raise_lower), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zcl_color_move_to_hue(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar move_mode,
+ gchar rate,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(move_mode);
+ NOT_USED(rate);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_hue(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar hue,
+ gchar direction,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(hue);
+ NOT_USED(direction);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_step_hue(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar step_mode,
+ gchar step_size,
+ gchar transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(step_mode);
+ NOT_USED(step_size);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_to_saturation(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar saturation,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(saturation);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_saturation(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar move_mode,
+ gchar rate,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(move_mode);
+ NOT_USED(rate);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_step_saturation(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar step_mode,
+ gchar step_size,
+ gchar transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(step_mode);
+ NOT_USED(step_size);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_to_hue_and_saturation(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gchar hue,
+ gchar saturation,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(hue);
+ NOT_USED(saturation);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_to_color(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gshort start_x,
+ gshort start_y,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(start_x);
+ NOT_USED(start_y);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_color(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gshort rate_x,
+ gshort rate_y,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(rate_x);
+ NOT_USED(rate_y);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_step_color(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gshort rate_x,
+ gshort rate_y,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(rate_x);
+ NOT_USED(rate_y);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_color_move_color_temperature(ZigbeeZcl_color *zcl_color_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gshort color_temperature,
+ gshort transition_time,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_color_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+ NOT_USED(color_temperature);
+ NOT_USED(transition_time);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zcl_color_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZcl_color *zcl_color_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zcl_color_object = zigbee_zcl_color_skeleton_new();
+ zigbee_object_skeleton_set_zcl_color(zigbee_object, zcl_color_object);
+ g_object_unref(zcl_color_object);
+
+ Z_LOGI("zcl_color_object: [%p]", zcl_color_object);
+
+ /*
+ * Register signal handlers for 'zcl_color' interface
+ */
+ g_signal_connect(zcl_color_object,
+ "handle-move-to-hue",
+ G_CALLBACK(on_zcl_color_move_to_hue), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-hue",
+ G_CALLBACK(on_zcl_color_move_hue), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-step-hue",
+ G_CALLBACK(on_zcl_color_step_hue), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-to-saturation",
+ G_CALLBACK(on_zcl_color_move_to_saturation), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-saturation",
+ G_CALLBACK(on_zcl_color_move_saturation), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-step-saturation",
+ G_CALLBACK(on_zcl_color_step_saturation), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-to-hue-and-saturation",
+ G_CALLBACK(on_zcl_color_move_to_hue_and_saturation), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-to-color",
+ G_CALLBACK(on_zcl_color_move_to_color), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-color",
+ G_CALLBACK(on_zcl_color_move_color), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-step-color",
+ G_CALLBACK(on_zcl_color_step_color), service);
+
+ g_signal_connect(zcl_color_object,
+ "handle-move-color-temperature",
+ G_CALLBACK(on_zcl_color_move_color_temperature), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zcl_group_add_group(ZigbeeZcl_group *zcl_group_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ GVariant *group_name,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_group_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(group_name);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_group_view_group(ZigbeeZcl_group *zcl_group_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_group_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_group_get_group_membership(ZigbeeZcl_group *zcl_group_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gchar group_count,
+ GVariant *group_list,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_group_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_count);
+ NOT_USED(group_list);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_group_remove_group(ZigbeeZcl_group *zcl_group_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_group_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_group_remove_all_group(ZigbeeZcl_group *zcl_group_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_group_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_group_add_group_if_identifying(ZigbeeZcl_group *zcl_group_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ GVariant *group_name,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_group_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(group_name);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zcl_group_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZcl_group *zcl_group_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zcl_group_object = zigbee_zcl_group_skeleton_new();
+ zigbee_object_skeleton_set_zcl_group(zigbee_object, zcl_group_object);
+ g_object_unref(zcl_group_object);
+
+ Z_LOGI("zcl_group_object: [%p]", zcl_group_object);
+
+ /*
+ * Register signal handlers for 'zcl_group' interface
+ */
+ g_signal_connect(zcl_group_object,
+ "handle-add-group",
+ G_CALLBACK(on_zcl_group_add_group), service);
+
+ g_signal_connect(zcl_group_object,
+ "handle-view-group",
+ G_CALLBACK(on_zcl_group_view_group), service);
+
+ g_signal_connect(zcl_group_object,
+ "handle-get-group-membership",
+ G_CALLBACK(on_zcl_group_get_group_membership), service);
+
+ g_signal_connect(zcl_group_object,
+ "handle-remove-group",
+ G_CALLBACK(on_zcl_group_remove_group), service);
+
+ g_signal_connect(zcl_group_object,
+ "handle-remove-all-group",
+ G_CALLBACK(on_zcl_group_remove_all_group), service);
+
+ g_signal_connect(zcl_group_object,
+ "handle-add-group-if-identifying",
+ G_CALLBACK(on_zcl_group_add_group_if_identifying), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zcl_poll_control_check_in_response(ZigbeeZcl_poll_control *zcl_poll_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gchar start_fast_polling,
+ gshort fast_poll_timeout,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_poll_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(start_fast_polling);
+ NOT_USED(fast_poll_timeout);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_poll_control_fast_poll_stop(ZigbeeZcl_poll_control *zcl_poll_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_poll_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_poll_control_set_long_poll_interval(ZigbeeZcl_poll_control *zcl_poll_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ guint new_long_poll_interval,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_poll_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(new_long_poll_interval);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_poll_control_set_short_poll_interval(ZigbeeZcl_poll_control *zcl_poll_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ guint new_short_poll_interval,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_poll_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(new_short_poll_interval);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zcl_poll_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZcl_poll_control *zcl_poll_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zcl_poll_control_object = zigbee_zcl_poll_control_skeleton_new();
+ zigbee_object_skeleton_set_zcl_poll_control(zigbee_object, zcl_poll_control_object);
+ g_object_unref(zcl_poll_control_object);
+
+ Z_LOGI("zcl_poll_control_object: [%p]", zcl_poll_control_object);
+
+ /*
+ * Register signal handlers for 'zcl_poll_control' interface
+ */
+ g_signal_connect(zcl_poll_control_object,
+ "handle-check-in-response",
+ G_CALLBACK(on_zcl_poll_control_check_in_response), service);
+
+ g_signal_connect(zcl_poll_control_object,
+ "handle-fast-poll-stop",
+ G_CALLBACK(on_zcl_poll_control_fast_poll_stop), service);
+
+ g_signal_connect(zcl_poll_control_object,
+ "handle-set-long-poll-interval",
+ G_CALLBACK(on_zcl_poll_control_set_long_poll_interval), service);
+
+ g_signal_connect(zcl_poll_control_object,
+ "handle-set-short-poll-interval",
+ G_CALLBACK(on_zcl_poll_control_set_short_poll_interval), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zcl_scene_add_scene(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gchar scene_id,
+ gshort transition_time,
+ gshort ext_length,
+ GVariant *scene_name,
+ GVariant *ext_field_set,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(scene_id);
+ NOT_USED(transition_time);
+ NOT_USED(ext_length);
+ NOT_USED(scene_name);
+ NOT_USED(ext_field_set);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_scene_view_scene(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gchar scene_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(scene_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_scene_remove_scene(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gchar scene_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(scene_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_scene_store_scene(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gchar scene_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(scene_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_scene_recall_scene(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gchar scene_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+ NOT_USED(scene_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_scene_remove_all_scene(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zcl_scene_get_scene_membership(ZigbeeZcl_scene *zcl_scene_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort group_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zcl_scene_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(group_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zcl_scene_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZcl_scene *zcl_scene_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zcl_scene_object = zigbee_zcl_scene_skeleton_new();
+ zigbee_object_skeleton_set_zcl_scene(zigbee_object, zcl_scene_object);
+ g_object_unref(zcl_scene_object);
+
+ Z_LOGI("zcl_scene_object: [%p]", zcl_scene_object);
+
+ /*
+ * Register signal handlers for 'zcl_scene' interface
+ */
+ g_signal_connect(zcl_scene_object,
+ "handle-add-scene",
+ G_CALLBACK(on_zcl_scene_add_scene), service);
+
+ g_signal_connect(zcl_scene_object,
+ "handle-view-scene",
+ G_CALLBACK(on_zcl_scene_view_scene), service);
+
+ g_signal_connect(zcl_scene_object,
+ "handle-remove-scene",
+ G_CALLBACK(on_zcl_scene_remove_scene), service);
+
+ g_signal_connect(zcl_scene_object,
+ "handle-store-scene",
+ G_CALLBACK(on_zcl_scene_store_scene), service);
+
+ g_signal_connect(zcl_scene_object,
+ "handle-recall-scene",
+ G_CALLBACK(on_zcl_scene_recall_scene), service);
+
+ g_signal_connect(zcl_scene_object,
+ "handle-remove-all-scene",
+ G_CALLBACK(on_zcl_scene_remove_all_scene), service);
+
+ g_signal_connect(zcl_scene_object,
+ "handle-get-scene-membership",
+ G_CALLBACK(on_zcl_scene_get_scene_membership), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zclbasic_control_reset_factory_default(ZigbeeZclbasic_control *zclbasic_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclbasic_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zclbasic_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZclbasic_control *zclbasic_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zclbasic_control_object = zigbee_zclbasic_control_skeleton_new();
+ zigbee_object_skeleton_set_zclbasic_control(zigbee_object, zclbasic_control_object);
+ g_object_unref(zclbasic_control_object);
+
+ Z_LOGI("zclbasic_control_object: [%p]", zclbasic_control_object);
+
+ /*
+ * Register signal handlers for 'zclbasic_control' interface
+ */
+ g_signal_connect(zclbasic_control_object,
+ "handle-reset-factory-default",
+ G_CALLBACK(on_zclbasic_control_reset_factory_default), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zclglobal_control_read_attributes_req(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *attribute_id,
+ gint attribute_ids_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(attribute_id);
+ NOT_USED(attribute_ids_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_write_attributes_req(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *write_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(write_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_write_attributes_undivided_req(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *write_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar src_ep,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(write_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_write_attributes_no_resp(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *write_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar src_ep,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(write_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_write_attributes_structured(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *write_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar src_ep,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(write_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_read_attributes_structured(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *read_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar src_ep,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(read_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_configure_reporting_req(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *read_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar src_ep,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(read_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_read_configure_reporting(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *read_attribute,
+ gint records_length,
+ gshort node_id,
+ gshort cluster_id,
+ gchar zcl_frame_ctrl,
+ gchar src_ep,
+ gchar dest_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(read_attribute);
+ NOT_USED(records_length);
+ NOT_USED(node_id);
+ NOT_USED(cluster_id);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(src_ep);
+ NOT_USED(dest_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_discover_attributes(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dest_ep,
+ gchar zcl_frame_ctrl,
+ gshort cluster_id,
+ gshort start_attr,
+ gchar max,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dest_ep);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(cluster_id);
+ NOT_USED(start_attr);
+ NOT_USED(max);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_discover_attributes_extended(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dest_ep,
+ gchar zcl_frame_ctrl,
+ gshort cluster_id,
+ gshort start_attr,
+ gchar max,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dest_ep);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(cluster_id);
+ NOT_USED(start_attr);
+ NOT_USED(max);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_discover_commands_received(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dest_ep,
+ gchar zcl_frame_ctrl,
+ gshort cluster_id,
+ gshort start_attr,
+ gchar max,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dest_ep);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(cluster_id);
+ NOT_USED(start_attr);
+ NOT_USED(max);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclglobal_control_discover_commands_generated(ZigbeeZclglobal_control *zclglobal_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dest_ep,
+ gchar zcl_frame_ctrl,
+ gshort cluster_id,
+ gshort start_attr,
+ gchar max,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclglobal_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dest_ep);
+ NOT_USED(zcl_frame_ctrl);
+ NOT_USED(cluster_id);
+ NOT_USED(start_attr);
+ NOT_USED(max);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zclglobal_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZclglobal_control *zclglobal_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zclglobal_control_object = zigbee_zclglobal_control_skeleton_new();
+ zigbee_object_skeleton_set_zclglobal_control(zigbee_object, zclglobal_control_object);
+ g_object_unref(zclglobal_control_object);
+
+ Z_LOGI("zclglobal_control_object: [%p]", zclglobal_control_object);
+
+ /*
+ * Register signal handlers for 'zclglobal_control' interface
+ */
+ g_signal_connect(zclglobal_control_object,
+ "handle-read-attributes-req",
+ G_CALLBACK(on_zclglobal_control_read_attributes_req), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-write-attributes-req",
+ G_CALLBACK(on_zclglobal_control_write_attributes_req), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-write-attributes-undivided-req",
+ G_CALLBACK(on_zclglobal_control_write_attributes_undivided_req), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-write-attributes-no-resp",
+ G_CALLBACK(on_zclglobal_control_write_attributes_no_resp), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-write-attributes-structured",
+ G_CALLBACK(on_zclglobal_control_write_attributes_structured), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-read-attributes-structured",
+ G_CALLBACK(on_zclglobal_control_read_attributes_structured), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-configure-reporting-req",
+ G_CALLBACK(on_zclglobal_control_configure_reporting_req), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-read-configure-reporting",
+ G_CALLBACK(on_zclglobal_control_read_configure_reporting), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-discover-attributes",
+ G_CALLBACK(on_zclglobal_control_discover_attributes), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-discover-attributes-extended",
+ G_CALLBACK(on_zclglobal_control_discover_attributes_extended), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-discover-commands-received",
+ G_CALLBACK(on_zclglobal_control_discover_commands_received), service);
+
+ g_signal_connect(zclglobal_control_object,
+ "handle-discover-commands-generated",
+ G_CALLBACK(on_zclglobal_control_discover_commands_generated), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zclias_control_enroll_response(ZigbeeZclias_control *zclias_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gchar enroll_code,
+ gchar zone_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclias_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(enroll_code);
+ NOT_USED(zone_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zclias_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZclias_control *zclias_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zclias_control_object = zigbee_zclias_control_skeleton_new();
+ zigbee_object_skeleton_set_zclias_control(zigbee_object, zclias_control_object);
+ g_object_unref(zclias_control_object);
+
+ Z_LOGI("zclias_control_object: [%p]", zclias_control_object);
+
+ /*
+ * Register signal handlers for 'zclias_control' interface
+ */
+ g_signal_connect(zclias_control_object,
+ "handle-get-alarm-count",
+ G_CALLBACK(on_zclias_control_enroll_response), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zclidentify_control_identify(ZigbeeZclidentify_control *zclidentify_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar dst_ep,
+ gshort identifytime,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclidentify_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(dst_ep);
+ NOT_USED(identifytime);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zclidentify_control_query(ZigbeeZclidentify_control *zclidentify_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zclidentify_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zclidentify_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZclidentify_control *zclidentify_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zclidentify_control_object = zigbee_zclidentify_control_skeleton_new();
+ zigbee_object_skeleton_set_zclidentify_control(zigbee_object, zclidentify_control_object);
+ g_object_unref(zclidentify_control_object);
+
+ Z_LOGI("zclidentify_control_object: [%p]", zclidentify_control_object);
+
+ /*
+ * Register signal handlers for 'zclidentify_control' interface
+ */
+ g_signal_connect(zclidentify_control_object,
+ "handle-identify",
+ G_CALLBACK(on_zclidentify_control_identify), service);
+
+ g_signal_connect(zclidentify_control_object,
+ "handle-query",
+ G_CALLBACK(on_zclidentify_control_query), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zdo_bind_bind_req(ZigbeeZdo_bind *zdo_bind_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ GVariant *src_addr,
+ gchar src_ep,
+ gshort cluster_id,
+ GVariant *dst_addr,
+ gchar bind_type,
+ gshort group_addr,
+ gchar dst_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdo_bind_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(src_addr);
+ NOT_USED(src_ep);
+ NOT_USED(cluster_id);
+ NOT_USED(dst_addr);
+ NOT_USED(bind_type);
+ NOT_USED(group_addr);
+ NOT_USED(dst_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdo_bind_unbind_req(ZigbeeZdo_bind *zdo_bind_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ GVariant *src_addr,
+ gchar src_ep,
+ gshort cluster_id,
+ GVariant *dst_addr,
+ gchar bind_type,
+ gshort group_addr,
+ gchar dst_ep,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdo_bind_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(src_addr);
+ NOT_USED(src_ep);
+ NOT_USED(cluster_id);
+ NOT_USED(dst_addr);
+ NOT_USED(bind_type);
+ NOT_USED(group_addr);
+ NOT_USED(dst_ep);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zdo_bind_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZdo_bind *zdo_bind_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zdo_bind_object = zigbee_zdo_bind_skeleton_new();
+ zigbee_object_skeleton_set_zdo_bind(zigbee_object, zdo_bind_object);
+ g_object_unref(zdo_bind_object);
+
+ Z_LOGI("zdo_bind_object: [%p]", zdo_bind_object);
+
+ /*
+ * Register signal handlers for 'zdo_bind' interface
+ */
+ g_signal_connect(zdo_bind_object,
+ "handle-bind-req",
+ G_CALLBACK(on_zdo_bind_bind_req), service);
+
+ g_signal_connect(zdo_bind_object,
+ "handle-unbind-req",
+ G_CALLBACK(on_zdo_bind_unbind_req), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 "zigbee_service_interface_common.h"
+
+static gboolean on_zdodev_control_nwk_addr_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ GVariant *eui64,
+ gchar request_type,
+ gchar start_index,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(eui64);
+ NOT_USED(request_type);
+ NOT_USED(start_index);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_matched_descriptor_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gshort profile_id,
+ gchar num_in_cl,
+ GVariant *in_cl,
+ gchar num_out_cl,
+ GVariant *out_cl,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(profile_id);
+ NOT_USED(num_in_cl);
+ NOT_USED(in_cl);
+ NOT_USED(num_out_cl);
+ NOT_USED(out_cl);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_ieee_addr_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_active_ep_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_node_desc_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_power_desc_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_complex_desc_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_user_desc_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_user_desc_set_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar length,
+ GVariant *user_desc,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(length);
+ NOT_USED(user_desc);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_device_announce(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ GVariant *mac_addr,
+ gchar capability,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(mac_addr);
+ NOT_USED(capability);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_simple_desc_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar endpoint,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(endpoint);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_mgmt_lqi_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar start_idx,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(start_idx);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_mgmt_rtg_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar start_idx,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(start_idx);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_mgmt_bind_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ gchar start_idx,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(start_idx);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_mgmt_permit_join_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort addr16,
+ gchar duration,
+ gchar tc_significance,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(addr16);
+ NOT_USED(duration);
+ NOT_USED(tc_significance);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_nwk_update_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ guint scan_channel,
+ gchar scan_duration,
+ gchar scan_count,
+ gint nwk_update_id,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(scan_channel);
+ NOT_USED(scan_duration);
+ NOT_USED(scan_count);
+ NOT_USED(nwk_update_id);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+static gboolean on_zdodev_control_nwk_disc_req(ZigbeeZdodev_control *zdodev_control_object,
+ GDBusMethodInvocation *invocation,
+ gshort node_id,
+ guint scan_channel,
+ gchar scan_duration,
+ gshort scan_count,
+ gchar start_index,
+ gpointer user_data)
+{
+ ZigBeeService *service = (ZigBeeService *)user_data;
+
+ NOT_USED(zdodev_control_object);
+ NOT_USED(invocation);
+ NOT_USED(service);
+ NOT_USED(node_id);
+ NOT_USED(scan_channel);
+ NOT_USED(scan_duration);
+ NOT_USED(scan_count);
+ NOT_USED(start_index);
+
+ /*
+ * TODO -
+ * Create and send request for processing
+ */
+
+ return TRUE;
+}
+
+gboolean zigbee_service_dbus_interface_zdodev_control_init(ZigBeeService *service,
+ ZigbeeObjectSkeleton *zigbee_object)
+{
+ ZigbeeZdodev_control *zdodev_control_object;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ zdodev_control_object = zigbee_zdodev_control_skeleton_new();
+ zigbee_object_skeleton_set_zdodev_control(zigbee_object, zdodev_control_object);
+ g_object_unref(zdodev_control_object);
+
+ Z_LOGI("zdodev_control_object: [%p]", zdodev_control_object);
+
+ /*
+ * Register signal handlers for 'zdodev_control' interface
+ */
+ g_signal_connect(zdodev_control_object,
+ "handle-nwk-addr-req",
+ G_CALLBACK(on_zdodev_control_nwk_addr_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-matched-descriptor-req",
+ G_CALLBACK(on_zdodev_control_matched_descriptor_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-ieee-addr-req",
+ G_CALLBACK(on_zdodev_control_ieee_addr_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-active-ep-req",
+ G_CALLBACK(on_zdodev_control_active_ep_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-node-desc-req",
+ G_CALLBACK(on_zdodev_control_node_desc_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-power-desc-req",
+ G_CALLBACK(on_zdodev_control_power_desc_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-complex-desc-req",
+ G_CALLBACK(on_zdodev_control_complex_desc_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-user-desc-req",
+ G_CALLBACK(on_zdodev_control_user_desc_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-user-desc-set-req",
+ G_CALLBACK(on_zdodev_control_user_desc_set_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-device-announce",
+ G_CALLBACK(on_zdodev_control_device_announce), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-simple-desc-req",
+ G_CALLBACK(on_zdodev_control_simple_desc_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-mgmt-lqi-req",
+ G_CALLBACK(on_zdodev_control_mgmt_lqi_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-mgmt-rtg-req",
+ G_CALLBACK(on_zdodev_control_mgmt_rtg_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-mgmt-bind-req",
+ G_CALLBACK(on_zdodev_control_mgmt_bind_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-mgmt-permit-join-req",
+ G_CALLBACK(on_zdodev_control_mgmt_permit_join_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-nwk-update-req",
+ G_CALLBACK(on_zdodev_control_nwk_update_req), service);
+
+ g_signal_connect(zdodev_control_object,
+ "handle-nwk-disc-req",
+ G_CALLBACK(on_zdodev_control_nwk_disc_req), service);
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+#include <dlog.h>
+
+#include <zblib.h>
+
+#include "zigbee_service_interface.h"
+#include "zigbee_service_dbus_interface.h"
+
+/**< Zigbee service interface initialization */
+gboolean zigbee_service_interface_init(ZigBeeService *service)
+{
+ gboolean ret;
+
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ /* Initialize dbus interface */
+ ret = zigbee_service_dbus_interface_init(service);
+ if (FALSE == ret) {
+ Z_LOGE("zigbee_service_dbus_interface_init failed!!!");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**< Zigbee service interface de-initialization */
+void zigbee_service_interface_deinit(ZigBeeService *service)
+{
+ if (NULL == service) {
+ Z_LOGE("service is NULL");
+ return;
+ }
+
+ /* De-initialize dbus interface */
+ zigbee_service_dbus_interface_deinit(service);
+}
--- /dev/null
+/*
+ * 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_SERVICE_INTERFACE_COMMON_H__
+#define __ZIGBEE_SERVICE_INTERFACE_COMMON_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#include <zblib.h>
+
+#include "zigbee_generated_code.h"
+
+#include "zigbee_service_dbus_interface_service.h"
+#include "zigbee_service_dbus_interface_on_off.h"
+#include "zigbee_service_dbus_interface_door_lock.h"
+#include "zigbee_service_dbus_interface_level_control.h"
+#include "zigbee_service_dbus_interface_thermostat.h"
+#include "zigbee_service_dbus_interface_fan_control.h"
+#include "zigbee_service_dbus_interface_alarm.h"
+#include "zigbee_service_dbus_interface_mfglib_control.h"
+#include "zigbee_service_dbus_interface_zclglobal_control.h"
+#include "zigbee_service_dbus_interface_zdodev_control.h"
+#include "zigbee_service_dbus_interface_zclbasic_control.h"
+#include "zigbee_service_dbus_interface_zclidentify_control.h"
+#include "zigbee_service_dbus_interface_zclias_control.h"
+#include "zigbee_service_dbus_interface_zcl_poll_control.h"
+#include "zigbee_service_dbus_interface_zcl_group.h"
+#include "zigbee_service_dbus_interface_zcl_scene.h"
+#include "zigbee_service_dbus_interface_zdo_bind.h"
+#include "zigbee_service_dbus_interface_zcl_color.h"
+#include "zigbee_service_dbus_interface_custom.h"
+
+/**< ZigBee D-BUS service*/
+#define ZIGBEE_DBUS_SERVICE "org.tizen.zigbee"
+
+/**< 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 */
+ ZigbeeManager *zigbee_mgr;
+ GHashTable *objects; /**< ZigBee D-BUS object(s) */
+
+ gint bus_id; /**< ZigBee D-BUS ID */
+
+ gboolean name_acquired; /**< ZigBee D-BUS name acquired */
+ gboolean sevice_interface_init_complete; /**< ZigBee D-BUS service init completed */
+
+ gboolean zigbee_state; /**< ZigBee service state */
+} ZigbeeCustomData_t;
+
+#endif /* __ZIGBEE_SERVICE_INTERFACE_COMMON_H__ */
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(zigbee-lib C)
+
+MESSAGE(===================================================================)
+MESSAGE(Building...zigbee-lib)
+MESSAGE(===================================================================)
+
+### Set required packages ###
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED glib-2.0 dlog)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ MESSAGE(flag-${flag})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ MESSAGE(EXTRA_CFLAGS-${EXTRA_CFLAGS})
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs -fvisibility=hidden ")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Wredundant-decls -Wcast-align")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
+
+### Include directories ###
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/common/include
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+)
+
+MESSAGE(${CMAKE_C_FLAGS})
+MESSAGE(${CMAKE_EXE_LINKER_FLAGS})
+MESSAGE(${pkgs_LDFLAGS})
+
+### pkgconfig file ###
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+CONFIGURE_FILE(zigbee-lib.pc.in zigbee-lib.pc @ONLY)
+
+### Install files ###
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include/zigbee/lib)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/common/include/ DESTINATION include/zigbee/common)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zigbee-lib.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME zigbee-lib)
+#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT Runtime)
--- /dev/null
+Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
--- /dev/null
+/*
+ * 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_H__
+#define __ZIGBEE_LIB_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <zblib_log.h>
+
+/**< ZigBee module typedefs */
+typedef struct zblib_service_type ZigBeeService;
+typedef struct zblib_plugin_type ZigBeePlugin;
+typedef struct zblib_driver_type ZigBeeDriver;
+typedef struct zblib_service_interface_type ZigBeeServiceInterface;
+
+#endif /* __ZIGBEE_LIB_H__ */
--- /dev/null
+/*
+ * 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_DRIVER_H__
+#define __ZIGBEE_LIB_DRIVER_H__
+
+/* Driver APIs */
+ZigBeeDriver *zblib_driver_new(ZigBeePlugin *plugin,
+ const gchar *object_name,
+ gint object_type);
+void zblib_driver_free(ZigBeeDriver *driver);
+
+#endif /* __ZIGBEE_LIB_DRIVER_H__ */
--- /dev/null
+/*
+ * 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_LOG_H__
+#define __ZIGBEE_LIB_LOG_H__
+
+#include <glib.h>
+
+#define TIZEN_DEBUG_ENABLE
+
+/**< ZigBee debug flag */
+extern gboolean zblib_debug;
+
+#ifndef ZIGBEE_LOG_TAG
+#define ZIGBEE_LOG_TAG "UNKNOWN"
+#endif
+
+enum zblib_log_type {
+ ZIGBEE_LOG_TYPE_MAIN = 0,
+ ZIGBEE_LOG_TYPE_RADIO,
+ ZIGBEE_LOG_TYPE_SYSTEM,
+ ZIGBEE_LOG_TYPE_TIME_CHECK
+};
+
+enum zblib_log_priority {
+ ZIGBEE_LOG_UNKNOWN = 0,
+ ZIGBEE_LOG_DEFAULT,
+ ZIGBEE_LOG_VERBOSE,
+ ZIGBEE_LOG_DEBUG,
+ ZIGBEE_LOG_INFO,
+ ZIGBEE_LOG_WARN,
+ ZIGBEE_LOG_ERROR,
+ ZIGBEE_LOG_FATAL,
+ ZIGBEE_LOG_SILENT
+};
+
+void zblib_log(enum zblib_log_type type, enum zblib_log_priority priority, const char *tag, const char *fmt, ...);
+
+/* Logs would be available in system logs */
+#define Z_LOGI(fmt,args...) do { if(zblib_debug) zblib_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_INFO, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGM(fmt,args...) do { if(zblib_debug) zblib_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_INFO, ZIGBEE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define Z_LOGD(fmt,args...) do { if(zblib_debug) zblib_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_DEBUG, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGW(fmt,args...) do { zblib_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_WARN, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGE(fmt,args...) do { zblib_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_ERROR, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define Z_LOGF(fmt,args...) do { zblib_log(ZIGBEE_LOG_TYPE_SYSTEM, ZIGBEE_LOG_FATAL, ZIGBEE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+
+#define Z_TIME_CHECK(fmt,args...) do { zblib_log(ZIGBEE_LOG_TYPE_TIME_CHECK, ZIGBEE_LOG_INFO, "TIME_CHECK", fmt "\n", ##args); } while (0)
+
+#endif /* __ZIGBEE_LIB_LOG_H__ */
--- /dev/null
+/*
+ * 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_PLUGIN_H__
+#define __ZIGBEE_LIB_PLUGIN_H__
+
+/**< ZigBee plug-in descriptor */
+struct zblib_plugin_descriptor {
+ const gchar *name;
+ int version;
+ gboolean (*is_implemented)(); /**< Is plug-in implemented */
+ gboolean (*load)(); /**< Load plugin */
+ gboolean (*init)(ZigBeePlugin *); /**< Initialize plugin */
+ void (*unload)(ZigBeePlugin *); /**< Unload plugin */
+};
+
+/* ZigBee vendor plug-in APIs */
+ZigBeePlugin *zblib_plugin_new(ZigBeeService *service,
+ const gchar *plugin_name,
+ const struct zblib_plugin_descriptor *descriptor,
+ void *plugin_handle);
+void zblib_plugin_free(ZigBeePlugin *plugin);
+
+const struct zblib_plugin_descriptor *zblib_plugin_get_descriptor(ZigBeePlugin *plugin);
+char *zblib_plugin_get_plugin_name(ZigBeePlugin *plugin);
+
+#endif /* __ZIGBEE_LIB_PLUGIN_H__ */
--- /dev/null
+/*
+ * 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__
+
+ZigBeeService *zblib_service_new();
+void zblib_service_free(ZigBeeService *service);
+
+gboolean zblib_service_run(ZigBeeService *service);
+gboolean zblib_service_exit(ZigBeeService *service);
+
+gboolean zblib_service_add_plugin(ZigBeeService *service, ZigBeePlugin *plugin);
+gboolean zblib_service_remove_plugin(ZigBeeService *service, ZigBeePlugin *plugin);
+
+gboolean zblib_service_load_plugins(ZigBeeService *service, const char *plugin_path);
+gboolean zblib_service_initialize_plugins(ZigBeeService *service);
+gboolean zblib_service_unload_plugins(ZigBeeService *service);
+
+GSList *zblib_service_ref_plugins(ZigBeeService *service);
+
+gboolean zblib_service_add_service_interface(ZigBeeService *service,
+ ZigBeeServiceInterface *service_interface);
+gboolean zblib_service_remove_service_interface(ZigBeeService *service,
+ ZigBeeServiceInterface *service_interface);
+
+ZigBeeServiceInterface *zblib_service_ref_service_interface(ZigBeeService *service,
+ const gchar *service_interface_name);
+
+#endif /* __ZIGBEE_LIB_SERVICE_H__ */
--- /dev/null
+/*
+ * 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_INTERFACE_H__
+#define __ZIGBEE_LIB_SERVICE_INTERFACE_H__
+
+/**< Service interface methods */
+struct zblib_service_interface_methods {
+ gboolean (*send_response)();
+ gboolean (*send_notification)();
+};
+
+/**< Service interface APIs */
+ZigBeeServiceInterface *zblib_service_interface_new(ZigBeeService *service,
+ const gchar *object_name,
+ struct zblib_service_interface_methods *methods);
+void zblib_service_interface_free(ZigBeeService *service,
+ ZigBeeServiceInterface *service_interface);
+
+char *zblib_service_interface_get_name(ZigBeeServiceInterface *service_interface);
+
+gboolean zblib_service_interface_link_user_data(ZigBeeServiceInterface *service_interface,
+ gpointer user_data);
+gpointer zblib_service_interface_ref_user_data(ZigBeeServiceInterface *service_interface);
+
+ZigBeeService *zblib_service_interface_ref_service(ZigBeeServiceInterface *service_interface);
+
+#endif /* __ZIGBEE_LIB_SERVICE_INTERFACE_H__ */
--- /dev/null
+/*
+ * 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_UTIL_H__
+#define __ZIGBEE_LIB_UTIL_H__
+
+#include <glib.h>
+
+#endif /* __ZIGBEE_LIB_UTIL_H__ */
--- /dev/null
+/*
+ * 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>
+
+/**< ZigBee driver object */
+struct zblib_driver_type {
+ gint object_type; /**< ZigBee driver object type */
+ gchar *object_name; /**< ZigBee driver object name */
+
+ ZigBeePlugin *plugin; /**< ZigBee Plug-in */
+
+ ZigBeeService *service; /**< ZigBee Service */
+};
+
+ZigBeeDriver *zblib_driver_new(ZigBeePlugin *plugin,
+ const gchar *object_name,
+ gint object_type)
+{
+ ZigBeeDriver *driver = NULL;
+
+ /* Allocate memory */
+ driver = g_malloc0(sizeof(ZigBeeDriver));
+
+ /* Update fields */
+ driver->object_type = object_type;
+ driver->object_name = g_strdup(object_name);
+ driver->plugin = plugin;
+
+ Z_LOGI("Driver created - Name [%s]", driver->object_name);
+
+ return driver;
+}
+
+void zblib_driver_free(ZigBeeDriver *driver)
+{
+ if (driver == NULL) {
+ Z_LOGE("driver is NULL");
+ return;
+ }
+
+ Z_LOGI("Freeing Driver - Name [%p]", driver->object_name);
+}
--- /dev/null
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <dlog.h>
+
+#include <zblib_log.h>
+
+#define BUFFER_SIZE 1024
+
+void zblib_log(enum zblib_log_type type, enum zblib_log_priority priority, const char *tag, const char *fmt, ...)
+{
+ va_list ap;
+ char buf[BUFFER_SIZE];
+ int log_id = LOG_ID_RADIO;
+
+ switch (type) {
+ case ZIGBEE_LOG_TYPE_SYSTEM: {
+ if (priority >= ZIGBEE_LOG_INFO) {
+ va_start(ap, fmt);
+ vsnprintf(buf, BUFFER_SIZE-1, fmt, ap);
+ va_end(ap);
+ __dlog_print(log_id, priority, tag, "%s", buf);
+ } else {
+#ifdef TIZEN_DEBUG_ENABLE
+ va_start(ap, fmt);
+ vsnprintf(buf, BUFFER_SIZE-1, fmt, ap);
+ va_end(ap);
+ __dlog_print(log_id, priority, tag, "%s", buf);
+#endif
+ }
+ }
+ break;
+
+ case ZIGBEE_LOG_TYPE_TIME_CHECK: {
+#ifdef TIZEN_DEBUG_ENABLE /* User Mode should not log performance data */
+ float a = 0.00, b = 0.00;
+ int next = 0;
+ FILE *fp = fopen("/proc/uptime", "r");
+ if (NULL == fp) {
+ Z_LOGE("fopen() failed");
+ return;
+ }
+ if (fscanf(fp, "%f %f", &a, &b) != 1)
+ next = snprintf(buf, BUFFER_SIZE, "[UPTIME] [Not Set] ");
+ else
+ next = snprintf(buf, BUFFER_SIZE, "[UPTIME] %f ", a);
+ fclose(fp);
+ if (next < 0)
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(buf + next, (BUFFER_SIZE-1) - next, fmt, ap);
+ va_end(ap);
+ __dlog_print(log_id, priority, tag, "%s", buf);
+#endif
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
--- /dev/null
+/*
+ * 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 <dlfcn.h>
+
+#include <zblib.h>
+#include <zblib_plugin.h>
+#include <zblib_driver.h>
+
+/**< ZigBee plug-in object */
+struct zblib_plugin_type {
+ gchar *plugin_name; /**< ZigBee plug-in name */
+ const struct zblib_plugin_descriptor *descriptor; /**< ZigBee plug-in descriptor */
+ void *plugin_handle; /**< ZigBee Plug-in .so handle */
+
+ GSList *driver_list; /**< List of ZigBee drivers */
+
+ ZigBeeService *service; /**< ZigBee Service */
+};
+
+ZigBeePlugin *zblib_plugin_new(ZigBeeService *service,
+ const gchar *plugin_name,
+ const struct zblib_plugin_descriptor *descriptor,
+ void *plugin_handle)
+{
+ ZigBeePlugin *plugin = NULL;
+
+ /* Allocate memory */
+ plugin = g_malloc0(sizeof(ZigBeePlugin));
+
+ /* Update fields */
+ plugin->plugin_name = g_strdup(plugin_name);
+ plugin->descriptor = descriptor;
+ plugin->plugin_handle = plugin_handle;
+ plugin->service = service;
+
+ Z_LOGI("Vendor plug-in created - Name [%s]", descriptor->name);
+
+ return plugin;
+}
+
+void zblib_plugin_free(ZigBeePlugin *plugin)
+{
+ if (plugin == NULL) {
+ Z_LOGE("ZigBee vendor plug-in is NULL");
+ return;
+ }
+
+ Z_LOGI("Freeing Vendor plug-in - Name [%s]", plugin->descriptor->name);
+
+ if (plugin->driver_list) {
+ GSList *list;
+ ZigBeeDriver *driver;
+
+ for (list = plugin->driver_list; list; list = list->next) {
+ driver = list->data;
+ if (!driver)
+ continue;
+
+ zblib_driver_free(driver);
+ list->data = NULL;
+ }
+
+ g_slist_free(plugin->driver_list);
+ plugin->driver_list = NULL;
+ }
+
+ if (plugin->plugin_name) {
+ g_free(plugin->plugin_name);
+ plugin->plugin_name = NULL;
+ }
+
+ plugin->descriptor = NULL;
+
+ if (plugin->plugin_handle) {
+ dlclose(plugin->plugin_handle);
+ plugin->plugin_handle = NULL;
+ }
+
+ g_free(plugin);
+}
+
+const struct zblib_plugin_descriptor *zblib_plugin_get_descriptor(ZigBeePlugin *plugin)
+{
+ if (plugin == NULL) {
+ Z_LOGE("ZigBee vendor plug-in is NULL");
+ return NULL;
+ }
+
+ return plugin->descriptor;
+}
+
+char *zblib_plugin_get_plugin_name(ZigBeePlugin *plugin)
+{
+ if (plugin == NULL) {
+ Z_LOGE("ZigBee vendor plug-in is NULL");
+ return NULL;
+ }
+
+ return g_strdup(plugin->plugin_name);
+}
--- /dev/null
+/*
+ * 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 <dlfcn.h>
+#include <sys/stat.h>
+
+#include <zblib.h>
+#include <zblib_service.h>
+#include <zblib_plugin.h>
+#include <zblib_service_interface.h>
+
+/**< ZigBee Service object */
+struct zblib_service_type {
+ GMainLoop *main_loop; /**< Service main-loop */
+
+ GSList *interface_objs; /**< ZigBee Service interface objects */
+ GSList *plugins; /**< ZigBee plug-ins */
+};
+
+static void *__zblib_service_load_plugin(gchar *filename,
+ struct zblib_plugin_descriptor **descriptor_out)
+{
+ struct zblib_plugin_descriptor *descriptor = NULL;
+ void *handle = NULL;
+ struct stat stat_buf;
+ char file_date[27];
+
+ if (descriptor_out == NULL) {
+ Z_LOGE("descriptor_out is NULL!!!");
+ return FALSE;
+ }
+
+ /* Open .so */
+ handle = dlopen(filename, RTLD_LAZY);
+ if (NULL == handle) {
+ Z_LOGE("dlopen() failed:[%s]", filename);
+ return NULL;
+ }
+
+ /* Get symbol - "zigbee_plugin_descriptor" */
+ descriptor = dlsym(handle, "zigbee_plugin_descriptor");
+ if (NULL == descriptor) {
+ Z_LOGE("dlsym() failed:[%s]", "plugin_define_desc");
+ dlclose(handle);
+ return NULL;
+ }
+
+ Z_LOGD("%s plugin", descriptor->name);
+ Z_LOGD(" - path = %s", filename);
+ Z_LOGD(" - version = %d", descriptor->version);
+
+ memset(&stat_buf, 0x00, sizeof(stat_buf));
+ memset(&file_date, '\0', sizeof(file_date));
+
+ if (0 == stat(filename, &stat_buf)) {
+ if (NULL != ctime_r(&stat_buf.st_mtime, file_date)) {
+ if (1 < strlen(file_date))
+ file_date[strlen(file_date)-1] = '\0';
+ Z_LOGD(" - date = %s", file_date);
+ }
+ }
+
+ /* Load plug-in */
+ if (G_LIKELY(descriptor->load)) {
+ if (G_UNLIKELY(FALSE == descriptor->load())) {
+ Z_LOGW("load() failed... Skip this plugin!");
+ dlclose(handle);
+ return NULL;
+ } else {
+ Z_LOGI("Plug-in (%s) loaded!", descriptor->name);
+ }
+ }
+
+ *descriptor_out = descriptor;
+
+ return handle;
+}
+
+static gboolean __zblib_service_init_plugin(ZigBeePlugin *plugin)
+{
+ const struct zblib_plugin_descriptor *descriptor = zblib_plugin_get_descriptor(plugin);
+
+ if ((descriptor == NULL) || (descriptor->init == NULL)) {
+ Z_LOGE("descriptor OR init function is NULL!!!");
+ return FALSE;
+ }
+
+ if (descriptor->init(plugin) == FALSE) {
+ char *plugin_name = zblib_plugin_get_plugin_name(plugin);
+ if (NULL != plugin_name) {
+ Z_LOGE("plugin(%s) init failed!", plugin_name);
+ g_free(plugin_name);
+ }
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean __zblib_service_unload_plugin(ZigBeePlugin *plugin)
+{
+ const struct zblib_plugin_descriptor *descriptor = zblib_plugin_get_descriptor(plugin);
+ char *plugin_name = zblib_plugin_get_plugin_name(plugin);
+
+ if ((descriptor == NULL) || (descriptor->unload == NULL)) {
+ Z_LOGE("descriptor OR unload function is NULL!!!");
+ return FALSE;
+ }
+
+
+ descriptor->unload(plugin);
+ Z_LOGI("plugin(%s) unloaded!", plugin_name);
+
+ return TRUE;
+}
+
+ZigBeeService *zblib_service_new()
+{
+ ZigBeeService *service;
+
+ service = g_malloc0(sizeof(struct zblib_service_type));
+
+ /* Create g-main loop */
+ service->main_loop = g_main_loop_new(NULL, FALSE);
+ if (service->main_loop == NULL) {
+ Z_LOGE("g-main loop creation failed!!!");
+ g_free(service);
+ return NULL;
+ }
+
+ return service;
+}
+
+void zblib_service_free(ZigBeeService *service)
+{
+ if (service == NULL) {
+ Z_LOGE("service is NULL");
+ return;
+ }
+
+ /* Free plug-ins */
+ if (service->plugins) {
+ g_slist_free(service->plugins);
+ service->plugins = NULL;
+ }
+
+ /* Unref 'g-main loop' */
+ if (service->main_loop)
+ g_main_loop_unref(service->main_loop);
+
+ g_free(service);
+}
+
+gboolean zblib_service_run(ZigBeeService *service)
+{
+ if ((service == NULL) || (service->main_loop == NULL)) {
+ Z_LOGE("service or mainloop is NULL");
+ return FALSE;
+ }
+
+ g_main_loop_run(service->main_loop);
+
+ return TRUE;
+}
+
+gboolean zblib_service_exit(ZigBeeService *service)
+{
+ if ((service == NULL) || (service->main_loop == NULL)) {
+ Z_LOGE("service or mainloop is NULL");
+ return FALSE;
+ }
+
+ g_main_loop_quit(service->main_loop);
+
+ return TRUE;
+}
+
+gboolean zblib_service_add_plugin(ZigBeeService *service, ZigBeePlugin *plugin)
+{
+ gchar *plugin_name;
+
+ if ((service == NULL) || (plugin == NULL)) {
+ Z_LOGE("service: [%p] plugin: [%p]", service, plugin);
+ return FALSE;
+ }
+
+ plugin_name = zblib_plugin_get_plugin_name(plugin);
+
+ /* All plug-ins would be appended */
+ service->plugins = g_slist_append(service->plugins, plugin);
+ Z_LOGD("%s added", plugin_name);
+ g_free(plugin_name);
+
+ return TRUE;
+}
+
+gboolean zblib_service_remove_plugin(ZigBeeService *service, ZigBeePlugin *plugin)
+{
+ if ((service == NULL) || (plugin == NULL)) {
+ Z_LOGE("service: [%p] plugin: [%p]", service, plugin);
+ return FALSE;
+ }
+
+ /* Specific vendor plug-in would be removed */
+ service->plugins = g_slist_remove(service->plugins, plugin);
+
+ return TRUE;
+}
+
+gboolean zblib_service_load_plugins(ZigBeeService *service, const char *plugin_path)
+{
+ const gchar *file = NULL;
+ gchar *filename = NULL;
+ GDir *dir = NULL;
+ void *handle = NULL;
+ struct zblib_plugin_descriptor *descriptor = NULL;
+ ZigBeePlugin *plugin = NULL;
+ gboolean ret;
+
+ if ((service == NULL) || (plugin_path == NULL)) {
+ Z_LOGE("service: [%p] plugin_path: [%p]", service, plugin_path);
+ return FALSE;
+ }
+
+ /* Open plug-in directory */
+ dir = g_dir_open(plugin_path, 0, NULL);
+ if (dir == NULL) {
+ Z_LOGE("Directory open failed!");
+ return FALSE;
+ }
+
+ /* Scan through all libraries in plug-in directory */
+ while ((file = g_dir_read_name(dir)) != NULL) {
+ if ((g_str_has_prefix(file, "lib") == TRUE)
+ || (g_str_has_suffix(file, ".so") == FALSE))
+ continue;
+
+ filename = g_build_filename(plugin_path, file, NULL);
+
+ /* Load plug-in */
+ handle = __zblib_service_load_plugin(filename, &descriptor);
+ if (NULL == handle) {
+ g_free(filename);
+ continue;
+ }
+
+ /* Create new plug-in */
+ plugin = zblib_plugin_new(service, filename, descriptor, handle);
+ if (NULL == plugin) {
+ g_free(filename);
+ continue;
+ }
+
+ /* Add new plug-in */
+ ret = zblib_service_add_plugin(service, plugin);
+ if (FALSE == ret) {
+ zblib_plugin_free(plugin);
+ }
+
+ g_free(filename);
+ }
+ g_dir_close(dir);
+
+ return TRUE;
+}
+
+gboolean zblib_service_initialize_plugins(ZigBeeService *service)
+{
+ GSList *list;
+
+ if (service == NULL) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ /* Refer plug-in list */
+ list = zblib_service_ref_plugins(service);
+ while (list != NULL) {
+ /* Initialize each plug-in */
+ if (G_UNLIKELY(FALSE == __zblib_service_init_plugin((ZigBeePlugin *)(list->data)))) {
+ list = g_slist_next(list);
+ continue;
+ }
+ list = g_slist_next(list);
+ }
+
+ return TRUE;
+}
+
+gboolean zblib_service_unload_plugins(ZigBeeService *service)
+{
+ GSList *list;
+
+ if (service == NULL) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ list = zblib_service_ref_plugins(service);
+ while (list != NULL) {
+ ZigBeePlugin *plugin = list->data;
+
+ /* Unload each plug-in */
+ if (G_UNLIKELY(FALSE == __zblib_service_unload_plugin(plugin))) {
+ list = g_slist_next(list);
+ continue;
+ }
+
+ list = g_slist_next(list);
+ zblib_service_remove_plugin(service, plugin);
+ }
+
+ return TRUE;
+}
+
+GSList *zblib_service_ref_plugins(ZigBeeService *service)
+{
+ if (service == NULL) {
+ Z_LOGE("service is NULL");
+ return NULL;
+ }
+
+ return service->plugins;
+}
+
+gboolean zblib_service_add_service_interface(ZigBeeService *service,
+ ZigBeeServiceInterface *service_interface)
+{
+ gchar *object_name;
+
+ if ((service == NULL) || (service_interface == NULL)) {
+ Z_LOGE("service: [%p] service_interface: [%p]", service, service_interface);
+ return FALSE;
+ }
+
+ object_name = zblib_service_interface_get_name(service_interface);
+
+ /*
+ * All service interface objects would be appended
+ */
+ service->interface_objs = g_slist_append(service->interface_objs, service_interface);
+ Z_LOGD("%s added", object_name);
+ g_free(object_name);
+
+ return TRUE;
+}
+
+gboolean zblib_service_remove_service_interface(ZigBeeService *service,
+ ZigBeeServiceInterface *service_interface)
+{
+ if ((service == NULL) || (service_interface == NULL)) {
+ Z_LOGE("service: [%p] service_interface: [%p]", service, service_interface);
+ return FALSE;
+ }
+
+ /*
+ * service interface object would be removed
+ */
+ service->interface_objs = g_slist_remove(service->interface_objs, service_interface);
+
+ return TRUE;
+}
+
+ZigBeeServiceInterface *zblib_service_ref_service_interface(ZigBeeService *service,
+ const gchar *service_interface_name)
+{
+ ZigBeeServiceInterface *service_interface = NULL;
+ ZigBeeServiceInterface *tmp_service_interface = NULL;
+ gchar *object_name;
+
+ GSList *list;
+
+ if ((service == NULL) || (service_interface_name == NULL)) {
+ Z_LOGE("service: [%p] service_interface_name: [%p]", service, service_interface_name);
+ return NULL;
+ }
+
+ list = service->interface_objs;
+ while (list) {
+ tmp_service_interface = (ZigBeeServiceInterface *)list->data;
+
+ /* Get object name of service_interface */
+ object_name = zblib_service_interface_get_name(tmp_service_interface);
+ if (g_strcmp0(service_interface_name, object_name) == 0) {
+ g_free(object_name);
+
+ service_interface = tmp_service_interface;
+ break;
+ }
+
+ list = g_slist_next(list);
+ }
+
+ if (service_interface == NULL) {
+ Z_LOGE("Service interface object of name '%s' not found!",
+ service_interface_name);
+ return NULL;
+ }
+
+ Z_LOGD("'%s' found", service_interface_name);
+
+ return service_interface;
+}
+
--- /dev/null
+/*
+ * 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_service_interface.h>
+
+/**< ZigBee Service interface object */
+struct zblib_service_interface_type {
+ gchar *object_name; /**< ZigBee Service interface object name */
+ struct zblib_service_interface_methods *methods; /**< ZigBee Service interface object methods */
+
+ gpointer user_data; /**< ZigBee servcie interface data */
+
+ ZigBeeService *service; /**< ZigBee Service */
+};
+
+ZigBeeServiceInterface *zblib_service_interface_new(ZigBeeService *service,
+ const gchar *object_name,
+ struct zblib_service_interface_methods *methods)
+{
+ ZigBeeServiceInterface *service_interface = NULL;
+
+ if ((NULL == service) || (NULL == object_name)) {
+ Z_LOGE("service [%p] or object_name [%p] is NULL",
+ service, object_name);
+ return NULL;
+ }
+
+ /* Allocate memory */
+ service_interface = g_malloc0(sizeof(ZigBeeServiceInterface));
+
+ /* Update fields */
+ service_interface->object_name = g_strdup(object_name);
+ service_interface->methods = methods;
+ service_interface->service = service;
+
+ Z_LOGI("Service interface created - Name [%s]",
+ service_interface->object_name);
+
+ return service_interface;
+}
+
+void zblib_service_interface_free(ZigBeeService *service,
+ ZigBeeServiceInterface *service_interface)
+{
+ if ((NULL == service) || (NULL == service_interface)) {
+ Z_LOGE("service [%p] or service_interface [%p] is NULL",
+ service, service_interface);
+ return;
+ }
+
+ Z_LOGI("Freeing Service interface - Name [%p]",
+ service_interface->object_name);
+
+ /* Free resources */
+ g_free(service_interface->object_name);
+ g_free(service_interface);
+}
+
+char *zblib_service_interface_get_name(ZigBeeServiceInterface *service_interface)
+{
+ if (NULL == service_interface) {
+ Z_LOGE("service_interface is NULL");
+ return NULL;
+ }
+
+ return g_strdup(service_interface->object_name);
+}
+
+gboolean zblib_service_interface_link_user_data(ZigBeeServiceInterface *service_interface,
+ gpointer user_data)
+{
+ if (NULL == service_interface) {
+ Z_LOGE("service_interface is NULL");
+ return FALSE;
+ }
+
+ service_interface->user_data = user_data;
+
+ return TRUE;
+}
+
+gpointer zblib_service_interface_ref_user_data(ZigBeeServiceInterface *service_interface)
+{
+ if (NULL == service_interface) {
+ Z_LOGE("service_interface is NULL");
+ return NULL;
+ }
+
+ return service_interface->user_data;
+}
+
+ZigBeeService *zblib_service_interface_ref_service(ZigBeeServiceInterface *service_interface)
+{
+ if (NULL == service_interface) {
+ Z_LOGE("service_interface is NULL");
+ return NULL;
+ }
+
+ return service_interface->service;
+}
--- /dev/null
+/*
+ * 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_util.h>
+
+gboolean zblib_debug = TRUE;
--- /dev/null
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: lib-zigbee
+Description: ZigBee core APIs
+Version: 1.0
+Requires: glib-2.0 gobject-2.0
+Libs: -L${libdir} -lzigbee-lib -ldl
+Cflags: -I${includedir}/zigbee/lib -I${includedir}/zigbee/common
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(zigbee-service C)
+
+MESSAGE(===================================================================)
+MESSAGE(Building...zigbee-service)
+MESSAGE(===================================================================)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR ${LIB_INSTALL_DIR})
+SET(UNITDIR ${UNIT_INSTALL_DIR})
+SET(INCLUDEDIR "\${prefix}/include")
+
+# Set required packages
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED glib-2.0 dlog)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wall -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align -Wcast-qual -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+
+##Address-Space Layout Randomization
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+ADD_DEFINITIONS("-DZIGBEE_LOG_TAG=\"ZIGBEE-SVC\"")
+
+IF (TIZEN_DEBUG_ENABLE)
+ ADD_DEFINITIONS ("-DTIZEN_DEBUG_ENABLE")
+ENDIF (TIZEN_DEBUG_ENABLE)
+
+MESSAGE(${CMAKE_C_FLAGS})
+MESSAGE(${pkgs_LDFLAGS})
+
+### Include directories ###
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/../zigbee-lib/include
+ ${CMAKE_SOURCE_DIR}/common/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/../zigbee-interface/include
+)
+
+### Sources ###
+SET(ZIGBEE_SERVICE_SRCS
+ src/zigbee_service.c
+)
+
+### Binary build ###
+### zigbee-service ###
+ADD_LIBRARY(${PROJECT_NAME} ${ZIGBEE_SERVICE_SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE ${pkgs_LDFLAGS})
+
+### Install files ###
+#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT Runtime)
--- /dev/null
+/*
+ * 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_SERVICE_H__
+#define __ZIGBEE_SERVICE_H__
+
+gboolean zigbee_service_init(ZigBeeService *service);
+void zigbee_service_deinit(ZigBeeService *service);
+
+#endif /* __ZIGBEE_SERVICE_H__ */
--- /dev/null
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+#include <dlog.h>
+
+#include <zblib.h>
+#include <zblib_service.h>
+
+#include "zigbee_service.h"
+
+#ifndef ZIGBEE_DEFAULT_PLUGINS_PATH
+#define ZIGBEE_DEFAULT_PLUGINS_PATH "/usr/lib/zigbee/plugins/"
+#endif
+
+/* Zigbee service initialization */
+gboolean zigbee_service_init(ZigBeeService *service)
+{
+ const char *zigbee_plugin_path = ZIGBEE_DEFAULT_PLUGINS_PATH;
+
+ if (service == NULL) {
+ Z_LOGE("service is NULL");
+ return FALSE;
+ }
+
+ /* Load ZigBee plug-ins */
+ if (G_UNLIKELY(TRUE != zblib_service_load_plugins(service, zigbee_plugin_path))) {
+ Z_LOGE("Load plug-ins failed!");
+ return FALSE;
+ }
+
+ Z_TIME_CHECK("Loading Plugins Complete");
+
+ /* Initialize ZigBee plug-ins */
+ if (G_UNLIKELY(TRUE != zblib_service_initialize_plugins(service))) {
+ Z_LOGE("Initialize plug-ins failed!");
+ return FALSE;
+ }
+
+ Z_TIME_CHECK("Initializing Plugins Complete. Starting Daemon");
+
+ return TRUE;
+}
+
+/* Zigbee service de-initialization */
+void zigbee_service_deinit(ZigBeeService *service)
+{
+ if (service == NULL) {
+ Z_LOGE("service is NULL");
+ return;
+ }
+
+ /* Unload ZigBee plug-ins */
+ if (G_UNLIKELY(TRUE != zblib_service_unload_plugins(service))) {
+ Z_LOGE("Unload plug-ins failed!");
+ return;
+ }
+
+ Z_TIME_CHECK("Unload Plugins Complete");
+}
+