AREXPORT ArTcpConnection::ArTcpConnection() { myStatus = STATUS_NEVER_OPENED; buildStrMap(); myOwnSocket = true; mySocket = new ArSocket(); }
AREXPORT ArSerialConnection::ArSerialConnection() { myPort = INVALID_HANDLE_VALUE; myBaudRate = 9600; myStatus = STATUS_NEVER_OPENED; myHardwareControl = false; buildStrMap(); }
AREXPORT ArDeviceConnection::ArDeviceConnection() { if (!ourStrMapInited) { ourStrMapInited = true; buildStrMap(); } }
AREXPORT ArSerialConnection::ArSerialConnection() { myPort = -1; myPortName = "none"; myBaudRate = 9600; myHardwareControl = false; myStatus = STATUS_NEVER_OPENED; myTakingTimeStamps = false; buildStrMap(); }
AREXPORT ArSerialConnection::ArSerialConnection(bool is422) { myPort = -1; myPortName = "none"; myBaudRate = 9600; myHardwareControl = false; myStatus = STATUS_NEVER_OPENED; myTakingTimeStamps = false; myIs422 = is422; if (myIs422) setPortType("serial422"); else setPortType("serial"); buildStrMap(); }
/** Subclasses of this connection type should call setDCPortType in their constructor, then setDCPortName in their openPort. Classes that use a device connection should call setDCDeviceName with the device the connection is attached too (usually in setDeviceConnection on the device)... Things that read the port should call debugStartPacket whenever they are starting reading a packet... Then debugBytesRead with the byte count whenever they read or fail a read (0 if a read is failed)... Then debugEndPacket with a boolean for if the packet was a good one or a bad one and an integer that's postive for the type of packet (if successful) or negative to express why the read failed (if not successful). For the 'why the read failed' the values should be negative, and should all be unique (anywhere a read can return), preferably with a gap between the values, so that if more debugging is needed there are values in between the ones already there. Generally this information isn't used or computed, unless the global member ArDeviceConnection::debugShouldLog is called to turn it on. **/ AREXPORT ArDeviceConnection::ArDeviceConnection() { if (!ourStrMapInited) { ourStrMapInited = true; buildStrMap(); } myDCPortName = "Unknown port name"; myDCPortType = "Unknown port type"; myDCDeviceName = "Unknown device type"; myDCDebugPacketStarted = false; myDCDebugBytesRead = 0; myDCDebugTimesRead = 0; myDCDebugNumGoodPackets = 0; myDCDebugNumBadPackets = 0; }