Tool Libs
UMIT-TIROL Institute of Automation and Control Engineering library collection
 
Loading...
Searching...
No Matches
series.h
Go to the documentation of this file.
1
5#pragma once
6#include "frameregistry.h"
8template<typename T, int FRAMELEN=80>
10 static constexpr size_t LEN = FRAMELEN / sizeof(T);
11 bool start {true};
14
19 if (start) {
20 buf = f.unpack<uint32_t>();
21 if (buf.size == 0) return nullptr;
22 }
23 for (unsigned int i = 0; i < LEN - start; i++) {
24 buf.append(f.unpack<T>());
25 if (buf.len == buf.size) {
26 start = true;
27 return &buf;
28 }
29 }
30 start = false;
31 return nullptr;
32 }
33};
Copyright (c) 2023 IACE.
dynamically allocated, but fixed-size buffer template
Definition buffer.h:18
pyWisp communication frame
Definition frameregistry.h:10
T unpack()
return unpacked value from Frame
Definition frameregistry.h:46
unpacking helper for data series sent from pywisp
Definition series.h:9
Buffer< T > * unpack(Frame &f)
call this with incoming frames until it returns a Buffer filled with the data sent over the wire.
Definition series.h:18
Buffer< T > buf
Buffer of data received. only valid after unpack returns non-null.
Definition series.h:12