menu.c
custom.c
zcl-cluster-alarm.c
+ zcl-cluster-basic.c
zcl-cluster-colorctrl.c
zcl-cluster-group.c
zcl-cluster-identity.c
+ zcl-cluster-ias-zone.c
zcl-cluster-levelctrl.c
zcl-cluster-onoff.c
zcl-cluster-pollctrl.c
--- /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.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <glib.h>
+#include <gio/gio.h>
+
+#include <zigbee.h>
+
+#include "main.h"
+#include "menu.h"
+
+extern zigbee_h handle;
+
+extern nwk_addr dest_addr16;
+extern simple_desc_s st_ep1;
+
+static int run_reset_factory_default(MManager *mm, struct menu_data *menu)
+{
+ int ret = ZIGBEE_ERROR_NONE;
+
+ ret = zb_zcl_basic_reset_factory_default(handle, dest_addr16, st_ep1.ep);
+ if (ZIGBEE_ERROR_NONE != ret) {
+ msg("zb_zcl_basic_reset_factory_default(0x%X) - FAILED!!!", ret);
+ return RET_FAILURE;
+ }
+
+ msg(" - zb_zcl_basic_reset_factory_default() ret: [0x%X]", ret);
+ msg("");
+
+ return RET_SUCCESS;
+}
+
+static struct menu_data _menu_reset_factory_default[] = {
+ { "1", "Run", NULL, run_reset_factory_default, NULL },
+ { NULL, NULL, },
+};
+
+struct menu_data menu_zcl_cluster_basic[] = {
+ { "1", "zb_zcl_basic_reset_factory_default",
+ _menu_reset_factory_default, NULL, NULL },
+ { NULL, NULL, },
+};
--- /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.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <glib.h>
+#include <gio/gio.h>
+
+#include <zigbee.h>
+
+#include "main.h"
+#include "menu.h"
+
+extern zigbee_h handle;
+
+extern nwk_addr dest_addr16;
+extern simple_desc_s sj_ep1;
+
+static char data_enroll_response_code[MENU_DATA_SIZE + 1] = "10";
+static char data_zone_id[MENU_DATA_SIZE + 1] = "77";
+
+static int run_enroll_response(MManager *mm, struct menu_data *menu)
+{
+ int ret = ZIGBEE_ERROR_NONE;
+ unsigned char enroll_response_code = 10;
+ unsigned char zone_id = 10;
+
+ if (strlen(data_enroll_response_code))
+ enroll_response_code = (unsigned short)strtol(data_enroll_response_code, NULL, 10);
+
+ if (strlen(data_zone_id))
+ zone_id = (unsigned short)strtol(data_zone_id, NULL, 10);
+
+ ret = zb_zcl_zone_enroll_response(handle, dest_addr16, sj_ep1.ep,
+ enroll_response_code, zone_id);
+ if (ZIGBEE_ERROR_NONE != ret) {
+ msg("zb_zcl_zone_enroll_response(0x%X) - FAILED!!!", ret);
+ return RET_FAILURE;
+ }
+
+ msg(" - zb_zcl_zone_enroll_response() ret: [0x%X]", ret);
+ msg("");
+
+ return RET_SUCCESS;
+}
+
+static struct menu_data _menu_enroll_response[] = {
+ { "1", "Enroll response time", NULL, NULL, data_enroll_response_code },
+ { "2", "Zone ID", NULL, NULL, data_zone_id },
+ { "3", "Run", NULL, run_enroll_response, NULL },
+ { NULL, NULL, },
+};
+
+struct menu_data menu_zcl_cluster_ias_zone[] = {
+ { "1", "zb_zcl_enroll_response", _menu_enroll_response, NULL, NULL },
+ { NULL, NULL, },
+};
#include "menu.h"
extern struct menu_data menu_zcl_cluster_alarm[];
+extern struct menu_data menu_zcl_cluster_basic[];
extern struct menu_data menu_zcl_cluster_colorctrl[];
extern struct menu_data menu_zcl_cluster_group[];
extern struct menu_data menu_zcl_cluster_identity[];
+extern struct menu_data menu_zcl_cluster_ias_zone[];
extern struct menu_data menu_zcl_cluster_levelctrl[];
extern struct menu_data menu_zcl_cluster_onoff[];
extern struct menu_data menu_zcl_cluster_pollctrl[];
struct menu_data menu_zcl_cluster[] = {
{ "1", "Alarm Cluster", menu_zcl_cluster_alarm, NULL, NULL },
- { "2", "Basic Cluster", NULL, NULL, NULL },
+ { "2", "Basic Cluster", menu_zcl_cluster_basic, NULL, NULL },
{ "3", "Color Control Cluster", menu_zcl_cluster_colorctrl, NULL, NULL },
{ "4", "Group Cluster", menu_zcl_cluster_group, NULL, NULL },
- { "5", "IAS zone Cluster", NULL, NULL, NULL },
+ { "5", "IAS zone Cluster", menu_zcl_cluster_ias_zone, NULL, NULL },
{ "6", "Identity Cluster", menu_zcl_cluster_identity, NULL, NULL },
{ "7", "Level Control Cluster", menu_zcl_cluster_levelctrl, NULL, NULL },
{ "8", "On/Off Cluster", menu_zcl_cluster_onoff, NULL, NULL },