TestCenter Reference
TestCenterAdvanced.IPC.Communicator Class Reference

The Communicator is the superclass for the communicating entities. More...

Inheritance diagram for TestCenterAdvanced.IPC.Communicator:
TestCenterAdvanced.IPC.ComMaster TestCenterAdvanced.IPC.ComSlave

Public Member Functions

def isConnected (self)
 Get the connection status of the IPC client. More...
 
def send (self, data, timeout)
 Send the data via the socket using the given timeout. More...
 
def recv (self, timeout)
 Receive data via the socket using the given timeout. More...
 
def getLastError (self)
 Get a tuple describing the last error. More...
 
def getLastErrorWithMessage (self)
 Get a tuple describing the last error. More...
 

Detailed Description

The Communicator is the superclass for the communicating entities.

This class contains the fundamental routines for sending messages between the two entities master and slave. The communication protocol consists of two parts. First the length of the message is sent via a string with exactly 16 bytes. This fixed length is essential as with asynchronous communication many non obvious things can happen (like only parts of messages being transmitted or concatenation of successivly sent messages). The second part of the communication protocol sends the actual data in junks of a given size.

Definition at line 26 of file IPC.py.

Member Function Documentation

◆ getLastError()

def TestCenterAdvanced.IPC.Communicator.getLastError (   self)

Get a tuple describing the last error.

Each failure event sets an internal error code which can be read using this method.

Definition at line 169 of file IPC.py.

References TestCenterAdvanced.IPC.Communicator._mErrorCode.

◆ getLastErrorWithMessage()

def TestCenterAdvanced.IPC.Communicator.getLastErrorWithMessage (   self)

Get a tuple describing the last error.

Each failure event sets an internal error code which can be read using this method.

Definition at line 176 of file IPC.py.

References TestCenterAdvanced.IPC.Communicator._mErrorCode, TestCenterAdvanced.IPC.Communicator._mErrorMsg, TestCenterAdvanced.IPC.ComMaster.disconnect(), and TestCenterAdvanced.IPC.ComSlave.disconnect().

◆ isConnected()

def TestCenterAdvanced.IPC.Communicator.isConnected (   self)

Get the connection status of the IPC client.

Definition at line 50 of file IPC.py.

References TestCenterAdvanced.IPC.Communicator._mConnected.

◆ recv()

def TestCenterAdvanced.IPC.Communicator.recv (   self,
  timeout 
)

Receive data via the socket using the given timeout.

This method implements the receiving part of the protocol specified in the description of send. This method returns True if it succeeded sending the data, False otherwise.

Definition at line 113 of file IPC.py.

References TestCenterAdvanced.IPC.Communicator._csocket, TestCenterAdvanced.IPC.Communicator._handleError(), TestCenterAdvanced.IPC.Communicator._mConnected, and TestCenterAdvanced.IPC.Communicator._recv().

◆ send()

def TestCenterAdvanced.IPC.Communicator.send (   self,
  data,
  timeout 
)

Send the data via the socket using the given timeout.

This method returns True if it succeeded sending the data, False otherwise.

Definition at line 57 of file IPC.py.

References TestCenterAdvanced.IPC.Communicator._csocket, TestCenterAdvanced.IPC.Communicator._handleError(), TestCenterAdvanced.IPC.Communicator._mConnected, TestCenterAdvanced.IPC.Communicator._mMsgLength, and TestCenterAdvanced.IPC.Communicator._send().


The documentation for this class was generated from the following file: