4#ifndef WATERLINKEDSONAR_UDP_SOCKET_HPP
5#define WATERLINKEDSONAR_UDP_SOCKET_HPP
54 std::optional<Datagram>
recv(std::uint8_t* buf, std::size_t buf_size,
55 std::chrono::milliseconds timeout);
Receive-only UDP socket for the sonar's data stream.
Definition udp_socket.hpp:30
std::optional< Datagram > recv(std::uint8_t *buf, std::size_t buf_size, std::chrono::milliseconds timeout)
Blocks up to timeout for one datagram, written to buf.
std::uint16_t local_port() const
The bound port; differs from the configured one only when it was 0.
UdpSocket(const UdpSocket &)=delete
UdpSocket & operator=(const UdpSocket &)=delete
UdpSocket(UdpSocketConfig config)
Opens and binds the socket, requests SO_RCVBUF, and in multicast mode sets SO_REUSEADDR and joins the...
constexpr const char * MULTICAST_GROUP
Multicast group address for sonar data streams.
Definition types.hpp:19
constexpr std::uint16_t MULTICAST_PORT
Multicast port for sonar data streams.
Definition types.hpp:21
Socket setup for the sonar's data stream.
Definition udp_socket.hpp:17
int receive_buffer_bytes
SO_RCVBUF request.
Definition udp_socket.hpp:25
std::string interface_ip
Interface for the multicast join, or the bind address for unicast.
Definition udp_socket.hpp:24
std::uint16_t port
For unicast this must match the destination port configured on the sonar.
Definition udp_socket.hpp:22
Mode mode
Definition udp_socket.hpp:19
Mode
Definition udp_socket.hpp:18
std::string multicast_group
Joined in MULTICAST mode.
Definition udp_socket.hpp:20
Byte count and sender address of one received datagram.
Definition udp_socket.hpp:33
std::string source_ip
Definition udp_socket.hpp:35
std::size_t size
Definition udp_socket.hpp:34
Type definitions for the Sonar 3D-15 integration API.