|
waterlinkedsonar
C++ client library for the Water Linked Sonar 3D-15
|
Range Image Protocol codec (https://docs.waterlinked.com/sonar-3d/sonar-3d-15-api/). More...
#include <waterlinkedsonar/rip.hpp>
Public Member Functions | |
| Decoder () | |
| ~Decoder () | |
| Decoder (Decoder &&) noexcept | |
| Decoder & | operator= (Decoder &&) noexcept |
| Decoder (const Decoder &)=delete | |
| Decoder & | operator= (const Decoder &)=delete |
| Decoded | decode (const std::uint8_t *data, std::size_t size) |
| Decodes one datagram. | |
Range Image Protocol codec (https://docs.waterlinked.com/sonar-3d/sonar-3d-15-api/).
A packet is [4B magic "RIP2"|"RIP1"][4B LE total length][payload] [4B LE CRC-32], where the CRC covers everything before it and the RIP2 payload is a snappy-compressed serialized protobuf (RIP1 is uncompressed).
The decoder reuses internal buffers across calls, so decoding is steady-state allocation-free and the returned views point into those buffers: a view is valid until the next decode() on the same Decoder, like an iterator invalidated by container mutation. Copy any data kept longer. Not thread-safe; one caller at a time.
| waterlinked::sonar::rip::Decoder::Decoder | ( | ) |
| waterlinked::sonar::rip::Decoder::~Decoder | ( | ) |
|
noexcept |
|
delete |
| Decoded waterlinked::sonar::rip::Decoder::decode | ( | const std::uint8_t * | data, |
| std::size_t | size | ||
| ) |
Decodes one datagram.
Never throws; malformed input is reported through the returned status.
| data | Datagram bytes. |
| size | Datagram size; the packet's length field must equal it. |