Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
Diff: SnConfigFrame.h
- Revision:
- 67:ec999336fcd1
- Parent:
- 59:21128cc24b04
- Child:
- 76:f8383f0292c2
--- a/SnConfigFrame.h Tue Dec 02 21:55:27 2014 +0000 +++ b/SnConfigFrame.h Tue Feb 03 00:04:30 2015 +0000 @@ -18,12 +18,15 @@ static const uint8_t kConfLblLen=64; // length of configuration label char array (63+'\0') (must not change!! used in i/o sizes) static const uint8_t kIPLen=16; // length of IP string. matches MBED's Socket class (so no ipv6) (must not change!! used in i/o sizes) +#ifdef USE_INTERFACE_CHIP static const char* const kDefConfFile; // default configuration file static const char* const kDefRemIpFilen; static const char* const kDefRemPortFilen; static const char* const kDefMbedIPFilen; static const char* const kDefMbedMaskFilen; static const char* const kDefMbedGateFilen; +#endif + static const char* const kDefIPflag; // flag to use IP default // ATWD 4channel configs @@ -230,8 +233,9 @@ return sz; } - bool ReadDefaultIPFiles(); +#ifdef USE_INTERFACE_CHIP bool ReadOneIPFrom(const char* ipfname, char* ipstr); +#endif bool ReadDefaultRemoteServer(); bool ReadDefaultRemotePort(); bool ReadDefaultMbedIP(); @@ -714,7 +718,9 @@ b = SnBitUtils::WriteTo(b, fMbedMask, kIPLen); b = SnBitUtils::WriteTo(b, fMbedGate, kIPLen); b = SnBitUtils::WriteTo(b, fWatchDogPeriod); - b = SnBitUtils::WriteTo(b, fTempCheckPeriod); + if (kIOVers>9) { + b = SnBitUtils::WriteTo(b, fTempCheckPeriod); + } #if CHIPBOARD==ATWD4CH if (kIOVers<9) { if (fStreamHiLoPlas!=0) { @@ -736,10 +742,14 @@ void Reset() { memset(fLabel, 0, sizeof(char)*kConfLblLen); SetHardDefaults(); +#ifdef USE_INTERFACE_CHIP if (ReadFromFile(kDefConfFile)==false) { // couldn't get default. use hardcoded version. + // (reset in case a few parameters from the file + // got assigned) SetHardDefaults(); } +#endif #ifdef DEBUG printf("config reset to %s\r\n",fLabel); #endif