Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
proto_codecs.cpp File Reference

Device-name, address-classification and 1W-frame codec implementations. More...

#include "proto_codecs.h"
#include "proto_constants.h"
#include "proto_frame.h"
#include <cctype>
#include <cstdio>
#include <cstring>
#include <string>
Include dependency graph for proto_codecs.cpp:

Go to the source code of this file.

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Functions

std::string esphome::home_io_control::trim_ascii_whitespace (const std::string &value)
 Trim leading and trailing ASCII whitespace from a string.
std::string esphome::home_io_control::decode_device_name_payload (const uint8_t *data, uint8_t len)
 Decode a device-name payload from IO-homecontrol's Latin-1 wire format into UTF-8.
DeviceNameValidationError esphome::home_io_control::encode_device_name_payload (const std::string &name, uint8_t payload[DEVICE_NAME_WRITE_PAYLOAD_SIZE], std::string &normalized_name)
 Validate and encode a user-supplied UTF-8 device name into the fixed Latin-1 write payload.
const char * esphome::home_io_control::device_name_validation_error_name (DeviceNameValidationError error)
 Return a stable symbolic name for a device-name validation result.
const char * esphome::home_io_control::device_name_validation_error_description (DeviceNameValidationError error)
 Return a human-readable explanation for a device-name validation result.
AddressClass esphome::home_io_control::classify_address (const uint8_t addr[NODE_ID_SIZE])
 Classify an IO-Homecontrol 3-byte address.
const char * esphome::home_io_control::address_class_name (AddressClass address_class)
 Get a human-readable name for an address classification.
DeviceType esphome::home_io_control::broadcast_target_type (const uint8_t addr[NODE_ID_SIZE])
 Extract the target device type from a typed broadcast address.
void esphome::home_io_control::decode_1w_main_intent (uint8_t main0, uint8_t main1, char *out, size_t out_size)
 Decode the "main" position/command bytes from a 1W execute payload.
std::optional< float > esphome::home_io_control::oneway_intent_to_target (uint8_t main0, uint8_t main1)
 Resolve a 1W main-byte pair to an optimistic IO target position, if unambiguous.
OneWayFrameInfo esphome::home_io_control::decode_1w_frame (const IoFrame &frame)
 Decode a parsed 1W frame into a structured OneWayFrameInfo.
DiscoveryResponseInfo esphome::home_io_control::decode_discovery_response (const IoFrame &frame, IoDevice &device, std::string &device_id)
 Decode a discovery-response payload (CMD_DISCOVER_RESP 0x29 or CMD_DISCOVER_SPE_RESP 0x2B — both carry the identical DISCOVERY_RESP_FULL_SIZE layout) into device metadata.

Variables

static constexpr uint8_t esphome::home_io_control::ONEWAY_EXECUTE_MIN_DATA_LEN = 4
 Minimum data bytes for decode of execute/activate‑mode intent fields.

Detailed Description

Device-name, address-classification and 1W-frame codec implementations.

Definition in file proto_codecs.cpp.