18 this->
messages.emplace_back(std::move(message));
33 bool overlength = (this->
buffer_[this->
pos_] >> 4) & 0x08;
40 length = (length << 4) + (this->
buffer_[this->
pos_ + 1] & 0x0f);
67 node->
nodes.reserve(length);
68 for (
size_t i = 0; i !=
length; i++) {
72 node->
nodes.emplace_back(std::move(child_node));
86 std::vector<ObisInfo> obis_info;
87 for (
auto const &message :
messages) {
88 const auto &message_body = message.nodes[3];
89 uint16_t message_type =
bytes_to_uint(message_body.nodes[0].value_bytes);
93 const auto &get_list_response = message_body.nodes[1];
94 const auto &server_id = get_list_response.nodes[1].value_bytes;
95 const auto &val_list = get_list_response.nodes[4];
97 for (
auto const &val_list_entry : val_list.nodes) {
98 obis_info.emplace_back(server_id, val_list_entry);
106 for (
auto const value : buffer) {
114 for (
auto const value : buffer) {
115 val = (val << 8) + value;
126 if (buffer.
size() < 8) {
127 const int bits = buffer.
size() * 8;
128 const uint64_t
m = 1ull << (bits - 1);
139 this->
code = val_list_entry.
nodes[0].value_bytes;
140 this->
status = val_list_entry.
nodes[1].value_bytes;
143 const auto &value_node = val_list_entry.
nodes[5];
144 this->
value = value_node.value_bytes;
size_t size() const noexcept
int64_t bytes_to_int(const BytesView &buffer)
std::string bytes_to_string(const BytesView &buffer)
BytesView subview(size_t offset, size_t count) const noexcept
std::string str_sprintf(const char *fmt,...)
std::vector< ObisInfo > get_obis_info()
const uint8_t * begin() const noexcept
Implementation of SPI Controller mode.
bool setup_node(SmlNode *node)
uint64_t bytes_to_uint(const BytesView &buffer)
const uint8_t * end() const noexcept
SmlFile(const BytesView &buffer)
ObisInfo(const BytesView &server_id, const SmlNode &val_list_entry)
std::string code_repr() const
std::vector< SmlNode > messages
std::string bytes_repr(const BytesView &buffer)
std::vector< SmlNode > nodes