Firmware SDK
twr_radio_node.h
1 #ifndef _TWR_RADIO_NODE_H
2 #define _TWR_RADIO_NODE_H
3 
4 #include <twr_radio.h>
5 #include <twr_radio_pub.h>
6 
10 
11 #define TWR_RADIO_NODE_HEAD_SIZE (TWR_RADIO_HEAD_SIZE + 1 + TWR_RADIO_ID_SIZE)
12 #define TWR_RADIO_NODE_MAX_BUFFER_SIZE (TWR_RADIO_MAX_BUFFER_SIZE - TWR_RADIO_ID_SIZE - 1)
13 #define TWR_RADIO_NODE_MAX_COMPOUND_PART (TWR_RADIO_NODE_MAX_BUFFER_SIZE / 5)
14 #define TWR_RADIO_NODE_MAX_COMPOUND_BUFFER_SIZE (TWR_RADIO_NODE_MAX_COMPOUND_PART * 5)
15 
16 enum
17 {
18  TWR_RADIO_NODE_STATE_LED = TWR_RADIO_PUB_STATE_LED,
19  TWR_RADIO_NODE_STATE_RELAY_MODULE_0 = TWR_RADIO_PUB_STATE_RELAY_MODULE_0,
20  TWR_RADIO_NODE_STATE_RELAY_MODULE_1 = TWR_RADIO_PUB_STATE_RELAY_MODULE_1,
21  TWR_RADIO_NODE_STATE_POWER_MODULE_RELAY = TWR_RADIO_PUB_STATE_POWER_MODULE_RELAY,
22 };
23 
24 typedef enum
25 {
26  TWR_RADIO_NODE_LED_STRIP_EFFECT_TEST = 0,
27  TWR_RADIO_NODE_LED_STRIP_EFFECT_RAINBOW = 1,
28  TWR_RADIO_NODE_LED_STRIP_EFFECT_RAINBOW_CYCLE = 2,
29  TWR_RADIO_NODE_LED_STRIP_EFFECT_THEATER_CHASE_RAINBOW = 3,
30  TWR_RADIO_NODE_LED_STRIP_EFFECT_COLOR_WIPE = 4,
31  TWR_RADIO_NODE_LED_STRIP_EFFECT_THEATER_CHASE = 5,
32  TWR_RADIO_NODE_LED_STRIP_EFFECT_STROBOSCOPE = 6,
33  TWR_RADIO_NODE_LED_STRIP_EFFECT_ICICLE = 7,
34  TWR_RADIO_NODE_LED_STRIP_EFFECT_PULSE_COLOR = 8
35 
36 } twr_radio_node_led_strip_effect_t;
37 
44 
45 bool twr_radio_node_state_set(uint64_t *id, uint8_t state_id, bool *state);
46 
52 
53 bool twr_radio_node_state_get(uint64_t *id, uint8_t state_id);
54 
61 
62 bool twr_radio_node_buffer(uint64_t *id, void *buffer, size_t length);
63 
69 
70 bool twr_radio_node_led_strip_color_set(uint64_t *id, uint32_t color);
71 
77 
78 bool twr_radio_node_led_strip_brightness_set(uint64_t *id, uint8_t brightness);
79 
86 
87 bool twr_radio_node_led_strip_compound_set(uint64_t *id, uint8_t *compound, size_t length);
88 
96 
97 bool twr_radio_node_led_strip_effect_set(uint64_t *id, twr_radio_node_led_strip_effect_t type, uint16_t wait, uint32_t color);
98 
109 
110 bool twr_radio_node_led_strip_thermometer_set(uint64_t *id, float temperature, int8_t min, int8_t max, uint8_t white_dots, float *set_point, uint32_t set_point_color);
111 
116 
117 void twr_radio_node_decode(uint64_t *id, uint8_t *buffer, size_t length);
118 
120 
121 #endif // _TWR_RADIO_NODE_H
bool twr_radio_node_state_set(uint64_t *id, uint8_t state_id, bool *state)
Send request for set new state.
bool twr_radio_node_led_strip_effect_set(uint64_t *id, twr_radio_node_led_strip_effect_t type, uint16_t wait, uint32_t color)
Send data to node.
bool twr_radio_node_buffer(uint64_t *id, void *buffer, size_t length)
Send data to node.
bool twr_radio_node_led_strip_compound_set(uint64_t *id, uint8_t *compound, size_t length)
Send data to node.
bool twr_radio_node_state_get(uint64_t *id, uint8_t state_id)
Send request for get actual state.
bool twr_radio_node_led_strip_color_set(uint64_t *id, uint32_t color)
Send data to node.
void twr_radio_node_decode(uint64_t *id, uint8_t *buffer, size_t length)
Internal decode function for twr_radio.c.
bool twr_radio_node_led_strip_brightness_set(uint64_t *id, uint8_t brightness)
Send data to node.
bool twr_radio_node_led_strip_thermometer_set(uint64_t *id, float temperature, int8_t min, int8_t max, uint8_t white_dots, float *set_point, uint32_t set_point_color)
Send data to node.