4#ifndef WATERLINKEDSONAR_CLIENT_HPP
5#define WATERLINKEDSONAR_CLIENT_HPP
29 explicit SonarClient(std::unique_ptr<HttpTransport> transport);
34 const std::string& ip, std::uint16_t port = 80,
35 std::chrono::milliseconds timeout = std::chrono::seconds(5));
45 return firmware_version_;
122 void require_firmware(
const char* what,
const char* min_version)
const;
124 std::unique_ptr<HttpTransport> transport_;
125 std::string firmware_version_;
Client for the Sonar 3D-15 integration API.
Definition client.hpp:23
void set_imu_batch_enabled(bool enabled)
Turns IMU batch output on or off via POST /output/imu-batch/enabled.
SonarClient(SonarClient &&) noexcept
void set_mode(AcousticsMode mode)
Sets the imaging mode via POST /acoustics/mode. Firmware 1.7.0 or newer.
Status status()
Subsystem health from GET /status.
Range range()
Imaging range limits in meters from GET /acoustics/range.
SonarClient(const std::string &ip, std::uint16_t port=80, std::chrono::milliseconds timeout=std::chrono::seconds(5))
Connects through a CurlTransport to ip on port, with timeout per request.
UdpConfig udp_config()
UDP configuration from GET /udp.
void set_ntp_address(const std::string &address)
Sets the NTP server address via POST /time/ntp. Firmware 1.7.1 or newer.
TimeStatus time_status()
Device clock state from GET /time/status. Firmware 1.7.1 or newer.
void set_salinity(Salinity salinity)
Sets the water salinity via POST /acoustics/salinity.
double temperature()
Water temperature at the sonar in degrees Celsius.
std::string ntp_address()
NTP server address from GET /time/ntp. Firmware 1.7.1 or newer.
void set_time_manual(std::chrono::system_clock::time_point now)
Sets the device clock via POST /time/manual.
void set_udp_config(const UdpConfig &config)
Sets UDP configuration via POST /udp.
void set_speed_of_sound(double speed)
Sets the speed of sound via POST /acoustics/speed_of_sound.
About about()
Device identity from GET /about.
ForceSyncResult force_sync_ntp(std::chrono::seconds timeout)
Triggers an NTP sync and blocks up to timeout while the device attempts it via POST /time/ntp/force-s...
AcousticsMode mode()
Imaging mode from GET /acoustics/mode. Firmware 1.7.0 or newer.
void set_acoustics_enabled(bool enabled)
Turns acoustic imaging on or off via POST /acoustics/enabled.
void set_range(Range range)
Sets imaging range limits via POST /acoustics/range.
bool acoustics_enabled()
Whether acoustic imaging is on, from GET /acoustics/enabled.
Salinity salinity()
Water salinity from GET /acoustics/salinity. Firmware 1.7.0 or newer.
double speed_of_sound()
Speed of sound in m/s from GET /acoustics/speed_of_sound; 0.0 means the sonar computes it from salini...
SonarClient(std::unique_ptr< HttpTransport > transport)
Fetches /about to verify connectivity and capture the firmware version.
const std::string & firmware_version() const
Firmware version captured at construction, e.g. "1.8.0".
Definition client.hpp:44
bool imu_batch_enabled()
Whether IMU batch output is on, from GET /output/imu-batch/enabled.
Blocking HTTP transport interface for the Sonar 3D-15 API.
AcousticsMode
Imaging mode: low frequency gives a 90x40 degree field of view at 5 Hz, high frequency 40x40 degrees ...
Definition types.hpp:58
Salinity
Water salinity, used by the sonar's automatic speed of sound.
Definition types.hpp:61
Device identity from GET /about.
Definition types.hpp:26
Outcome of a forced NTP sync.
Definition types.hpp:88
Imaging range limits in meters.
Definition types.hpp:64
Subsystem health from GET /status.
Definition types.hpp:48
Device clock state from GET /time/status.
Definition types.hpp:80
How the sonar streams data, from GET/POST /udp.
Definition types.hpp:70
Type definitions for the Sonar 3D-15 integration API.