19#ifndef PHYPHOX_BLE_CORE_SERIALIZER_H
20#define PHYPHOX_BLE_CORE_SERIALIZER_H
33 uint32_t
size()
const {
return totalSize_; }
34 uint32_t
crc()
const {
return crc_; }
39 uint32_t
read(uint32_t offset, uint8_t* out, uint32_t n)
const;
48 const char* deviceName_ =
nullptr;
50 uint32_t totalSize_ = 0;
52 uint16_t partCount_ = 0;
55 uint16_t* partOffset_ =
nullptr;
57 void emitPrologue(
Sink&)
const;
58 void emitView(uint8_t view,
Sink&)
const;
60 void emitEpilogue(
Sink&)
const;
#define PHYPHOX_BLE_DEFAULT_MTU
Default MTU payload (ATT_MTU 23 − 3). setMTU() raises it where the transport can negotiate.
Definition Config.h:52
Definition ExperimentStore.h:31
Definition Serializer.h:27
uint16_t partCount() const
Definition Serializer.h:35
void emitPart(uint16_t part, Sink &sink) const
Serialize one part into a sink (public for the tests).
void build(const ExperimentStore &store, const char *deviceName, uint16_t mtu)
Bind to a store and build the part table.
void writeAll(Sink &sink) const
Stream the entire document (printXML, host tests).
uint32_t size() const
bytes of the whole document
Definition Serializer.h:33
uint32_t read(uint32_t offset, uint8_t *out, uint32_t n) const
Copy document bytes [offset, offset + n) into out; returns bytes produced (fewer at the end).
uint32_t crc() const
CRC-32 of the whole document.
Definition Serializer.h:34
Receives the bytes of a serialization.
Definition Sink.h:14
Definition ChannelStore.h:11
void writeEscaped(Sink &, const char *text)
Text helpers shared by the emitters (public so the host tests can pin them): XML-escape text into the...
void writeInt(Sink &, int32_t v)
void writeFloat(Sink &, float v)
void writeSensorCharUuid(Sink &, uint8_t sensor)
void writeInputCharUuid(Sink &, uint8_t channel)
The UUID of the k-th input-channel / s-th sensor characteristic (docs/protocol.md).
One view element. label and xmlAttribute are common to all; the union holds the rest.
Definition ElementData.h:146