+ // Controlling the value for timeout:
+ // If set too high it blocks the reading (> 5 s), too low it gets not reading (< 500 us).
+ // To avoid any issues we replace "out of range" value by the default value.
+ if (
+ cgps_config_data.timeout > TIME_T_TO_CDTIME_T(5)
+ ||
+ cgps_config_data.timeout < US_TO_CDTIME_T(500)
+ )
+ {
+ WARNING ("gps plugin: timeout set to %.6f sec. setting to default (%.6f).",
+ CDTIME_T_TO_DOUBLE(cgps_config_data.timeout),
+ CDTIME_T_TO_DOUBLE(CGPS_DEFAULT_TIMEOUT)
+ );
+ cgps_config_data.timeout = CGPS_DEFAULT_TIMEOUT;
+ }
+