dc_parser_get_field(3)
| DC_PARSER_GET_FIELD(3) | Library Functions Manual | DC_PARSER_GET_FIELD(3) |
NAME
dc_parser_get_field —
extract a field from a parsed dive
LIBRARY
library “libdivecomputer”
SYNOPSIS
#include
<libdivecomputer/parser.h>
dc_status_t
dc_parser_get_field(dc_parser_t
*parser, dc_field_type_t type,
unsigned int flags, void
*value);
DESCRIPTION
Extract a field from a dive, parser,
previously initialised with
dc_parser_new(3). The
value field type depends upon the
type. The flags field is ignored
for all types but DC_FIELD_GASMIX and
DC_FIELD_TANK.
The type may be one of the following values:
DC_FIELD_DIVETIME- Time (duration) of dive in seconds. The value must be an unsigned int.
DC_FIELD_MAXDEPTH- Maximum depth in metres. The value must be a double.
DC_FIELD_AVGDEPTH- Average depth (over all samples) in metres. The value must be a double.
DC_FIELD_GASMIX_COUNT- Number of different gas mixes used in this dive. The value must be a unsigned int.
DC_FIELD_GASMIX- Mixture for a particular gas. The value must be a
dc_gasmix_t, which has double
fields for oxygen, helium, and
nitrogen. These are set to the unit fraction of gas
(not percentage). The flags value is interpreted as
the gas mixture index, which must be less than the value of
DC_FIELD_GASMIX_COUNT. DC_FIELD_SALINITY- The water salinity as a dc_salinity_t field, which
consists of a type,
DC_WATER_FRESHorDC_WATER_SALT, and the salinity density. DC_FIELD_ATMOSPHERIC- Atmospheric pressure in bar. The value field must be a double.
DC_FIELD_TEMPERATURE_SURFACE- Air temperature (at the surface) in Celsius. The value field must be a double.
DC_FIELD_TEMPERATURE_MINIMUM- Minimum water temperature surface in Celsius. The value field must be a double.
DC_FIELD_TEMPERATURE_MAXIMUM- Maximum water temperature in Celsius. The value field must be a double.
DC_FIELD_TANK_COUNT- The number of tanks as an unsigned int.
DC_FIELD_TANK- Tank configuration as a dc_tank_t. This structure
consists of a gasmix, which may be retrieved with
DC_FIELD_GASMIX; type, the tank volume units asDC_TANKVOLUME_NONE,DC_TANKVOLUME_IMPERIAL, orDC_TANKVOLUME_METRIC; volume, the tank volume in litres or zero if the tank isDC_TANKVOLUME_NONE; workpressure, the work pressure in bar or zero ifDC_TANKVOLUME_NONEand maybe zero ifDC_TANKVOLUME_METRIC; beginpressure and endpressure being the pressures at start and finish in bar. The flags value is the tank index. DC_FIELD_DIVEMODE- Mode of the dive:
DC_DIVEMODE_FREEDIVEfor free-diving,DC_DIVEMODE_GAUGEfor gauge (i.e., running as a record and not computing, say, decompression events),DC_DIVEMODE_OCfor standard open-circuit diving, andDC_DIVEMODE_CCRandDC_DIVEMODE_SCRfor respectively closed circuit and semi closed circuit “rebreather” diving.
RETURN VALUES
Returns DC_STATUS_SUCCESS if the field was
retrieved, DC_STATUS_UNSUPPORTED if the field is not
supported by the device, or other error messages on further failure.
SEE ALSO
AUTHORS
The library
“libdivecomputer” library was written by
Jef Driesen,
jef@libdivecomputer.org.
The manpages were written by
Kristaps Dzonsons,
kristaps@bsd.lv.
| January 5, 2017 | Linux 6.12.85-6.12-alt1 |
