Welcome to mirror list, hosted at ThFree Co, Russian Federation.

zcl.ias_wd.h « security « zcl « include « stack « zigbee « STM32_WPAN « ST « Middlewares - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9fa5ebc6cb27968cc563bd7af80a6daa5ee7ba49 (plain)
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
114
115
116
117
118
119
120
121
122
123
124
/* Copyright [2009 - 2019] Exegin Technologies Limited. All rights reserved. */

/*--------------------------------------------------------------------------
 *  DESCRIPTION
 *      The public header file for the Home Automation
 *      clusters of the ZCL.
 *--------------------------------------------------------------------------
 */
#ifndef ZCL_IAS_WD_H
#define ZCL_IAS_WD_H

/* PICS.ZCL.IASWD
 *
 * IASWD.S | True
 * IASWD.C | True
 *
 * IASWD.S.A0000 | True
 * IASWD.S.Afffd | True
 * IASWD.S.Afffe | False
 * IASWD.S.C00.Rsp | True
 * IASWD.S.C01.Rsp | True
 *
 * IASWD.C.Afffd | True
 * IASWD.C.Afffe | False
 * IASWD.C.C00.Tx | True
 * IASWD.C.C01.Tx | True
 */

#include "zcl/zcl.h"

enum ZbZclIasWdServerAttrT {
    ZCL_IAS_WD_SVR_ATTR_MAX_DURATION = 0x0000,
};

/* Client Generated Commands */
enum ZbZclIasWdClientCommandsT {
    ZCL_IAS_WD_CLI_CMD_START_WARNING = 0x00,
    ZCL_IAS_WD_CLI_CMD_SQUAWK = 0x01,
};

enum ZbZclIasWdWarningModeT {
    ZCL_IAS_WD_WARNING_MODE_STOP = 0,
    ZCL_IAS_WD_WARNING_MODE_BURGLAR = 1,
    ZCL_IAS_WD_WARNING_MODE_FIRE = 2,
    ZCL_IAS_WD_WARNING_MODE_EMERGENCY = 3,
    ZCL_IAS_WD_WARNING_MODE_POLICE_PANIC = 4,
    ZCL_IAS_WD_WARNING_MODE_FIRE_PANIC = 5,
    ZCL_IAS_WD_WARNING_MODE_EMERGENCY_PANIC = 6,
};

enum ZbZclIasWdStrobeT {
    ZCL_IAS_WD_STROBE_OFF = 0,
    ZCL_IAS_WD_STROBE_ON = 1,
};

enum ZbZclIasWdLevelT {
    ZCL_IAS_WD_LEVEL_LOW = 0,
    ZCL_IAS_WD_LEVEL_MEDIUM = 1,
    ZCL_IAS_WD_LEVEL_HIGH = 2,
    ZCL_IAS_WD_LEVEL_VERY_HIGH = 3,
};

enum ZbZclIasWdSquawkModeT {
    ZCL_IAS_WD_SQUAWK_MODE_ARMED = 0,
    ZCL_IAS_WD_SQUAWK_MODE_DISARMED = 1,
};

/*---------------------------------------------------------------
 * API Structures
 *---------------------------------------------------------------
 */
struct ZbZclIasWdClientStartWarningReqT {
    enum ZbZclIasWdWarningModeT warning_mode;
    enum ZbZclIasWdStrobeT strobe;
    enum ZbZclIasWdLevelT siren_level;
    uint16_t warning_duration;
    uint8_t strobe_dutycycle;
    enum ZbZclIasWdLevelT strobe_level;
};

struct ZbZclIasWdClientSquawkReqT {
    enum ZbZclIasWdSquawkModeT squawk_mode;
    enum ZbZclIasWdStrobeT strobe;
    enum ZbZclIasWdLevelT squawk_level;
};

/*---------------------------------------------------------------
 * Server API
 *---------------------------------------------------------------
 */
struct ZbZclIasWdServerCallbacksT {
    /* Returns a ZCL Status code to send in the Default Response, or
     * ZCL_STATUS_SUCCESS_NO_DEFAULT_RESPONSE if no Default Response
     * to be generated. */
    uint8_t (*start_warning)(struct ZbZclClusterT *clusterPtr, void *arg,
        struct ZbZclIasWdClientStartWarningReqT *warn_req);

    uint8_t (*squawk)(struct ZbZclClusterT *clusterPtr, void *arg,
        struct ZbZclIasWdClientSquawkReqT *squawk_req);
};

struct ZbZclClusterT * ZbZclIasWdServerAlloc(struct ZigBeeT *zb, uint8_t endpoint,
    struct ZbZclIasWdServerCallbacksT *callbacks, void *arg);

void ZbZclIasWdServerConfigCallbacks(struct ZbZclClusterT *clusterPtr,
    struct ZbZclIasWdServerCallbacksT *callbacks);

/*---------------------------------------------------------------
 * Client API
 *---------------------------------------------------------------
 */
struct ZbZclClusterT * ZbZclIasWdClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, void *arg);

uint8_t ZbZclIasWdClientStartWarningReq(struct ZbZclClusterT *clusterPtr,
    const struct ZbApsAddrT *dst,
    struct ZbZclIasWdClientStartWarningReqT *warning_req,
    void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

uint8_t ZbZclIasWdClientSquawkReq(struct ZbZclClusterT *clusterPtr,
    const struct ZbApsAddrT *dst,
    struct ZbZclIasWdClientSquawkReqT *squawk_req,
    void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

#endif /* __ZCL_IAS_WD_H */