CRobotRemoteWLanThread Class Reference

#include <RobotRemote.h>

Inheritance diagram for CRobotRemoteWLanThread:

Thread< CRobotRemoteWLanThread > List of all members.

Public Member Functions

 CRobotRemoteWLanThread ()
 ~CRobotRemoteWLanThread ()
bool wlanIsConnected ()
void wlanConnect (const unsigned long remoteIP, int remotePort)
void wlanDisconnect ()

Public Attributes

 DECLARE_SYNC
MessageQueue queueToRobot
MessageQueue queueFromRobot

Private Member Functions

void communicate ()

Private Attributes

TcpConnectiontcpConnection
unsigned long remoteIP
int remotePort
bool wlanNeedsToBeConnected

Detailed Description

A thread that manages the communication between the queues and the Wireless Lan

Author:
Martin Lötzsch

Definition at line 34 of file RobotRemote.h.


Constructor & Destructor Documentation

CRobotRemoteWLanThread::CRobotRemoteWLanThread (  ) 

Constructor

Definition at line 351 of file RobotRemote.cpp.

References communicate(), Thread< CRobotRemoteWLanThread >::start(), tcpConnection, and wlanNeedsToBeConnected.

CRobotRemoteWLanThread::~CRobotRemoteWLanThread (  ) 

Destructor

Definition at line 497 of file RobotRemote.cpp.


Member Function Documentation

void CRobotRemoteWLanThread::communicate (  )  [private]

The thread main function

Definition at line 358 of file RobotRemote.cpp.

References MessageQueue::clear(), getRobotRemoteApp(), MessageQueue::isEmpty(), Thread< CRobotRemoteWLanThread >::isRunning(), PRINT, queueFromRobot, queueToRobot, remoteIP, remotePort, TcpConnection::sendAndReceive(), SYNC, SYNC_WITH, tcpConnection, wlanIsConnected(), and wlanNeedsToBeConnected.

Referenced by CRobotRemoteWLanThread().

void CRobotRemoteWLanThread::wlanConnect ( const unsigned long  remoteIP,
int  remotePort 
)

This function establishes the connection over the WLan interface and must be called before using it, of course

Definition at line 448 of file RobotRemote.cpp.

References PRINT, remoteIP, remotePort, SYNC, and wlanNeedsToBeConnected.

Referenced by CRobotRemoteDlg1::OnConnectButton().

void CRobotRemoteWLanThread::wlanDisconnect (  ) 

This function terminates an WLan connection

send empty DebugKeyTable and immediateReadWrite to prevent useless full queues on robot

Todo:
this might be not usefull when in QueueFillRequest::overwriteOlder mode

Definition at line 465 of file RobotRemote.cpp.

References OutMessage::bin, debugKeyTable, OutMessage::finishMessage(), idDebugKeyTable, idQueueFillRequest, idSolutionRequest, MessageQueue::out, PRINT, queueToRobot, SolutionRequest::setDefaultSolutions(), SYNC, tcpConnection, and wlanIsConnected().

Referenced by CRobotRemoteApp::ExitInstance(), and CRobotRemoteApp::InitInstance().

bool CRobotRemoteWLanThread::wlanIsConnected (  ) 

Returns whether WLAN connection is established

Definition at line 437 of file RobotRemote.cpp.

References TcpConnection::isConnected(), and tcpConnection.

Referenced by communicate(), CRobotRemoteApp::OnIdle(), and wlanDisconnect().


Member Data Documentation

CRobotRemoteWLanThread::DECLARE_SYNC

Make this object synchronizable.

Definition at line 37 of file RobotRemote.h.

MessageQueue CRobotRemoteWLanThread::queueFromRobot

A queue for messages to be received from the WLAN

Definition at line 49 of file RobotRemote.h.

Referenced by communicate().

MessageQueue CRobotRemoteWLanThread::queueToRobot

A queue for messages to be sent via the WLAN to the robot

Definition at line 46 of file RobotRemote.h.

Referenced by communicate(), CRobotRemoteApp::OnIdle(), and wlanDisconnect().

unsigned long CRobotRemoteWLanThread::remoteIP [private]

Definition at line 66 of file RobotRemote.h.

Referenced by communicate(), and wlanConnect().

int CRobotRemoteWLanThread::remotePort [private]

Definition at line 67 of file RobotRemote.h.

Referenced by communicate(), and wlanConnect().

TcpConnection* CRobotRemoteWLanThread::tcpConnection [private]

a TCP/IP client class handling the WLan interface

Definition at line 65 of file RobotRemote.h.

Referenced by communicate(), CRobotRemoteWLanThread(), wlanDisconnect(), and wlanIsConnected().

bool CRobotRemoteWLanThread::wlanNeedsToBeConnected [private]

Definition at line 68 of file RobotRemote.h.

Referenced by communicate(), CRobotRemoteWLanThread(), and wlanConnect().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:24:38 2006 for DT2005.panorama by  doxygen 1.4.7