1DC_PARSER_SAMPLES_FOR... BSD Library Functions Manual DC_PARSER_SAMPLES_FOR...
2

NAME

4     dc_parser_samples_foreach — iterate over samples taken during a dive
5

LIBRARY

7     library “libdivecomputer”
8

SYNOPSIS

10     #include <libdivecomputer/parser.h>
11
12     typedef void
13     (*dc_sample_callback_t)(dc_sample_type_t type, dc_sample_value_t value,
14         void *userdata);
15
16     dc_status_t
17     dc_parser_samples_foreach(dc_parser_t *parser,
18         dc_sample_callback_t callback, void *userdata);
19

DESCRIPTION

21     Extract the samples taken during a dive as previously initialised with
22     dc_parser_set_data(3).  Each sample is passed to callback with the type
23     of the sample and its data value.
24
25     Samples are invoked as a sequence of sample sets.  Each sequence begins
26     with a DC_SAMPLE_TIME, then a number of sample types in the set.  When
27     the next DC_SAMPLE_TIME is recorded, the sample set may be closed and a
28     new one reopened.  After all samples have been rendered, the last sample
29     set should be closed.
30
31     The following sample types may be raised:
32
33     DC_SAMPLE_TIME
34             The time of the sample taken in seconds after the dive began.
35             Set in the time field.
36
37     DC_SAMPLE_DEPTH
38             The depth taken at the sample in metres.  Set in the depth field.
39
40     DC_SAMPLE_PRESSURE
41             Tank pressure taken at the sample.  Sets the tank index (see the
42             DC_FIELD_TANK_COUNT in dc_parser_get_field(3)) and the pressure
43             in bar.
44
45     DC_SAMPLE_TEMPERATURE
46             Temperature in celsius.  Sets the temperature field.
47
48     DC_SAMPLE_EVENT
49             An diving event raised by the computer.  This may have the type
50             value of the event structure set to SAMPLE_EVENT_NONE,
51             SAMPLE_EVENT_DECOSTOP, SAMPLE_EVENT_RBT, SAMPLE_EVENT_ASCENT,
52             SAMPLE_EVENT_CEILING, SAMPLE_EVENT_WORKLOAD,
53             SAMPLE_EVENT_TRANSMITTER, SAMPLE_EVENT_VIOLATION,
54             SAMPLE_EVENT_BOOKMARK, SAMPLE_EVENT_SURFACE,
55             SAMPLE_EVENT_SAFETYSTOP, SAMPLE_EVENT_SAFETYSTOP_VOLUNTARY,
56             SAMPLE_EVENT_SAFETYSTOP_MANDATORY, SAMPLE_EVENT_DEEPSTOP,
57             SAMPLE_EVENT_CEILING_SAFETYSTOP, SAMPLE_EVENT_FLOOR,
58             SAMPLE_EVENT_DIVETIME, SAMPLE_EVENT_MAXDEPTH, SAMPLE_EVENT_OLF,
59             SAMPLE_EVENT_PO2, SAMPLE_EVENT_AIRTIME, SAMPLE_EVENT_RGBM,
60             SAMPLE_EVENT_HEADING, or SAMPLE_EVENT_TISSUELEVEL.
61
62     DC_SAMPLE_RBT
63             The remaining bottom time in seconds.  Sets the rbt field.
64
65     DC_SAMPLE_HEARTBEAT
66             The diver's heartbeet in beats per minute.  Sets the heartbeat
67             field.
68
69     DC_SAMPLE_BEARING
70             The diver's bearing in degrees.  Sets the bearing field.
71
72     DC_SAMPLE_VENDOR
73             A vendor-specific data field.
74
75     DC_SAMPLE_SETPOINT
76             The closed-circuit setpoint (PO2) has changed.  Sets the setpoint
77             value in bar.
78
79     DC_SAMPLE_PPO2
80             The partial pressure of oxygen has changed (in bar).  Sets the
81             ppo2 field.
82
83     DC_SAMPLE_CNS
84             The CNS (central nervous system oxygen toxicity) value as a unit
85             fraction.  Sets the cns value.
86
87     DC_SAMPLE_DECO
88             Decompression phase of type DC_DECO_NDL (no decompression limit),
89             DC_DECO_SAFETYSTOP (the safety stop), DC_DECO_DECOSTOP (a
90             decompression stop), or DC_DECO_DEEPSTOP (a mandatory or
91             suggested deep-stop).  Also sets the depth in metres and the time
92             in seconds.
93
94     DC_SAMPLE_GASMIX
95             Switch to a given gas mix index (see the DC_FIELD_GASMIX_COUNT in
96             dc_parser_get_field(3)).  Sets the gasmix field.
97

RETURN VALUES

99     Returns DC_STATUS_OK on success and another code on failure.
100

SEE ALSO

102     dc_parser_set_data(3)
103

AUTHORS

105     The library “libdivecomputer” library was written by Jef Driesen,
106     jef@libdivecomputer.org.  The manpages were written by
107     Kristaps Dzonsons, kristaps@bsd.lv.
108
109BSD                             January 5, 2017                            BSD
Impressum