#include <TCPSynchronizedClient.h>
Public Member Functions | |
| TCPSynchronizedClient (unsigned int neurGrpWidth, unsigned int neurGrpLength) | |
| ~TCPSynchronizedClient () | |
| bool | closeDevice () |
| bool | deviceOpen () |
| bool | fetchData () |
| bool | openSocket (string groupAddress, int port) |
| void | setTwoByteCoords (bool) |
Public Attributes | |
| unsigned int | spikeCount |
| unsigned int * | spikeBuffer |
| int | socketHandle |
| sockaddr_in | externalDevAddr |
| bool | socketConnected |
Private Member Functions | |
| TCPSynchronizedClient (const TCPSynchronizedClient &) | |
| TCPSynchronizedClient | operator= (const TCPSynchronizedClient &) |
| void | printMessageBuffer (unsigned char *msgBuf, unsigned int msgBufSize) |
Private Attributes | |
| unsigned int | neuronGrpWidth |
| unsigned int | neuronGrpLength |
| unsigned char * | msgBuffer |
| bool | socketOpen |
| unsigned char | requestDataMsgArray [1] |
| bool | twoByteCoordinates |
Definition at line 43 of file TCPSynchronizedClient.h.
|
||||||||||||
|
Constructor. Definition at line 63 of file TCPSynchronizedClient.cpp. References MESSAGE_BUFFER_SIZE, msgBuffer, neuronGrpLength, neuronGrpWidth, requestDataMsgArray, socketOpen, SPIKE_BUFFER_SIZE, spikeBuffer, spikeCount, and twoByteCoordinates. |
|
|
Destructor. Definition at line 85 of file TCPSynchronizedClient.cpp. References closeDevice(), msgBuffer, and spikeBuffer. |
|
|
Declare copy constructor private so it cannot be used inadvertently. |
|
|
Closes the socket. Definition at line 104 of file TCPSynchronizedClient.cpp. References socketHandle, and socketOpen. Referenced by DeviceManager::closeDevice(), and ~TCPSynchronizedClient(). |
|
|
Returns true if the socket is open. Definition at line 114 of file TCPSynchronizedClient.cpp. References socketOpen. |
|
|
Waits for a message containing data from the external device and unpacks the data. Definition at line 120 of file TCPSynchronizedClient.cpp. References msgBuffer, neuronGrpLength, neuronGrpWidth, printMessageBuffer(), requestDataMsgArray, socketHandle, socketOpen, spikeBuffer, spikeCount, SpikeStreamSimulation::systemError(), and twoByteCoordinates. Referenced by DeviceManager::fetchData(). |
|
||||||||||||
|
Opens the TCP socket. The connection to the socket is handled by a separate thread so that a failed connection can be timed out. Adapated from: http://cs.baylor.edu/~donahoo/practical/CSockets/textcode.html. Definition at line 277 of file TCPSynchronizedClient.cpp. References externalDevAddr, socketConnected, socketHandle, socketOpen, startTCPClientConnectThread(), and SpikeStreamSimulation::systemError(). Referenced by DeviceManager::loadDeviceInformation(). |
|
|
Declare assignment private so it cannot be used. |
|
||||||||||||
|
Prints out the message buffer received from the external device for debugging. Definition at line 342 of file TCPSynchronizedClient.cpp. Referenced by fetchData(). |
|
|
Vision data is potentially larger than 255, so need to use two bytes to encode the coordinates within a vision map, which replaces the timing information. Definition at line 331 of file TCPSynchronizedClient.cpp. References twoByteCoordinates. Referenced by DeviceManager::loadDeviceInformation(). |
|
|
Address of the socket. Definition at line 66 of file TCPSynchronizedClient.h. Referenced by openSocket(), and startTCPClientConnectThread(). |
|
|
Buffer to unpack message into. Definition at line 80 of file TCPSynchronizedClient.h. Referenced by fetchData(), TCPSynchronizedClient(), and ~TCPSynchronizedClient(). |
|
|
Neuron group length. Definition at line 77 of file TCPSynchronizedClient.h. Referenced by fetchData(), and TCPSynchronizedClient(). |
|
|
Neuron group width. Definition at line 74 of file TCPSynchronizedClient.h. Referenced by fetchData(), and TCPSynchronizedClient(). |
|
|
Array holding the request for data from the device. This is sent to the device to request the data. Definition at line 87 of file TCPSynchronizedClient.h. Referenced by fetchData(), and TCPSynchronizedClient(). |
|
|
Records whether socket has been successfully connected. Definition at line 69 of file TCPSynchronizedClient.h. Referenced by openSocket(), and startTCPClientConnectThread(). |
|
|
Integer used to access the socket. Definition at line 63 of file TCPSynchronizedClient.h. Referenced by closeDevice(), fetchData(), openSocket(), and startTCPClientConnectThread(). |
|
|
Records whether the socket has been opened. Definition at line 83 of file TCPSynchronizedClient.h. Referenced by closeDevice(), deviceOpen(), fetchData(), openSocket(), and TCPSynchronizedClient(). |
|
|
Holds the spikes that have been received from the network. Definition at line 60 of file TCPSynchronizedClient.h. Referenced by fetchData(), DeviceManager::fillDeviceBuffer(), TCPSynchronizedClient(), and ~TCPSynchronizedClient(). |
|
|
Holds the number of spikes in the spike buffer. Definition at line 57 of file TCPSynchronizedClient.h. Referenced by fetchData(), DeviceManager::fillDeviceBuffer(), and TCPSynchronizedClient(). |
|
|
Vision coordinates are too big to fit in a single byte. Set this to true when it is a vision connection. Definition at line 91 of file TCPSynchronizedClient.h. Referenced by fetchData(), setTwoByteCoords(), and TCPSynchronizedClient(). |
1.4.4