Stateful decoders for Smart LEDZ v1 notify payloads.
More...
#include <array>
#include <cstddef>
#include <cstdint>
#include <map>
#include <vector>
Go to the source code of this file.
|
| void | smartledz_protocol::v1::apply_online_status_payload (const uint8_t *payload10, size_t payload_len, uint32_t now_ms, std::map< uint16_t, DeviceStateSnapshot > *states, std::vector< uint16_t > *updated_addresses) |
| | Applies an online-status notify payload (opcode 0xDC).
|
| |
| void | smartledz_protocol::v1::apply_status_payload (uint16_t src, const uint8_t *payload10, size_t payload_len, uint32_t now_ms, std::map< uint16_t, DeviceStateSnapshot > *states, std::vector< uint16_t > *updated_addresses) |
| | Applies a status notify payload (opcode 0xDB) for one source address.
|
| |
| void | smartledz_protocol::v1::apply_f1_response_payload (uint16_t src, const uint8_t *payload10, size_t payload_len, uint32_t now_ms, std::map< uint16_t, DeviceStateSnapshot > *states, std::vector< uint16_t > *updated_addresses) |
| | Applies an extended dimming response payload (opcode 0xEA, body starts with 0xF1).
|
| |
Stateful decoders for Smart LEDZ v1 notify payloads.
◆ apply_f1_response_payload()
| void smartledz_protocol::v1::apply_f1_response_payload |
( |
uint16_t |
src, |
|
|
const uint8_t * |
payload10, |
|
|
size_t |
payload_len, |
|
|
uint32_t |
now_ms, |
|
|
std::map< uint16_t, DeviceStateSnapshot > * |
states, |
|
|
std::vector< uint16_t > * |
updated_addresses |
|
) |
| |
Applies an extended dimming response payload (opcode 0xEA, body starts with 0xF1).
- Parameters
-
| src | Source mesh address from the decrypted frame. |
| payload10 | Pointer to notify payload bytes. |
| payload_len | Number of bytes in payload10. |
| now_ms | Caller timestamp used to set last_update_ms. |
| states | Address-to-state map to update. |
| updated_addresses | Optional output vector appended with src when decoded. |
- Note
- This decoder accepts only
func=1, item=4, and at least one data byte; brightness is taken from payload[6].
◆ apply_online_status_payload()
| void smartledz_protocol::v1::apply_online_status_payload |
( |
const uint8_t * |
payload10, |
|
|
size_t |
payload_len, |
|
|
uint32_t |
now_ms, |
|
|
std::map< uint16_t, DeviceStateSnapshot > * |
states, |
|
|
std::vector< uint16_t > * |
updated_addresses |
|
) |
| |
Applies an online-status notify payload (opcode 0xDC).
- Parameters
-
| payload10 | Pointer to notify payload bytes. |
| payload_len | Number of bytes in payload10. |
| now_ms | Caller timestamp used to set last_update_ms. |
| states | Address-to-state map to update. |
| updated_addresses | Optional output vector appended with updated addresses. |
- Note
- Payload is parsed as repeated 4-byte tuples:
[addr, status, brightness, type_raw]. Parsing stops at addr == 0x00 or sentinel tuple 0xFF, *, 0xFF, *.
◆ apply_status_payload()
| void smartledz_protocol::v1::apply_status_payload |
( |
uint16_t |
src, |
|
|
const uint8_t * |
payload10, |
|
|
size_t |
payload_len, |
|
|
uint32_t |
now_ms, |
|
|
std::map< uint16_t, DeviceStateSnapshot > * |
states, |
|
|
std::vector< uint16_t > * |
updated_addresses |
|
) |
| |
Applies a status notify payload (opcode 0xDB) for one source address.
- Parameters
-
| src | Source mesh address from the decrypted frame. |
| payload10 | Pointer to notify payload bytes. |
| payload_len | Number of bytes in payload10. |
| now_ms | Caller timestamp used to set last_update_ms. |
| states | Address-to-state map to update. |
| updated_addresses | Optional output vector appended with src when decoded. |
- Note
- Requires at least 4 bytes and decodes:
payload[0..2] => RGB, payload[3] => CT raw when in [18, 65].