11 while (this->pos_ < this->
buffer_.size()) {
18 this->
messages.emplace_back(message);
33 bool overlength = (this->
buffer_[this->
pos_] >> 4) & 0x08;
40 length = (length << 4) + (this->
buffer_[this->
pos_ + 1] & 0x0f);
69 node->
nodes.reserve(length);
70 for (
size_t i = 0; i !=
length; i++) {
74 node->
nodes.emplace_back(child_node);
88 std::vector<ObisInfo> obis_info;
89 for (
auto const &message :
messages) {
96 bytes server_id = get_list_response.
nodes[1].value_bytes;
99 for (
auto const &val_list_entry : val_list.
nodes) {
100 obis_info.emplace_back(server_id, val_list_entry);
108 for (
auto const value : buffer) {
116 for (
auto const value : buffer) {
117 val = (val << 8) + value;
128 if (buffer.size() < 8) {
129 const int bits = buffer.size() * 8;
130 const uint64_t
m = 1ull << (bits - 1);
141 this->
code = val_list_entry.
nodes[0].value_bytes;
142 this->
status = val_list_entry.
nodes[1].value_bytes;
std::string bytes_repr(const bytes &buffer)
int64_t bytes_to_int(const bytes &buffer)
uint64_t bytes_to_uint(const bytes &buffer)
std::string bytes_to_string(const bytes &buffer)
std::string str_sprintf(const char *fmt,...)
ObisInfo(bytes server_id, SmlNode val_list_entry)
std::vector< ObisInfo > get_obis_info()
Implementation of SPI Controller mode.
std::vector< uint8_t > bytes
bool setup_node(SmlNode *node)
std::string code_repr() const
std::vector< SmlNode > messages
std::vector< SmlNode > nodes