Looking for hints on DC import debugging

Lutz Vieweg lvml at 5t9.de
Mon Dec 30 14:17:07 UTC 2013


On 12/30/2013 11:12 PM, Dirk Hohndel wrote:
> dive-cb() never being called us your real problem. If that isn't called, we don't get dives

Ouch. I think I got it:

> 	if (data->libdc_dump) {
> 		dc_buffer_t *buffer = dc_buffer_new (0);
>
> 		rc = dc_device_dump (device, buffer);
> 		if (rc == DC_STATUS_SUCCESS) {
> 			FILE* fp = subsurface_fopen(dumpfile_name, "wb");
> 			if (fp != NULL) {
> 				fwrite (dc_buffer_get_data (buffer), 1, dc_buffer_get_size (buffer), fp);
> 				fclose (fp);
> 			}
> 		}
>
> 		dc_buffer_free (buffer);
> 	} else {
> 		rc = dc_device_foreach(device, dive_cb, data);
> 	}

Obviously, if data->libdc_dump != 0, then
dc_device_foreach(device, dive_cb, data) is never called.

So by trying to collect useful information on the problem, enabling the
dump, I inadvertedly disabled using the data at all.

The few cases where the newer version actually worked must have been 
ones where I did _not_ activate the dump.

If that is intentional, please warn people that "dumping" is mutually 
exclusive with "using" the data from the DC...

Regards,

Lutz Vieweg


More information about the subsurface mailing list