Handles TCP transmission of commands to the DVL.
More...
#include <path_finder.hpp>
|
| | Sender (const char *_address, const int _port, const int _timeout_ms=1000) |
| | Constructor for Sender.
|
| |
| | ~Sender () |
| | Destructor. Closes the socket.
|
| |
| ssize_t | read (unsigned char *buffer, size_t size) |
| | Read response from DVL after sending a command.
|
| |
| void | flush_buffer () |
| | Clear socket buffer.
|
| |
| bool | send_cmd (const std::string &cmd, const uint &wait_time=0, bool newline=true) |
| | Send a generic string command to the DVL.
|
| |
| bool | send_break_cmd () |
| | Send a Soft Break ("===") to wake up the DVL.
|
| |
| bool | send_ping_cmd () |
| | Send the Start Pinging command ("CS").
|
| |
Handles TCP transmission of commands to the DVL.
◆ Sender()
| driver::dvl_driver::path_finder::Sender::Sender |
( |
const char * |
_address, |
|
|
const int |
_port, |
|
|
const int |
_timeout_ms = 1000 |
|
) |
| |
|
explicit |
Constructor for Sender.
- Parameters
-
| _address | IP address of the DVL |
| _port | TCP port to connect to (usually 1033 for commands) |
| _timeout_ms | Socket timeout in milliseconds |
◆ ~Sender()
| driver::dvl_driver::path_finder::Sender::~Sender |
( |
| ) |
|
Destructor. Closes the socket.
◆ flush_buffer()
| void driver::dvl_driver::path_finder::Sender::flush_buffer |
( |
| ) |
|
◆ read()
| ssize_t driver::dvl_driver::path_finder::Sender::read |
( |
unsigned char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Read response from DVL after sending a command.
- Parameters
-
| buffer | Destination buffer |
| size | Maximum size to read |
- Returns
- Number of bytes read
◆ send_break_cmd()
| bool driver::dvl_driver::path_finder::Sender::send_break_cmd |
( |
| ) |
|
Send a Soft Break ("===") to wake up the DVL.
- Returns
- true if sent successfully
◆ send_cmd()
| bool driver::dvl_driver::path_finder::Sender::send_cmd |
( |
const std::string & |
cmd, |
|
|
const uint & |
wait_time = 0, |
|
|
bool |
newline = true |
|
) |
| |
Send a generic string command to the DVL.
- Parameters
-
| cmd | Command string (e.g., "CR1\r\n") |
| wait_time | Time to wait after sending (seconds) |
- Returns
- true if sent successfully
◆ send_ping_cmd()
| bool driver::dvl_driver::path_finder::Sender::send_ping_cmd |
( |
| ) |
|
Send the Start Pinging command ("CS").
- Returns
- true if sent successfully
The documentation for this class was generated from the following files: