|
Motion Master 6.0.0-alpha.111
Next-generation motion control software
|
#include <spoe_process_data.h>
Public Member Functions | |
| void | reset (std::size_t frameBytes) |
| std::vector< uint8_t > | add (std::span< const uint8_t > reply) |
| Adds the input bytes of one reply. Returns the whole frames they complete, joined. | |
| uint64_t | framingLosses () const |
| How many times stale bytes were dropped to restore the framing. | |
Cuts the input bytes of successive replies into whole frames.
The drive's buffer holds whole frames, but one reply carries at most kInputPopLimit bytes, so a reply can end inside a frame. The rest of that frame starts the next reply, and is joined to the part kept here.
A shorter reply means the drive emptied its buffer, so the reply ends on a frame boundary. If the joined bytes are not a whole number of frames then, the kept part was stale: the drive empties a full buffer outright, which can discard the rest of a cut frame. The stale bytes are dropped and counted, and the framing is right again from that reply on.
| std::vector< uint8_t > mm::comm::spoe::SpoeFrameAssembler::add | ( | std::span< const uint8_t > | reply | ) |
Adds the input bytes of one reply. Returns the whole frames they complete, joined.
|
inline |
How many times stale bytes were dropped to restore the framing.
| void mm::comm::spoe::SpoeFrameAssembler::reset | ( | std::size_t | frameBytes | ) |