Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Committer:
uci1
Date:
Thu Oct 30 06:42:17 2014 +0000
Revision:
56:0bba0ef15697
Parent:
37:ff95e7070f26
Child:
84:80b15993944e
update ext libs, add tempr, allow SST/ATWD, improve handshaking, run/seq list, req seq range, allow SBD only in low pwr, all pins start off, can collect data to ram w/o SD card, add parameters to status update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
uci1 37:ff95e7070f26 1 #include "SnCommWinAfar.h"
uci1 37:ff95e7070f26 2
uci1 37:ff95e7070f26 3 #include "SnCommAfarNetIf.h"
uci1 37:ff95e7070f26 4
uci1 37:ff95e7070f26 5 SnCommWinAfar::SnCommWinAfar(SnConfigFrame& conf) :
uci1 37:ff95e7070f26 6 SnCommWin(new SnCommAfarNetIf(conf.GetRemoteServer(),
uci1 37:ff95e7070f26 7 conf.GetRemotePort(),
uci1 37:ff95e7070f26 8 conf.GetMbedIP(),
uci1 37:ff95e7070f26 9 conf.GetMbedMask(),
uci1 37:ff95e7070f26 10 conf.GetMbedGate())) {
uci1 37:ff95e7070f26 11
uci1 37:ff95e7070f26 12 }
uci1 37:ff95e7070f26 13
uci1 37:ff95e7070f26 14 SnCommWin::ECommWinResult SnCommWinAfar::OpenWindow(const uint32_t timeout,
uci1 37:ff95e7070f26 15 const bool sendStatus,
uci1 37:ff95e7070f26 16 const SnConfigFrame& conf,
uci1 37:ff95e7070f26 17 const SnEventFrame& evt,
uci1 37:ff95e7070f26 18 const SnPowerFrame& pow,
uci1 37:ff95e7070f26 19 const uint16_t seq,
uci1 37:ff95e7070f26 20 const float thmrate,
uci1 37:ff95e7070f26 21 const float evtrate,
uci1 56:0bba0ef15697 22 const uint32_t powerOnTime,
uci1 56:0bba0ef15697 23 const SnTempFrame& temper,
uci1 37:ff95e7070f26 24 char* const genBuf) {
uci1 37:ff95e7070f26 25 #ifdef DEBUG
uci1 37:ff95e7070f26 26 printf("SnCommWinAfar::OpenWindow\r\n");
uci1 37:ff95e7070f26 27 #endif
uci1 37:ff95e7070f26 28
uci1 37:ff95e7070f26 29 const bool canCon = fComm->Connect(timeout);
uci1 37:ff95e7070f26 30
uci1 37:ff95e7070f26 31 SnCommWin::ECommWinResult ret = canCon ? SnCommWin::kConnected
uci1 37:ff95e7070f26 32 : SnCommWin::kCanNotConnect;
uci1 37:ff95e7070f26 33
uci1 37:ff95e7070f26 34 if (canCon && sendStatus) {
uci1 37:ff95e7070f26 35 #ifdef DEBUG
uci1 37:ff95e7070f26 36 printf("calling SendStatus\r\n");
uci1 37:ff95e7070f26 37 #endif
uci1 56:0bba0ef15697 38 ret = SendStatus(conf, evt, pow, seq, thmrate, evtrate, powerOnTime, temper, genBuf, timeout);
uci1 37:ff95e7070f26 39 #ifdef DEBUG
uci1 37:ff95e7070f26 40 printf("Send Status returned\r\n");
uci1 37:ff95e7070f26 41 #endif
uci1 37:ff95e7070f26 42 }
uci1 37:ff95e7070f26 43
uci1 37:ff95e7070f26 44 return ret;
uci1 37:ff95e7070f26 45 }