|DCMD(1)||General Commands Manual||DCMD(1)|
dcmdutility downloads recent dives from a dive computer on a serial (or USB) device (defaulting to /dev/ttyU0) and converts them to a regular XML output format on standard output. The arguments are as follows:
-n. The range is in the format of
[start[/end]]. If empty, shows only the current day. If just the start, shows the full start day. If the start is empty (and just the range end), shows from the beginning of time to the end. The start and end format is
-mif there are multiple vendor/product pairs with the same name.
-swas not specified), the dive computer connected to device is opened and its contents downloaded and formatted as XML. Be careful: many dive computers don't charge when connected to a computer. Plug it in, suck down your data, and unplug it as soon as possible. The last-seen fingerprint is stored in ~/.divecmd/DEVICE, where “DEVICE” is the dive computer device name and diver identifier rendered as a filename, for example, ~/.divecmd/suunto_d6i-26_kristaps (vendor, product, model, diver). It is used to get (and/or initialise) and set the last known dive. This suppresses old dives from being re-downloaded every time
dcmdis invoked. The DEVICE file is a binary fingerprint. The
-nflags restrict usage of this file. If ~/.divecmd does not exist, it is created.
dcmdoutputs an XML file describing the dive. In this description, attributes offset by brackets (“[” and “]”) are optional. Optional elements are specifically marked as such. Values with “xxx” are floating-point, “nnn” are integral, “ss” are integral seconds, and “uuu” are unit-interval floating point. All units are metric. Note: this format may change as the tool progresses, my diving progresses, and I acquire more dive computers. If you want good support, send me diving with a new computer! The XML output is arranged as follows, with comments inline:
<?xml version="1.0" encoding="UTF-8" ?> <divelog program="dcmd" version="0.0.1" vendor="zzzz" product="zzzz" model="nnn" [diver="zzzz"]> <dives>
-i) and the software version. Now begins the dives. There may be multiple dives, which is often the case with free-diving or any time multiple dives have been exported.
<dive number="n" [date="yyyy-mm-dd" time="hh:mm:ss"] [duration="ss"] [mode="YYYY"]>
gauge(recorded directly from a tank gauge),
opencircuit(open-circuit standard diving), or
<gasmixes> <gasmix num="NNN" [o2="xxx"] [n2="xxx"] [he="xxx"] /> </gasmixes>
<tanks> <tank num="nnn" [gasmix="nnn"] [volume="xxx" [workpressure="xxx"]] beginpressure="xxx" endpressure="xxx" /> </tanks>
<depth [max="xxx"] [mean="xxx"] />
<samples> <sample time="ss"> [<rbt value="ss" />] [<vendor type="nnn">[value]</vendor>] [<depth value="xxx" />] [<temp value="xxx" />] [<pressure value="xxx" tank="nnn" />] [<deco [depth="xxx"] type="zzz" [duration="ss"] />] [<gaschange mix="nnn" />] [<cns value="xxx" />] [<event type="event" [duration="ss"] [flags="ss"] />] </sample> </samples>
pressurefor different tanks.
type. If the given event consists of no data, it will simply be a self-closed XML tag. Otherwise, it will consist of rows of 16 bytes of hexadecimally encoded byte values, e.g., “hello” in ASCII being “68656C6C6F”.
<tanks>section. If there is no
<tanks>section, the referenced tank consists only of default values, e.g.,
<tanks><tank num="NNN" /></tanks>.
mixcorresponding to the
<gasmix num="nnn">in the
<gasmixes>set for the dive. For historical reasons, the identifier of the gas mixture is one less than the
typeattribute may be one of “ndl”, for non-decompression limit time remaining; “safetystop”; “decostop”; or “deepstop”. Duration is in seconds. Decompression notices are suppressed when in freediving mode. The “ndl” type ignores the depth attribute, if specified. All types may omit the
depth, in which case this is simply an indicator of state. While in a deco or deep stop, the
typeof deco (or deep) will be continuously emitted for each sample. The end of the stop may be inferred by a “ndl” or “safetystop”, or simply by the non-existence of the prior deco type.
typeset to one of “none”, “decostop”, “rbt”, “ascent”, “ceiling”, “workload”, “transmitter”, “violation”, “bookmark”, “surface”, “safetystop”, “gaschange”, “safetystop_voluntary”, “safetystop_mandatory”, “deepstop”, “ceiling_safetystop”, “floor”, “divetime”, “maxdepth”, “olf”, “po2”, “airtime”, “rgbm”, “heading”, “tissuelevel”, or “gaschange2”. The
flagsmay optionally be set to “1” or “2”, meaning that the condition has begun or ended, respectively. The exception to this is “gaschange2”, which optionally sets
flagsto the new mixture (starting at zero).
<depth>element is specified for all samples, but of course this isn't guaranteed.)
</dive> </dives> </divelog>
dcmdutility exits 0 on success, and >0 if an error occurs.
dcmdutility was forked by Kristaps Dzonsons, firstname.lastname@example.org, from the exemplar utility bundled with libdivecomputer(3), written by
|October 18, 2018||OpenBSD 6.3|