Hi Vincent,

On Samstag, 11. November 2017 09:26:55 CET vavincavent wrote:
> Can we begin to make a new entry for this computer in libdivecomputer
> library? (scubapro_square.c and scubapro_square.h but i think it's not
> just this...)

Actually it's much simpler. You'd add an entry to the descriptor.c file. But 
this does not seem to be your problem anyway.

To test Linus' stupid-firmware theory (which sounds unlikely to me), you could 
try to apply the attached (and completely untested) patch to the 
libdivecomputer source that is automatically downloaded when building 
subsurface from github. Note that you have to "make install" libdivecomputer 
and than make subsurface. Then try again downloading as Scubapro G2 and 
inspect the log.

Berthold
diff --git a/src/scubapro_g2.c b/src/scubapro_g2.c
index 04a83a2..d4ca2b2 100644
--- a/src/scubapro_g2.c
+++ b/src/scubapro_g2.c
@@ -225,6 +225,13 @@ scubapro_g2_device_open(dc_device_t **out, dc_context_t *context, const char *na
 		goto error_free;
 	}
 
+	// Read the model number.
+	unsigned char cmd_model[1] = {0x10};
+	unsigned char res_model[1] = {0};
+	status = scubapro_g2_transfer (device, cmd_model, sizeof (cmd_model), res_model, sizeof (res_model));
+	if (status != DC_STATUS_SUCCESS)
+		goto error_free;
+
 	// Perform the handshaking.
 	status = scubapro_g2_handshake(device, model);
 	if (status != DC_STATUS_SUCCESS) {
_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to