Common
common packages for kyubic
 
Loading...
Searching...
No Matches
driver::dvl_driver::path_finder::Sender Class Reference

Handles TCP transmission of commands to the DVL. More...

#include <path_finder.hpp>

Public Member Functions

 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").
 

Detailed Description

Handles TCP transmission of commands to the DVL.

Constructor & Destructor Documentation

◆ Sender()

driver::dvl_driver::path_finder::Sender::Sender ( const char *  _address,
const int  _port,
const int  _timeout_ms = 1000 
)
explicit

Constructor for Sender.

Parameters
_addressIP address of the DVL
_portTCP port to connect to (usually 1033 for commands)
_timeout_msSocket timeout in milliseconds

◆ ~Sender()

driver::dvl_driver::path_finder::Sender::~Sender ( )

Destructor. Closes the socket.

Member Function Documentation

◆ flush_buffer()

void driver::dvl_driver::path_finder::Sender::flush_buffer ( )

Clear socket 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
bufferDestination buffer
sizeMaximum 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
cmdCommand string (e.g., "CR1\r\n")
wait_timeTime 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: