agilent-dmm: Correctly parse negative overload.
This commit is contained in:
parent
e6284bf09f
commit
f216eb8699
|
@ -234,6 +234,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
|
||||||
struct sr_datafeed_packet packet;
|
struct sr_datafeed_packet packet;
|
||||||
struct sr_datafeed_analog analog;
|
struct sr_datafeed_analog analog;
|
||||||
float fvalue;
|
float fvalue;
|
||||||
|
const char *s;
|
||||||
char *mstr;
|
char *mstr;
|
||||||
|
|
||||||
sr_spew("FETC reply '%s'.", g_match_info_get_string(match));
|
sr_spew("FETC reply '%s'.", g_match_info_get_string(match));
|
||||||
|
@ -245,7 +246,8 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
|
||||||
* get metadata soon enough. */
|
* get metadata soon enough. */
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
|
|
||||||
if (!strcmp(g_match_info_get_string(match), "+9.90000000E+37")) {
|
s = g_match_info_get_string(match);
|
||||||
|
if (!strcmp(s, "-9.90000000E+37") || !strcmp(s, "+9.90000000E+37")) {
|
||||||
/* An invalid measurement shows up on the display as "O.L", but
|
/* An invalid measurement shows up on the display as "O.L", but
|
||||||
* comes through like this. Since comparing 38-digit floats
|
* comes through like this. Since comparing 38-digit floats
|
||||||
* is rather problematic, we'll cut through this here. */
|
* is rather problematic, we'll cut through this here. */
|
||||||
|
|
Loading…
Reference in New Issue