8 roo::string_view device_id)
9 : schema_(schema), device_id_(device_id) {}
12 strncpy(buf, schema_.c_str(), DeviceSchema::kCapacity);
13 size_t len = strlen(buf);
17 strncpy(buf + len, device_id_.c_str(), DeviceId::kCapacity);
21 char buf[DeviceSchema::kCapacity + 1 + DeviceId::kCapacity];
23 return std::string(buf);
29 roo::string_view device_id,
30 roo::string_view sensor_id)
31 : device_locator_(schema, device_id), sensor_id_(sensor_id) {}
34 roo::string_view sensor_id)
35 : device_locator_(device_loc), sensor_id_(sensor_id) {}
39 size_t len = strlen(buf);
40 if (len > 0 && !sensor_id_.empty()) {
42 strncpy(buf + len, sensor_id_.c_str(), SensorId::kCapacity);
47 char buf[DeviceSchema::kCapacity + 1 + DeviceId::kCapacity + 1 +
50 return std::string(buf);
56 roo::string_view actuator_id)
57 : device_locator_(device_loc), actuator_id_(actuator_id) {}
60 roo::string_view device_id,
61 roo::string_view actuator_id)
62 : device_locator_(schema, device_id), actuator_id_(actuator_id) {}
66 size_t len = strlen(buf);
67 if (len > 0 && !actuator_id_.empty()) {
69 strncpy(buf + len, actuator_id_.c_str(), ActuatorId::kCapacity);
74 char buf[DeviceSchema::kCapacity + 1 + DeviceId::kCapacity + 1 +
75 ActuatorId::kCapacity];
77 return std::string(buf);
Identifies actuator within a transceiver device.
const DeviceLocator & device_locator() const
Returns the device locator.
void write_cstr(char *buf) const
Writes a null-terminated string representation into buf.
std::string toString() const
Returns a string representation.
const ActuatorId & actuator_id() const
Returns the actuator id.
Identifies a transceiver device by schema and device id.
const DeviceId & device_id() const
Returns the device id.
const DeviceSchema & schema() const
Returns the device schema.
std::string toString() const
Returns a string representation.
void write_cstr(char *buf) const
Writes a null-terminated string representation into buf.
Identifies sensor within a transceiver device.
const SensorId & sensor_id() const
Returns the sensor id.
const DeviceLocator & device_locator() const
Returns the device locator.
std::string toString() const
Returns a string representation.
void write_cstr(char *buf) const
Writes a null-terminated string representation into buf.
roo_logging::Stream & operator<<(roo_logging::Stream &s, const roo_transceivers::DeviceSchema &schema)
roo_collections::SmallString< 16 > DeviceSchema
Device schema identifier (short string).