7static constexpr uint16_t AM43_SERVICE_UUID = 0xFE50;
8static constexpr uint16_t AM43_CHARACTERISTIC_UUID = 0xFE51;
10static constexpr uint16_t AM43_TUYA_SERVICE_UUID = 0x1910;
11static constexpr uint16_t AM43_TUYA_CHARACTERISTIC_UUID = 0x2b11;
18static constexpr uint8_t CMD_GET_BATTERY_LEVEL = 0xA2;
19static constexpr uint8_t CMD_GET_LIGHT_LEVEL = 0xAA;
20static constexpr uint8_t CMD_GET_POSITION = 0xA7;
21static constexpr uint8_t CMD_SEND_PIN = 0x17;
22static constexpr uint8_t CMD_SET_STATE = 0x0A;
23static constexpr uint8_t CMD_SET_POSITION = 0x0D;
24static constexpr uint8_t CMD_NOTIFY_POSITION = 0xA1;
26static constexpr uint8_t RESPONSE_ACK = 0x5A;
27static constexpr uint8_t RESPONSE_NACK = 0xA5;
Decodes one notification; construct it on the stack for each frame.
bool has_position() const
bool has_set_position_response() const
bool has_battery_level() const
bool has_set_state_response() const
bool has_light_level() const
bool has_pin_response() const
bool has_set_position_response_
bool has_set_state_response_
void decode(const uint8_t *data, uint16_t length)
Builds request packets; each returns a packet the caller sends from its own stack.
static Am43Packet get_set_position_request(uint8_t position)
static Am43Packet get_close_request()
static Am43Packet get_open_request()
static Am43Packet get_stop_request()
static Am43Packet get_battery_level_request()
static Am43Packet get_send_pin_request(uint16_t pin)
static Am43Packet get_light_level_request()
static Am43Packet encode(uint8_t command, const uint8_t *data, uint8_t length)
static Am43Packet get_position_request()