1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
/* Copyright [2009 - 2020] Exegin Technologies Limited. All rights reserved. */
#ifndef ZCL_ALARM_H
# define ZCL_ALARM_H
/*--------------------------------------------------------------------------
* DESCRIPTION
* Interface definition for the ZCL Alarms cluster.
*--------------------------------------------------------------------------
*/
/* PICS.ZCL.Alarm
* ALM.S | True
* ALM.C | True
*
* Server Attributes
* ALM.S.A0000 | True
*
* Commands Received
* ALM.S.C00.Rsp | True
* ALM.S.C01.Rsp | True
* ALM.S.C02.Rsp | True
* ALM.S.C03.Rsp | True
*
* Commands Generated
* ALM.S.C00.Tx | True
* ALM.S.C01.Tx | True
*
*
* Client Side
*
* Commands Received
* ALM.C.C00.Rsp | True
* ALM.C.C01.Rsp | True
*
* Commands Generated
* ALM.C.C00.Tx | True
* ALM.C.C01.Tx | True
* ALM.C.C02.Tx | True
* ALM.C.C03.Tx | True
*/
#include "zcl/zcl.h"
/*---------------------------------------------------------------
* Definitions
*---------------------------------------------------------------
*/
/* Alarms cluster attribute identifiers. */
enum {
ZCL_ALARM_ATTR_COUNT = 0x0000
};
/* Alarms cluster client commands. */
enum {
ZCL_ALARM_COMMAND_RESET = 0x00,
ZCL_ALARM_COMMAND_RESET_ALL,
ZCL_ALARM_COMMAND_GET,
ZCL_ALARM_COMMAND_RESET_LOG
};
/* Alarms cluster server commands. */
enum {
ZCL_ALARM_COMMAND_ALARM = 0x00,
ZCL_ALARM_COMMAND_GET_RESPONSE
};
/*---------------------------------------------------------------
* Structures
*---------------------------------------------------------------
*/
/*
* Callback on Alarm Client Cluster when an alarm is received
*/
typedef void (*ZbZclAlarmClientCallbackT)
(void *arg, /* supplied argument */
uint16_t nwk_addr, /* address where the alarm originates */
uint8_t endpoint, /* endpoint from which it originates */
uint8_t alarm_code, /* code of detected alarm condition */
uint16_t cluster_id); /* cluster where alarm condition occurred */
/*---------------------------------------------------------------
* Function Declarations
*---------------------------------------------------------------
*/
/*
* Server Commands
*/
struct ZbZclClusterT * ZbZclAlarmServerAlloc(struct ZigBeeT *zb, uint8_t endpoint,
uint16_t logSize, struct ZbZclClusterT *time_server);
/*
* Client Commands
*/
struct ZbZclClusterT * ZbZclAlarmClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, ZbZclAlarmClientCallbackT callback, void *arg);
/*uint8_t ZbZclAlarmClientBind(struct ZbZclClusterT *clusterPtr, uint16_t nwkAddr, uint8_t endpoint);
uint8_t ZbZclAlarmClientBindDiscover(struct ZbZclClusterT *clusterPtr);
*/
enum ZclStatusCodeT ZbZclAlarmClientResetAlarmReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
uint8_t alarm_code, uint16_t cluster_id, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
enum ZclStatusCodeT ZbZclAlarmClientResetAllAlarmsReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
enum ZclStatusCodeT ZbZclAlarmClientGetAlarmReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
enum ZclStatusCodeT ZbZclAlarmClientResetAlarmLogReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);
#endif /* __ZCL_ALARM_H */
|