19 #define MFC3045_CPP_DRIVER_BCD_VERSION 0x0100
25 namespace Instrument {
35 U32 m_WaitTimeRdData_ms;
36 bool m_AbortSerialTransfert;
52 bool l_ClearHostSerialBufferRxTx();
53 bool l_GetNewDataRxBufferLength(U32 & rRxBufferLength);
54 bool l_WaitAvailableDataRX(
const U32 & rTimeoutRx, U32 & rRXBufferLength,
const bool & rErrorOnTimoute=
true);
55 bool l_ExtractSmaMsgFromDataRX(
const std::string & rNewRxBufferStrIn,
uSMAByte & rSMAValue, std::string & rNewRxBufferStrOut);
57 bool l_Write(
const std::string & rWriteStr,
const bool & rForceWrite=
false);
58 bool l_ReadString(std::string & rRxBufferStr,
const U8 & rNStringAssembly=1,
const bool & rCheckSmaMsg=
false);
59 bool l_ReadNCharNoTerm(
CVISABuffer & rReadBuffer,
const U16 & rReadNChar);
62 bool l_DateStrToDateTimeUtc(
const std::string & rUtcDateStr, std::time_t & rUtcDateTime);
63 bool l_DateTimeToDateStrUtc(
const std::time_t & rUtcDateTime, std::string & rUtcDateStr);
84 bool CheckInstrumentConnection(
const U8 & rl_Retry = 3);
86 bool DisconnectInstrument();
98 bool ReadWithCustomCmd(
const std::string & rCommandStr, std::string & rRegValStr);
99 void GetCurrentTimeoutRdDataMs(U32 & rRdDataTimeout_ms);
110 bool ParseParmFromRSP(
const U16 & rParmRSPSettings,
sSerialPortSettings & rSerialSettings);
111 bool SerialRSPSet(
const U16 & rRegVal);
112 bool SerialRSPGet(U16 & rRegVal);
125 bool SystemResetSet();
127 bool VersionGet(std::string & rVersionInfo, F32 & rFwVersion);
128 bool VersionGet(std::string & rVersionInfo, F32 & rFwVersion,
const eWhoVersion & rSelect);
130 bool SerialNumberGet(std::string & rSerialNum);
131 bool SerialNumberGet(std::string & rSerialNum,
const eWhoSerialNum & rSelect);
136 bool DdsFrequencySet(
const U32 & rRegVal);
137 bool DdsFrequencyGet(U32 & rRegVal);
139 bool FrequencySweepSet(
const eSweepFreqMode & rSweepMode,
const U32 & rFreqStepVal =0);
141 bool FrequencySweepShiftSet(
const eShiftFreq & rShiftDirection);
151 bool StatusGet(
const std::vector<eStatusRegister> & rStatRegSel, std::vector<U8> & rStatus);
152 bool LastCmdErrorGet(std::string & rCmdError);
153 bool SMAGet(U8 & rRegVal);
157 bool l_SMASet(
const U8 & rRegVal);
168 bool ModulationAmplitudeSet(
const U32 & rRegVal);
169 bool ModulationAmplitudeGet(U32 & rRegVal);
171 bool ModulationCentralFreqSet(
const U32 & rRegVal);
172 bool ModulationCentralFreqGet(U32 & rRegVal);
174 bool ModulationLowestFreqSet(
const U32 & rRegVal);
175 bool ModulationLowestFreqGet(U32 & rRegVal);
177 bool ModulationHighestFreqSet(
const U32 & rRegVal);
178 bool ModulationHighestFreqGet(U32 & rRegVal);
183 bool ModulationPeriodSet(
const U16 & rRegVal);
184 bool ModulationPeriodGet(U16 & rRegVal);
186 bool ModulationNumberStepRampGet(U32 & rRegVal);
188 bool ModulationNumberStepPlateauGet(U32 & rRegVal);
190 bool DdsBitResolutionGet(U32 & rRegVal);
191 bool DdsBitResolutionFdhzGet(F32 & rDdsResolutionFdhz);
201 bool NumberMeasCycleSet(
const U16 & rRegVal);
202 bool NumberMeasCycleGet(U16 & rRegVal);
204 bool NumberPreCycleSet(
const U16 & rRegVal);
205 bool NumberPreCycleGet(U16 & rRegVal);
207 bool TimePreCycleSet(
const U16 & rRegVal);
208 bool TimePreCycleGet(U16 & rRegVal);
210 bool RejectionOffsetSet(
const U16 & rRegVal);
211 bool RejectionOffsetGet(U16 & rRegVal);
213 bool RejectionGapSet(
const U16 & rRegVal);
214 bool RejectionGapGet(U16 & rRegVal);
216 bool TimeVsPrecisionSet(
const ePrecision & rRegVal);
217 bool TimeVsPrecisionGet(
ePrecision & rRegVal);
228 bool MeasCycleStart();
229 bool MeasCycleStart(
const U8 & rProbeSel);
230 bool MeasStartWithSMA();
231 bool MeasStartWithSMA(
const U8 & rProbeSel);
232 bool WaitSmaMeasureDataReady(
const U32 & rMeasWaitTimeout_ms,
uSMAByte & rDataReady);
236 bool SearchStart(
const U8 & rProbeSel);
237 bool SearchStartWithSMA();
238 bool SearchStartWithSMA(
const U8 & rProbeSel);
240 bool ContinuousMeasStart();
252 bool l_ReadEndTransmissionBlockChar();
253 bool l_ReadMeasurementTableBlock(
const std::string rStringCMD, std::vector<U32> & rData);
257 bool DataBlockModeDecimalSet();
261 bool DataMagneticFieldGet(
const U8 & rNbMeasurements, std::vector<U32> & rData);
262 bool DataMagneticFieldGet(U32 & rData,
const U8 & rProbeSel);
264 bool DataStdDeviationGet(
const U8 & rNbMeasurements, std::vector<U32> & rData);
265 bool DataStdDeviationGet(U32 & rData,
const U8 & rProbeSel);
267 bool DataNumberValidCycleGet(
const U8 & rNbMeasurements, std::vector<U32> & rData);
268 bool DataNumberValidCycleGet(U32 & rData,
const U8 & rProbeSel);
270 bool DataIndividualFrequencyGet(U32 & rDataUp, U32 & rDataDown);
272 bool DataCentralFrequencyGet(U32 & rData);
274 bool DataLowestFrequencyGet(U32 & rData);
276 bool DataHighestFrequencyGet(U32 & rData);
278 bool DataDifferenceFrequencyGet(U32 & rData);
288 bool NumberProbesSet(
const U8 & rRegVal);
289 bool NumberProbesGet(U8 & rRegVal);
291 bool PaCentralFreqSet(
const U32 & rRegVal);
292 bool PaCentralFreqGet(U32 & rRegVal);
294 bool PaLowestFreqSet(
const U32 & rRegVal);
295 bool PaLowestFreqGet(U32 & rRegVal);
297 bool PaHighestFreqSet(
const U32 & rRegVal);
298 bool PaHighestFreqGet(U32 & rRegVal);
300 bool RfHarmonicSet(
const eRFH & rRegVal);
301 bool RfHarmonicGet(
eRFH & rRegVal);
303 bool NmrThresholdSet(
const U8 & rRegVal);
304 bool NmrThresholdGet(U8 & rRegVal);
314 bool MainUnitEepromWrite();
315 bool MainUnitEepromRead(std::vector<char> & rEEPROMContent);
317 bool ProbeArrayEepromWrite();
318 bool ProbeArrayEepromRead(std::vector<char> & rEEPROMContent);
327 bool CalibrationProbeMeasurementSet(
const U8 & rProbeSel);
328 bool CalibrationProbeMeasurementTableClear();
329 bool CalibrationProbeMeasurementTableGet(
const U8 & rNbMeasurements, std::vector<U32> & rData);
330 bool CalibrationMeasurementAverageProbeGet(U32 & rData);
332 bool CalibrationBuildTableCopyEEPROMToRAM();
333 bool CalibrationBuildTableClearRAM();
334 bool CalibrationBuildTableWithTargetSet(
const U32 & rTarget);
335 bool CalibrationBuildTableGet(
const U8 & rNbMeasurements, std::vector<I32> & rData);
336 bool CalibrationBuildProbeGet(I32 & rData,
const U8 & rProbeSel);
338 bool CalibrationEditTableSet(
const I32 & rData);
339 bool CalibrationEditTableSet(
const I32 & rData,
const U8 & rProbeSel);
340 bool CalibrationEditTableGetProbePointed(U8 & rProbeIdxCET);
343 bool CalibrationDatePASet(
const U8 & rDayDD,
const U8 & rMonthMM,
const U8 & rYearYY,
const bool & rSaveInEeprom =
false);
344 bool CalibrationDatePASet(
const std::time_t & rUtcDate,
const bool & rSaveInEeprom =
false);
345 bool CalibrationDatePAGet(std::string & rStrDate, std::time_t & rUtcDate);
347 bool CalibrationDateMUSet(
const U8 & rDayDD,
const U8 & rMonthMM,
const U8 & rYearYY,
const bool & rSaveInEeprom =
false);
348 bool CalibrationDateMUSet(
const std::time_t & rUtcDate,
const bool & rSaveInEeprom =
false);
349 bool CalibrationDateMUGet(std::string & rStrDate, std::time_t & rUtcDate);