Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
SnCommAfarTCP.h@7:079617408fec, 2012-08-04 (annotated)
- Committer:
- uci1
- Date:
- Sat Aug 04 01:48:55 2012 +0000
- Revision:
- 7:079617408fec
- Parent:
- 6:6f002d202f59
- Child:
- 8:95a325df1f6b
Bug fix to seq finder. Comms totally disabled. Many debug messages.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uci1 | 3:24c5f0f50bf1 | 1 | #ifndef SN_SnCommAfarTCP |
uci1 | 3:24c5f0f50bf1 | 2 | #define SN_SnCommAfarTCP |
uci1 | 7:079617408fec | 3 | |
uci1 | 3:24c5f0f50bf1 | 4 | #include "SnCommWin.h" |
uci1 | 6:6f002d202f59 | 5 | #include "string" |
uci1 | 3:24c5f0f50bf1 | 6 | |
uci1 | 3:24c5f0f50bf1 | 7 | class SnConfigFrame; |
uci1 | 3:24c5f0f50bf1 | 8 | class SnEventFrame; |
uci1 | 3:24c5f0f50bf1 | 9 | |
uci1 | 3:24c5f0f50bf1 | 10 | class EthernetInterface; |
uci1 | 3:24c5f0f50bf1 | 11 | class TCPSocketConnection; |
uci1 | 3:24c5f0f50bf1 | 12 | |
uci1 | 3:24c5f0f50bf1 | 13 | class SnCommAfarTCP : public SnCommWin { |
uci1 | 5:9cea89700c66 | 14 | public: |
uci1 | 6:6f002d202f59 | 15 | typedef int (TCPSocketConnection::*TCPSendRecv)(char*, int); |
uci1 | 5:9cea89700c66 | 16 | |
uci1 | 3:24c5f0f50bf1 | 17 | protected: |
uci1 | 6:6f002d202f59 | 18 | bool fUseB64; |
uci1 | 6:6f002d202f59 | 19 | std::string fRserv; |
uci1 | 6:6f002d202f59 | 20 | int32_t fRport; |
uci1 | 3:24c5f0f50bf1 | 21 | EthernetInterface* fEth; |
uci1 | 3:24c5f0f50bf1 | 22 | TCPSocketConnection* fSock; |
uci1 | 3:24c5f0f50bf1 | 23 | |
uci1 | 6:6f002d202f59 | 24 | int DoIO(char* const data, |
uci1 | 6:6f002d202f59 | 25 | const uint32_t length, |
uci1 | 6:6f002d202f59 | 26 | const uint32_t timeout_clock, |
uci1 | 6:6f002d202f59 | 27 | TCPSendRecv fcn); |
uci1 | 6:6f002d202f59 | 28 | int ReceiveAll(char* const buf, const uint32_t mlen, |
uci1 | 6:6f002d202f59 | 29 | const uint32_t timeout_clock); |
uci1 | 6:6f002d202f59 | 30 | int SendAll(char* const data, const uint32_t length, |
uci1 | 6:6f002d202f59 | 31 | const uint32_t timeout_clock); |
uci1 | 6:6f002d202f59 | 32 | |
uci1 | 6:6f002d202f59 | 33 | virtual SnCommWin::ECommWinResult SendFilename(const char* fn, |
uci1 | 6:6f002d202f59 | 34 | char* const genBuf, |
uci1 | 6:6f002d202f59 | 35 | const uint32_t timeout_clock); |
uci1 | 6:6f002d202f59 | 36 | virtual SnCommWin::ECommWinResult SendFileContents(FILE* inf, |
uci1 | 3:24c5f0f50bf1 | 37 | const SnConfigFrame& curConf, |
uci1 | 3:24c5f0f50bf1 | 38 | SnEventFrame& evt, |
uci1 | 3:24c5f0f50bf1 | 39 | char* const genBuf, |
uci1 | 6:6f002d202f59 | 40 | uint32_t nevts, |
uci1 | 6:6f002d202f59 | 41 | const uint32_t timeout_clock, |
uci1 | 3:24c5f0f50bf1 | 42 | const uint32_t firstEvt=0); |
uci1 | 3:24c5f0f50bf1 | 43 | |
uci1 | 3:24c5f0f50bf1 | 44 | public: |
uci1 | 6:6f002d202f59 | 45 | SnCommAfarTCP(const bool useb64, |
uci1 | 6:6f002d202f59 | 46 | const char* remote="128.195.204.151", |
uci1 | 6:6f002d202f59 | 47 | const int32_t rport=6655); |
uci1 | 3:24c5f0f50bf1 | 48 | virtual ~SnCommAfarTCP(); |
uci1 | 3:24c5f0f50bf1 | 49 | |
uci1 | 3:24c5f0f50bf1 | 50 | virtual bool Connect(const uint32_t timeout); |
uci1 | 3:24c5f0f50bf1 | 51 | |
uci1 | 3:24c5f0f50bf1 | 52 | virtual SnCommWin::ECommWinResult OpenWindow(const uint32_t timeout, |
uci1 | 3:24c5f0f50bf1 | 53 | const bool sendStatus, |
uci1 | 3:24c5f0f50bf1 | 54 | const SnConfigFrame& conf, |
uci1 | 3:24c5f0f50bf1 | 55 | const SnEventFrame& evt, |
uci1 | 3:24c5f0f50bf1 | 56 | char* const genBuf); |
uci1 | 3:24c5f0f50bf1 | 57 | |
uci1 | 3:24c5f0f50bf1 | 58 | virtual SnCommWin::ECommWinResult WaitHandshake(const uint32_t timeout, |
uci1 | 3:24c5f0f50bf1 | 59 | char* const buf, |
uci1 | 6:6f002d202f59 | 60 | const uint32_t bsize, |
uci1 | 6:6f002d202f59 | 61 | uint8_t& hndShkCode); |
uci1 | 3:24c5f0f50bf1 | 62 | |
uci1 | 3:24c5f0f50bf1 | 63 | virtual SnCommWin::ECommWinResult GetConfig(SnConfigFrame& conf, |
uci1 | 3:24c5f0f50bf1 | 64 | const uint32_t timeOut, |
uci1 | 3:24c5f0f50bf1 | 65 | char* const confBuf, |
uci1 | 3:24c5f0f50bf1 | 66 | const uint32_t bsize); |
uci1 | 3:24c5f0f50bf1 | 67 | |
uci1 | 3:24c5f0f50bf1 | 68 | virtual SnCommWin::ECommWinResult SendStatus(const SnConfigFrame& conf, |
uci1 | 3:24c5f0f50bf1 | 69 | const SnEventFrame& evt, |
uci1 | 6:6f002d202f59 | 70 | char* const genBuf, |
uci1 | 6:6f002d202f59 | 71 | const uint32_t timeout_clock); |
uci1 | 3:24c5f0f50bf1 | 72 | |
uci1 | 3:24c5f0f50bf1 | 73 | |
uci1 | 3:24c5f0f50bf1 | 74 | }; |
uci1 | 7:079617408fec | 75 | |
uci1 | 3:24c5f0f50bf1 | 76 | #endif // SN_SnCommAfarTCP |