iSpike
2.1
Spike conversion library for robotics
|
#include <YarpConnection.hpp>
Public Member Functions | |
YarpConnection (std::string ip, unsigned port) | |
~YarpConnection () | |
int | connect_to_port (std::string ip, unsigned port) |
map< string, YarpPortDetails > & | getPortMap () |
string | getSocketString () |
void | prepare_to_read_binary () |
void | prepare_to_read_text () |
bool | read_image (Bitmap &bitmap) |
std::string | read_until (string until) |
int | write_text (std::string message) |
Main interface used for communication with Yarp
Definition at line 18 of file YarpConnection.hpp.
YarpConnection::YarpConnection | ( | std::string | ip, |
unsigned | port | ||
) |
Constructor
Definition at line 24 of file YarpConnection.cpp.
Destructor
Definition at line 77 of file YarpConnection.cpp.
int YarpConnection::connect_to_port | ( | std::string | ip, |
unsigned | port | ||
) |
Connect to a given YARP port
ip | The IP address of the Yarp server |
port | The port number to connect to |
Definition at line 137 of file YarpConnection.cpp.
map<string, YarpPortDetails>& ispike::YarpConnection::getPortMap | ( | ) | [inline] |
Definition at line 23 of file YarpConnection.hpp.
string YarpConnection::getSocketString | ( | ) |
Definition at line 97 of file YarpConnection.cpp.
Reverses the connection to enable binary contents to be read. It will no longer be possible to write to this port
Definition at line 167 of file YarpConnection.cpp.
void YarpConnection::prepare_to_read_text | ( | ) |
Reverses the connection to enable text to be read It will no longer be possible to write to this port
Definition at line 156 of file YarpConnection.cpp.
bool YarpConnection::read_image | ( | Bitmap & | bitmap | ) |
Reads image data into the supplied bitmap, resizing it if necessary Returns true if data has been successfully read, false otherwise.
Definition at line 203 of file YarpConnection.cpp.
string YarpConnection::read_until | ( | string | until | ) |
Read text until a given string is received
until | The string where we stop |
Definition at line 124 of file YarpConnection.cpp.
int YarpConnection::write_text | ( | std::string | message | ) |
Write text contents to a previously opened socket
message | The message to be written |
Definition at line 88 of file YarpConnection.cpp.