basic_attr_list,
&g_device_ctx.basic_attr.zcl_version,
&g_device_ctx.basic_attr.app_version,
&g_device_ctx.basic_attr.stack_version,
&g_device_ctx.basic_attr.hw_version,
&g_device_ctx.basic_attr.mf_name,
&g_device_ctx.basic_attr.model_id,
&g_device_ctx.basic_attr.date_code,
&g_device_ctx.basic_attr.power_source,
&g_device_ctx.basic_attr.location_id,
&g_device_ctx.basic_attr.ph_env,
&g_device_ctx.basic_attr.sw_build_id);
ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list,
&g_device_ctx.identify_attr.identify_time);
ias_zone_attr_list,
&IZS_DEVICE_ZONE_STATE(),
&g_device_ctx.zone_attr.zone_type,
&g_device_ctx.zone_attr.zone_status,
&g_device_ctx.zone_attr.number_of_zone_sens_levels_supported,
&g_device_ctx.zone_attr.current_zone_sens_level,
&IZS_DEVICE_CIE_ADDR(),
&g_device_ctx.zone_attr.zone_id,
&g_device_ctx.zone_attr.cie_short_addr,
&g_device_ctx.zone_attr.cie_ep);
&g_device_ctx.poll_control_attr.checkin_interval,
&g_device_ctx.poll_control_attr.long_poll_interval,
&g_device_ctx.poll_control_attr.short_poll_interval,
&g_device_ctx.poll_control_attr.fast_poll_timeout,
&g_device_ctx.poll_control_attr.checkin_interval_min,
&g_device_ctx.poll_control_attr.long_poll_interval_min,
&g_device_ctx.poll_control_attr.fast_poll_timeout_max);
#define bat_num
power_config_attr_list,
&g_device_ctx.pwr_cfg_attr.voltage,
&g_device_ctx.pwr_cfg_attr.size,
&g_device_ctx.pwr_cfg_attr.quantity,
&g_device_ctx.pwr_cfg_attr.rated_voltage,
&g_device_ctx.pwr_cfg_attr.alarm_mask,
&g_device_ctx.pwr_cfg_attr.voltage_min_threshold,
&g_device_ctx.pwr_cfg_attr.remaining,
&g_device_ctx.pwr_cfg_attr.threshold1,
&g_device_ctx.pwr_cfg_attr.threshold2,
&g_device_ctx.pwr_cfg_attr.threshold3,
&g_device_ctx.pwr_cfg_attr.min_threshold,
&g_device_ctx.pwr_cfg_attr.percent_threshold1,
&g_device_ctx.pwr_cfg_attr.percent_threshold2,
&g_device_ctx.pwr_cfg_attr.percent_threshold3,
&g_device_ctx.pwr_cfg_attr.alarm_state);
#ifdef IZS_OTA
&g_device_ctx.ota_attr.upgrade_server,
&g_device_ctx.ota_attr.file_offset,
&g_device_ctx.ota_attr.file_version,
&g_device_ctx.ota_attr.stack_version,
&g_device_ctx.ota_attr.downloaded_file_ver,
&g_device_ctx.ota_attr.downloaded_stack_ver,
&g_device_ctx.ota_attr.image_status,
&g_device_ctx.ota_attr.manufacturer,
&g_device_ctx.ota_attr.image_type,
&g_device_ctx.ota_attr.min_block_reque,
&g_device_ctx.ota_attr.image_stamp,
&g_device_ctx.ota_attr.server_addr,
&g_device_ctx.ota_attr.server_ep,
IZS_INIT_OTA_HW_VERSION,
IZS_OTA_IMAGE_BLOCK_DATA_SIZE_MAX,
#else
zb_zcl_attr_t ota_upgrade_attr_list[] = { { ZB_ZCL_NULL_ID, 0, 0, NULL } };
#endif
#ifdef IZS_WWAH
ZB_ZCL_DECLARE_WWAH_ATTRIB_LIST(wwah_attr_list);
#else
zb_zcl_attr_t wwah_attr_list[] = { { ZB_ZCL_NULL_ID, 0, 0, NULL } };
#endif
#ifdef IZS_WWAH
IZS_DECLARE_IAS_ZONE_CLUSTER_LIST(
cs_device_clusters,
basic_attr_list,
wwah_attr_list,
identify_attr_list,
ias_zone_attr_list,
poll_ctrl_attr_list,
power_config_attr_list,
ota_upgrade_attr_list);
#else
IZS_DECLARE_IAS_ZONE_CLUSTER_LIST(
cs_device_clusters,
basic_attr_list,
identify_attr_list,
ias_zone_attr_list,
poll_ctrl_attr_list,
power_config_attr_list,
ota_upgrade_attr_list);
#endif
IZS_DECLARE_IAS_ZONE_EP(cs_device_ep, IZS_DEVICE_ENDPOINT, cs_device_clusters);
Registering device list
{
TRACE_MSG(TRACE_APP1,
">> izs_zcl_cmd_handler %i", (FMT__H, param));
ZB_ZCL_DEBUG_DUMP_HEADER(cmd_info);
{
{
{
{
{
if (0 != ZB_ZCL_ATTR_GET32(write_attr_req->
attr_value))
{
TRACE_MSG(TRACE_APP2,
"check in interval is set", (FMT__0));
if (!g_device_ctx.check_in_started)
{
TRACE_MSG(TRACE_APP2,
"save addr and start check-in", (FMT__0));
if (canceled_param)
{
TRACE_MSG(TRACE_APP2,
"free canceled buffer %hd", (FMT__H, canceled_param));
}
}
}
else
{
TRACE_MSG(TRACE_APP2,
"mark check-in as not started", (FMT__0));
g_device_ctx.check_in_started = 0;
}
}
}
break;
default:
break;
}
}
{
{
{
{
#ifdef FAST_POLLING_DURING_COMMISSIONING
izs_start_fast_polling_for_commissioning(IZS_DEVICE_TURBO_POLL_AFTER_CIE_ADDR_DURATION * 1000l);
#else
ZDO_CTX().poll_update_delay = IZS_DEVICE_INITIAL_FAST_POLL_DURATION;
#endif
g_device_ctx.zone_attr.cie_short_addr = cmd_info->addr_data.common_data.source.u.short_addr;
g_device_ctx.zone_attr.cie_ep = cmd_info->addr_data.common_data.src_endpoint;
"CIE address is updated. New cie_short_addr = 0x%x, cie_ep = 0x%x ",
(FMT__H_H, g_device_ctx.zone_attr.cie_short_addr, g_device_ctx.zone_attr.cie_ep));
if (g_device_ctx.enrollment_method == ZB_ZCL_WWAH_ENROLLMENT_MODE_AUTO_ENROLL_REQUEST)
{
TRACE_MSG(TRACE_APP1,
"auto enroll request mode - send EnrollRequest", (FMT__0));
g_device_ctx.enroll_req_generated =
ZB_TRUE;
}
}
}
break;
default:
break;
}
} else
{
{
{
TRACE_MSG(TRACE_APP1,
"ZB_ZCL_CMD_IAS_ZONE_ZONE_ENROLL_RESPONSE_ID", (FMT__0));
cmd_processed = zb_zcl_process_ias_zone_specific_commands(param);
TRACE_MSG(TRACE_APP1,
"cmd_processed %hd", (FMT__H, cmd_processed));
if (IZS_DEVICE_IS_ENROLLED())
{
TRACE_MSG(TRACE_APP1,
"device is enrolled, save data", (FMT__0));
g_device_ctx.zone_attr.cie_ep = src_ep;
g_device_ctx.zone_attr.cie_short_addr = src_addr;
#ifdef ZB_USE_NVRAM
#endif
#ifdef IZS_OTA
izs_check_and_get_ota_server(0);
#endif
#ifdef FAST_POLLING_DURING_COMMISSIONING
izs_start_fast_polling_for_commissioning(IZS_DEVICE_TURBO_POLL_AFTER_ENROLL_DURATION * 1000l);
#endif
}
break;
}
default:
break;
}
}
}
TRACE_MSG(TRACE_APP1,
"<< izs_zcl_cmd_handler processed %hd", (FMT__H, cmd_processed));
return cmd_processed;
}