waterlinkedsonar
C++ client library for the Water Linked Sonar 3D-15
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1
3
4#ifndef WATERLINKEDSONAR_HTTP_TYPES_HPP
5#define WATERLINKEDSONAR_HTTP_TYPES_HPP
6
7#include <chrono>
8#include <cstdint>
9#include <optional>
10#include <string>
11
12namespace waterlinked::sonar {
13
15struct About {
16 std::string chipid;
18 bool is_ready{false};
19 int product_id{0};
20 std::string product_name;
21 std::string variant;
22 std::string version;
23 std::string version_short;
24};
25
28 std::string id;
29 std::string message;
30 std::string status;
31 bool operational{false};
32};
33
41
43enum class AcousticsMode : std::uint8_t {
46};
47
49enum class Salinity : std::uint8_t {
50 SALT,
51 FRESH,
52};
53
55struct Range {
56 double min{0.0};
57 double max{0.0};
58};
59
61struct UdpConfig {
63 enum class Mode : std::uint8_t {
64 MULTICAST,
65 UNICAST,
66 DISABLED,
67 };
68
71 std::uint16_t unicast_destination_port{0};
72};
73
75struct TimeStatus {
76 std::chrono::system_clock::time_point system_time;
77 bool ntp_synced{false};
78 std::string ntp_synced_to;
80 std::optional<std::int64_t> ntp_seconds_since_last_sync;
81};
82
85 bool success{false};
86 std::string message;
88};
89
91const char* to_string(AcousticsMode mode) noexcept;
92
94const char* to_string(Salinity salinity) noexcept;
95
97const char* to_string(UdpConfig::Mode mode) noexcept;
98
99} // namespace waterlinked::sonar
100
101#endif // WATERLINKEDSONAR_HTTP_TYPES_HPP
Device identity.
Definition types.hpp:15
std::string version
Full build string.
Definition types.hpp:22
std::string variant
Product variant; may be empty.
Definition types.hpp:21
std::string product_name
Product name, e.g. "Sonar 3D-15".
Definition types.hpp:20
std::string chipid
Chip ID, e.g. "0x12345678".
Definition types.hpp:16
std::string version_short
Release number, e.g. "1.8.0".
Definition types.hpp:23
int product_id
Product ID, e.g. 21045.
Definition types.hpp:19
bool is_ready
Whether the sonar has finished booting.
Definition types.hpp:18
int hardware_revision
Hardware revision, e.g. 6.
Definition types.hpp:17
Outcome of a forced NTP sync.
Definition types.hpp:84
std::string message
Human-readable outcome.
Definition types.hpp:86
bool success
Whether the clock synced.
Definition types.hpp:85
TimeStatus status
Device clock after the attempt.
Definition types.hpp:87
Imaging range limits in meters.
Definition types.hpp:55
double max
Farthest distance imaged.
Definition types.hpp:57
double min
Nearest distance imaged.
Definition types.hpp:56
Health of one subsystem.
Definition types.hpp:27
std::string status
"ok", "warning" or "error".
Definition types.hpp:30
std::string message
Human-readable description.
Definition types.hpp:29
std::string id
Status ID, e.g. "api-normal".
Definition types.hpp:28
bool operational
Whether the subsystem works.
Definition types.hpp:31
Health of the device subsystems.
Definition types.hpp:35
StatusEntry temperature
Internal temperature.
Definition types.hpp:37
std::optional< StatusEntry > time
System clock; firmware 1.7.1 or newer.
Definition types.hpp:39
StatusEntry systems_check
Internal processing.
Definition types.hpp:38
StatusEntry api
Integration API.
Definition types.hpp:36
State of the device clock.
Definition types.hpp:75
std::optional< std::int64_t > ntp_seconds_since_last_sync
Age of the latest sync; empty when the device reports none.
Definition types.hpp:80
std::chrono::system_clock::time_point system_time
Device time.
Definition types.hpp:76
std::string ntp_synced_to
Server of the latest sync.
Definition types.hpp:78
bool ntp_synced
Whether the clock is NTP-synchronized.
Definition types.hpp:77
Destination of the sonar's UDP stream.
Definition types.hpp:61
std::string unicast_destination_ip
Used in UNICAST mode only.
Definition types.hpp:70
std::uint16_t unicast_destination_port
Used in UNICAST mode only.
Definition types.hpp:71
Mode
Addressing of the stream.
Definition types.hpp:63
@ UNICAST
To the unicast destination.
@ MULTICAST
To the multicast group 224.0.0.96:4747.
Mode mode
Where the stream is sent.
Definition types.hpp:69
AcousticsMode
Imaging mode, which sets the field of view and the image rate.
Definition types.hpp:43
@ HIGH_FREQUENCY
40x40 degrees at 20 Hz.
@ LOW_FREQUENCY
90x40 degrees at 5 Hz.
Salinity
Water salinity used by the automatic speed of sound.
Definition types.hpp:49
const char * to_string(AcousticsMode mode) noexcept
API name of mode: "low-frequency" or "high-frequency".