3#include "roo_logging.h"
59 strncpy(payload.locator_schema, locator.
schema().c_str(),
60 DeviceSchema::kCapacity);
61 strncpy(payload.locator_id, locator.
device_id().c_str(), DeviceId::kCapacity);
72 payload.has_count = (count > 1);
73 if (payload.has_count) {
74 payload.count = count;
85 payload.descriptor_key = descriptor_key;
113 strncpy(payload.device_locator_schema, device.
schema().c_str(),
114 DeviceSchema::kCapacity);
115 strncpy(payload.device_locator_id, device.
device_id().c_str(),
116 DeviceId::kCapacity);
121 const SensorId& sensor_id,
float value, uint64_t age_ms) {
126 auto& val = payload.
sensor_values[payload.sensor_values_count];
127 strncpy(val.device_locator_sensor_id, sensor_id.c_str(), SensorId::kCapacity);
130 ++payload.sensor_values_count;
150 strncpy(payload.device_locator_schema, actuator.
schema().c_str(),
151 DeviceSchema::kCapacity);
152 strncpy(payload.device_locator_id, actuator.
device_id().c_str(),
153 DeviceId::kCapacity);
154 strncpy(payload.device_locator_actuator_id, actuator.
actuator_id().c_str(),
155 ActuatorId::kCapacity);
156 payload.value = value;
Identifies actuator within a transceiver device.
const DeviceSchema & schema() const
Returns the device schema.
const DeviceId & device_id() const
Returns the device id.
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.
roo_transceivers_ServerMessage SrvDeviceRemoved(int prev_ordinal)
Removes a device.
roo_transceivers_ServerMessage SrvDeltaUpdateBegin()
Begins a delta update sequence.
roo_transceivers_ServerMessage SrvDescriptorAdded(int key, const roo_transceivers_Descriptor &descriptor)
Adds a descriptor in the server stream.
roo_transceivers_ClientMessage ClientRequestState()
Builds a client state request.
roo_transceivers_ClientMessage ClientWrite(const ActuatorLocator &actuator, float value)
Builds a client write request.
roo_transceivers_ServerMessage SrvDevicesModified(int prev_ordinal, int descriptor_key)
Marks a device as modified.
roo_transceivers_ServerMessage SrvUpdateEnd()
Ends an update sequence.
roo_transceivers_ServerMessage SrvReading(const DeviceLocator &device)
Begins readings for a device.
void AddReading(roo_transceivers_ServerMessage &reading, const SensorId &sensor_id, float value, uint64_t age_ms)
Appends a single sensor reading to a readings message.
roo_transceivers_ServerMessage SrvDeviceAdded(const DeviceLocator &locator, int descriptor_key)
Adds a device with a descriptor key.
roo_transceivers_ServerMessage SrvFullUpdateBegin()
Begins a full update sequence.
roo_transceivers_ServerMessage SrvInit()
Builds an init server message.
roo_transceivers_ServerMessage SrvDevicesPreserved(int first_preserved_ordinal, size_t count)
Marks a range of devices as preserved.
roo_transceivers_ServerMessage SrvReadingsEnd()
Ends a readings block.
roo_transceivers_ServerMessage SrvReadingsBegin()
Begins a readings block.
roo_transceivers_ServerMessage SrvDescriptorRemoved(int key)
Removes a descriptor from the server stream.
roo_transceivers_ClientMessage ClientRequestUpdate()
Builds a client update request.
roo_collections::SmallString< 24 > SensorId
Sensor identifier (short string).
#define roo_transceivers_ServerMessage_transceiver_update_end_tag
#define roo_transceivers_ClientMessage_init_zero
#define roo_transceivers_ServerMessage_device_modified_tag
#define roo_transceivers_ClientMessage_request_update_tag
#define roo_transceivers_ServerMessage_reading_tag
#define roo_transceivers_ClientMessage_request_state_tag
#define roo_transceivers_ServerMessage_device_added_tag
#define roo_transceivers_ServerMessage_transceiver_update_begin_tag
#define roo_transceivers_ServerMessage_device_preserved_tag
#define roo_transceivers_ServerMessage_readings_begin_tag
#define roo_transceivers_ServerMessage_init_tag
#define roo_transceivers_ServerMessage_readings_end_tag
#define roo_transceivers_ServerMessage_descriptor_removed_tag
#define roo_transceivers_ServerMessage_init_zero
#define roo_transceivers_ServerMessage_descriptor_added_tag
#define roo_transceivers_ServerMessage_device_removed_tag
#define roo_transceivers_ClientMessage_write_tag
roo_transceivers_ClientMessage_Write write
union _roo_transceivers_ClientMessage::@0 contents
roo_transceivers_Descriptor descriptor
roo_transceivers_ServerMessage_Reading_SensorValue sensor_values[16]
roo_transceivers_ServerMessage_DeviceAdded device_added
roo_transceivers_ServerMessage_Reading reading
roo_transceivers_ServerMessage_UpdateBegin transceiver_update_begin
roo_transceivers_ServerMessage_DeviceRemoved device_removed
roo_transceivers_ServerMessage_DescriptorRemoved descriptor_removed
roo_transceivers_ServerMessage_DescriptorAdded descriptor_added
roo_transceivers_ServerMessage_DeviceModified device_modified
union _roo_transceivers_ServerMessage::@1 contents
roo_transceivers_ServerMessage_DevicePreserved device_preserved