-
Notifications
You must be signed in to change notification settings - Fork 7.6k
/
Copy pathZigbeeSwitch.h
43 lines (32 loc) · 1.32 KB
/
ZigbeeSwitch.h
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
/* Class of Zigbee On/Off Switch endpoint inherited from common EP class */
#pragma once
#include "soc/soc_caps.h"
#include "sdkconfig.h"
#if SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED
#include "ZigbeeEP.h"
#include "ha/esp_zigbee_ha_standard.h"
class ZigbeeSwitch : public ZigbeeEP {
public:
ZigbeeSwitch(uint8_t endpoint);
~ZigbeeSwitch();
// methods to control the on/off light
void lightToggle();
void lightToggle(uint16_t group_addr);
void lightToggle(uint8_t endpoint, uint16_t short_addr);
void lightOn();
void lightOn(uint16_t group_addr);
void lightOn(uint8_t endpoint, uint16_t short_addr);
void lightOff();
void lightOff(uint16_t group_addr);
void lightOff(uint8_t endpoint, uint16_t short_addr);
void lightOffWithEffect(uint8_t effect_id, uint8_t effect_variant);
void lightOnWithTimedOff(uint8_t on_off_control, uint16_t time_on, uint16_t time_off);
void lightOnWithSceneRecall();
private:
// save instance of the class in order to use it in static functions
static ZigbeeSwitch *_instance;
void findEndpoint(esp_zb_zdo_match_desc_req_param_t *cmd_req);
static void bindCb(esp_zb_zdp_status_t zdo_status, void *user_ctx);
static void findCb(esp_zb_zdp_status_t zdo_status, uint16_t addr, uint8_t endpoint, void *user_ctx);
};
#endif //SOC_IEEE802154_SUPPORTED && CONFIG_ZB_ENABLED