1
9
10
11
12
13
14
15
18
19
20
21
22
23
24
25
26
27
28
29
30
33
34
37
43
44
47
48
51
52
53
54
55
56
57
/* ... */
#ifndef __MESH_LIGHT_H__
#define __MESH_LIGHT_H__
#include "esp_err.h"
/* ... */
#define MESH_LIGHT_RED (0xff)
#define MESH_LIGHT_GREEN (0xfe)
#define MESH_LIGHT_BLUE (0xfd)
#define MESH_LIGHT_YELLOW (0xfc)
#define MESH_LIGHT_PINK (0xfb)
#define MESH_LIGHT_INIT (0xfa)
#define MESH_LIGHT_WARNING (0xf9)
#define MESH_TOKEN_ID (0x0)
#define MESH_TOKEN_VALUE (0xbeef)
#define MESH_CONTROL_CMD (0x2)10 defines
/* ... */
/* ... */
typedef struct {
uint8_t cmd;
bool on;
uint8_t token_id;
uint16_t token_value;
}{ ... } mesh_light_ctl_t;
/* ... */
/* ... */
esp_err_t mesh_light_init(void);
esp_err_t mesh_light_set(int color);
esp_err_t mesh_light_process(mesh_addr_t *from, uint8_t *buf, uint16_t len);
void mesh_connected_indicator(int layer);
void mesh_disconnected_indicator(void);
/* ... */
#endif