Subsurface looping at end of download from DC

Patrick Valsecchi patrick at
Mon Oct 14 23:41:05 UTC 2013

Here is how subsurface gets the surface pressure from the DC:
     double surface_pressure = 1.0;
     rc = dc_parser_get_field(parser, DC_FIELD_ATMOSPHERIC, 0, 
         dev_info(devdata, translate("gettextFromC","Error obtaining 
surface pressure"));
         return rc;
     dive->dc.surface_pressure.mbar = surface_pressure * 1000.0 + 0.5;

So looks like you need to return the pressure as a double in bar from 

On 10/15/2013 08:34 AM, Tim Wootton wrote:
> On 15/10/13 06:31, Dirk Hohndel wrote:
>> Oh, this reminds me. For reasons that are a bit to silly to explain in
>> much detail... while we STORE all pressures in mbar as an int, when
>> calling any of the deco functions (so deco_allowed_depth, etc), the
>> pressure is given in bar as double...
>> yes, we should probably change that, but that's what it is currently
>> expecting... is this maybe the issue at hand?
> So what units does subsurface expect from libdivecomputer? The
> libdivecompter patch I put in to support surface pressure on my DC
> returns mbar is that wrong? Should it be bar?

More information about the subsurface mailing list