In LP: #2029482 Matt Clark reports that pvget -M json doesn't print fields containing NaN values and generates an error "Error in monitor handler : yajl_gen_invalid_number" instead.
The simplest fix would be for the json formatter to just output json5 (available when pvDataCPP is built against 7.0.6.1 or later), in which case the patch I posted to the LP bug above implements that.
A possible alternative would be to add a separate -M json5 formatter option which enables the json5 option; properly supporting NaNs and Infinity in regular json would require converting them as strings.
In LP: #2029482 Matt Clark reports that
pvget -M json
doesn't print fields containing NaN values and generates an error "Error in monitor handler : yajl_gen_invalid_number" instead.The simplest fix would be for the json formatter to just output json5 (available when pvDataCPP is built against 7.0.6.1 or later), in which case the patch I posted to the LP bug above implements that.
A possible alternative would be to add a separate
-M json5
formatter option which enables the json5 option; properly supporting NaNs and Infinity in regular json would require converting them as strings.