#include <RobotControlDebugConnection.h>
Public Member Functions | |
CRobotControlDebugConnection (MessageQueue &queueFromRobot, MessageQueue &queueToRobot, MessageQueue &error) | |
~CRobotControlDebugConnection () | |
bool | wLanIsConnected () |
void | wLanConnect (const unsigned long remoteIP, int remotePort) |
void | wLanDisconnect () |
void | sendMessageQueue () |
virtual void | OnConnect (int nErrorCode) |
virtual void | OnReceive (int nErrorCode) |
virtual void | OnSend (int nErrorCode) |
virtual void | OnClose (int nErrorCode) |
Private Member Functions | |
void | resetBuffers () |
Private Attributes | |
MessageQueue & | error |
MessageQueue & | queueToRobot |
MessageQueue & | queueFromRobot |
bool | connected |
int | sendBufferSize |
int | sendPosition |
char * | sendBuffer |
int | receiveBufferSize |
int | receivePosition |
int | receiveBufferForSize |
char * | receiveBuffer |
bool | receivingData |
bool | socketCreated |
char | ipAddr [32] |
Definition at line 24 of file RobotControlDebugConnection.h.
CRobotControlDebugConnection::CRobotControlDebugConnection | ( | MessageQueue & | queueFromRobot, | |
MessageQueue & | queueToRobot, | |||
MessageQueue & | error | |||
) |
Definition at line 17 of file RobotControlDebugConnection.cpp.
References connected, receivingData, resetBuffers(), and sendBuffer.
CRobotControlDebugConnection::~CRobotControlDebugConnection | ( | ) |
void CRobotControlDebugConnection::OnClose | ( | int | nErrorCode | ) | [virtual] |
Definition at line 240 of file RobotControlDebugConnection.cpp.
References connected, ERRORMESSAGE, and resetBuffers().
void CRobotControlDebugConnection::OnConnect | ( | int | nErrorCode | ) | [virtual] |
Definition at line 73 of file RobotControlDebugConnection.cpp.
References connected, ERRORMESSAGE, ipAddr, and resetBuffers().
void CRobotControlDebugConnection::OnReceive | ( | int | nErrorCode | ) | [virtual] |
Definition at line 137 of file RobotControlDebugConnection.cpp.
References ERRORMESSAGE, int(), queueFromRobot, receiveBuffer, receiveBufferForSize, receiveBufferSize, receivePosition, and receivingData.
void CRobotControlDebugConnection::OnSend | ( | int | nErrorCode | ) | [virtual] |
Definition at line 181 of file RobotControlDebugConnection.cpp.
References ERRORMESSAGE, sendBuffer, sendBufferSize, and sendPosition.
Referenced by sendMessageQueue().
void CRobotControlDebugConnection::resetBuffers | ( | ) | [private] |
Definition at line 28 of file RobotControlDebugConnection.cpp.
References int(), receiveBuffer, receiveBufferForSize, receiveBufferSize, receivePosition, receivingData, sendBuffer, sendBufferSize, and sendPosition.
Referenced by CRobotControlDebugConnection(), OnClose(), OnConnect(), wLanDisconnect(), and ~CRobotControlDebugConnection().
void CRobotControlDebugConnection::sendMessageQueue | ( | ) |
sends all the Messages in the queueToRobot to the robot and clears the queue after that
Definition at line 217 of file RobotControlDebugConnection.cpp.
References MessageQueue::getStreamedSize(), MessageQueue::isEmpty(), OnSend(), queueToRobot, sendBuffer, and sendBufferSize.
Referenced by CRobotControlPhysicalRobots::onIdle().
void CRobotControlDebugConnection::wLanConnect | ( | const unsigned long | remoteIP, | |
int | remotePort | |||
) |
connects to the robot
Definition at line 55 of file RobotControlDebugConnection.cpp.
References error, ERRORMESSAGE, OutMessage::finishMessage(), idText, ipAddr, MessageQueue::out, and OutMessage::text.
void CRobotControlDebugConnection::wLanDisconnect | ( | ) |
closes the connection
Definition at line 269 of file RobotControlDebugConnection.cpp.
References connected, ERRORMESSAGE, and resetBuffers().
bool CRobotControlDebugConnection::wLanIsConnected | ( | ) |
Returns true if the connection is established
Definition at line 264 of file RobotControlDebugConnection.cpp.
References connected.
Referenced by CRobotControlPhysicalRobots::connect().
bool CRobotControlDebugConnection::connected [private] |
Definition at line 47 of file RobotControlDebugConnection.h.
Referenced by CRobotControlDebugConnection(), OnClose(), OnConnect(), wLanDisconnect(), and wLanIsConnected().
MessageQueue& CRobotControlDebugConnection::error [private] |
MessageQueue where error-messages are send to
Definition at line 44 of file RobotControlDebugConnection.h.
Referenced by wLanConnect().
char CRobotControlDebugConnection::ipAddr[32] [private] |
Definition at line 60 of file RobotControlDebugConnection.h.
Referenced by OnConnect(), and wLanConnect().
MessageQueue where messages from the robot arrive
Definition at line 46 of file RobotControlDebugConnection.h.
Referenced by OnReceive().
MessageQueue for messages to the robot
Definition at line 45 of file RobotControlDebugConnection.h.
Referenced by sendMessageQueue().
char* CRobotControlDebugConnection::receiveBuffer [private] |
Definition at line 56 of file RobotControlDebugConnection.h.
Referenced by OnReceive(), and resetBuffers().
int CRobotControlDebugConnection::receiveBufferForSize [private] |
Definition at line 55 of file RobotControlDebugConnection.h.
Referenced by OnReceive(), and resetBuffers().
int CRobotControlDebugConnection::receiveBufferSize [private] |
Definition at line 53 of file RobotControlDebugConnection.h.
Referenced by OnReceive(), and resetBuffers().
int CRobotControlDebugConnection::receivePosition [private] |
Definition at line 54 of file RobotControlDebugConnection.h.
Referenced by OnReceive(), and resetBuffers().
bool CRobotControlDebugConnection::receivingData [private] |
Definition at line 57 of file RobotControlDebugConnection.h.
Referenced by CRobotControlDebugConnection(), OnReceive(), and resetBuffers().
char* CRobotControlDebugConnection::sendBuffer [private] |
Definition at line 52 of file RobotControlDebugConnection.h.
Referenced by CRobotControlDebugConnection(), OnSend(), resetBuffers(), and sendMessageQueue().
int CRobotControlDebugConnection::sendBufferSize [private] |
Definition at line 50 of file RobotControlDebugConnection.h.
Referenced by OnSend(), resetBuffers(), and sendMessageQueue().
int CRobotControlDebugConnection::sendPosition [private] |
Definition at line 51 of file RobotControlDebugConnection.h.
Referenced by OnSend(), and resetBuffers().
bool CRobotControlDebugConnection::socketCreated [private] |
Definition at line 58 of file RobotControlDebugConnection.h.