73 std::transform(normalized.begin(), normalized.end(), normalized.begin(),
74 [](
unsigned char ch) { return static_cast<char>(std::toupper(ch)); });
82 std::array<char, RESULT_CODE_BUFFER_SIZE> buffer{};
83 std::snprintf(buffer.data(), buffer.size(),
"%02X", value);
84 return std::string(buffer.data());
107 result.
message =
"device returned an empty error response";
135 result.
message =
"hub is not initialized";
139 uint8_t parsed_device_id[NODE_ID_SIZE]{};
140 if (!
hex_to_bytes(normalized_device_id, parsed_device_id, NODE_ID_SIZE)) {
141 result.
message =
"device ID must be exactly 6 hexadecimal characters";
145 auto *dev = registry.
get(normalized_device_id);
146 if (dev ==
nullptr) {
147 result.
message =
"device is not registered on this hub";
Owns the per-hub device table, update callbacks, and linked-remote associations.
IoDevice * get(const std::string &device_id)
Retrieve a registered device by ID.
Per-hub device table, update-callback fan-out, and linked-remote map.
bool apply_error_response(const IoFrame &response, ManagementActionResult &result)
Decode a CMD_ERROR_RESP frame's result code into result.
std::string format_hex_byte(uint8_t value)
Format a byte as two uppercase hex digits, no prefix.
std::string trim_ascii_whitespace(const std::string &value)
Trim leading and trailing ASCII whitespace from a string.
IoDevice * resolve_management_device(const char *action, const std::string &device_id, bool initialized, DeviceRegistry ®istry, ManagementActionResult &result)
Shared preamble for every device-addressed action: validate the hub and device ID,...
ManagementActionResult make_management_result(const std::string &action, const std::string &device_id)
A result that carries only the action name and the target device ID.
constexpr size_t RESULT_CODE_BUFFER_SIZE
Size of the scratch buffer format_hex_byte() prints into: two digits plus the terminator,...
std::string normalize_device_id_argument(const std::string &device_id)
Trim and uppercase a device-ID argument as received from the native API.
bool hex_to_bytes(const std::string &hex, uint8_t *out, uint8_t len)
Convert a hex string (e.g., "123ABC") to a byte array.
Device-name, address-classification and 1W-frame codecs.
IO-Homecontrol command IDs, result codes and protocol enumerations.
IO-Homecontrol 2W frame container: control bytes, IoFrame and (de)serialization.
Runtime state of a paired IO‑Homecontrol device.
Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data).
uint8_t data[FRAME_MAX_DATA_SIZE]
Command parameters (0–23 bytes). Never includes mac.
uint8_t data_len
Actual length of data.
Result of a hub-level management action such as rename.
bool verified
Whether a follow-up readback confirmed the applied state.
std::string device_id
Target IO-homecontrol device ID.
bool has_response_cmd
True when response_cmd contains a probe reply's command byte.
std::string probe_index
Requested index argument, as received (before parsing).
uint8_t result_code
Optional CMD_ERROR_RESP result byte.
std::string action
Action name, e.g. "rename_device".
uint8_t response_cmd
Probe reply's command byte (distinct from a CMD_ERROR_RESP result_code above, which is a different by...
std::string log_message
When non-empty, the device log shows this instead of message.
bool terminal_refusal
True when probe_device() failed for a reason that will recur identically for every remaining index in...
std::string applied_name
Verified cached UTF-8 name after a readback, when available.
std::string decoded
Rendering of the probe reply for the replies this codebase can decode (currently a limitation reply,...
std::string probe_name
Probe name for probe_device()/probe_sweep(), e.g. "private_fn".
std::string response_hex
Probe reply's full raw wire hex, for pasting into scripts/corpus/ingest.py.
bool success
Whether the requested management action succeeded.
bool has_result_code
True when result_code contains a decoded CMD_ERROR_RESP byte.
std::string message
Human-readable outcome summary.
std::string requested_name
Requested normalized UTF-8 name for rename actions.