mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Android: more FTDI debugging
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8b37e3f10e
commit
7cc9da6347
1 changed files with 8 additions and 2 deletions
|
@ -155,12 +155,14 @@ static dc_status_t serial_ftdi_open (void **io, dc_context_t *context)
|
||||||
// Allocate memory.
|
// Allocate memory.
|
||||||
ftdi_serial_t *device = (ftdi_serial_t *) malloc (sizeof (ftdi_serial_t));
|
ftdi_serial_t *device = (ftdi_serial_t *) malloc (sizeof (ftdi_serial_t));
|
||||||
if (device == NULL) {
|
if (device == NULL) {
|
||||||
|
INFO(0, "couldn't allocate memory");
|
||||||
SYSERROR (context, errno);
|
SYSERROR (context, errno);
|
||||||
return DC_STATUS_NOMEMORY;
|
return DC_STATUS_NOMEMORY;
|
||||||
}
|
}
|
||||||
INFO(0, "setting up ftdi_ctx");
|
INFO(0, "setting up ftdi_ctx");
|
||||||
struct ftdi_context *ftdi_ctx = ftdi_new();
|
struct ftdi_context *ftdi_ctx = ftdi_new();
|
||||||
if (ftdi_ctx == NULL) {
|
if (ftdi_ctx == NULL) {
|
||||||
|
INFO(0, "failed ftdi_new()");
|
||||||
free(device);
|
free(device);
|
||||||
SYSERROR (context, errno);
|
SYSERROR (context, errno);
|
||||||
return DC_STATUS_NOMEMORY;
|
return DC_STATUS_NOMEMORY;
|
||||||
|
@ -189,6 +191,7 @@ static dc_status_t serial_ftdi_open (void **io, dc_context_t *context)
|
||||||
return DC_STATUS_IO;
|
return DC_STATUS_IO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INFO(0, "call serial_ftdi_open_device");
|
||||||
if (serial_ftdi_open_device(ftdi_ctx) < 0) {
|
if (serial_ftdi_open_device(ftdi_ctx) < 0) {
|
||||||
free(device);
|
free(device);
|
||||||
ERROR (context, "%s", ftdi_get_error_string(ftdi_ctx));
|
ERROR (context, "%s", ftdi_get_error_string(ftdi_ctx));
|
||||||
|
@ -547,9 +550,12 @@ dc_status_t ftdi_open(dc_iostream_t **iostream, dc_context_t *context)
|
||||||
serial_ftdi_close, /* close */
|
serial_ftdi_close, /* close */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
INFO(device->contxt, "%s", "in ftdi_open");
|
||||||
rc = serial_ftdi_open(&io, context);
|
rc = serial_ftdi_open(&io, context);
|
||||||
if (rc != DC_STATUS_SUCCESS)
|
if (rc != DC_STATUS_SUCCESS) {
|
||||||
|
INFO(device->contxt, "%s", "serial_ftdi_open() failed");
|
||||||
return rc;
|
return rc;
|
||||||
|
}
|
||||||
|
INFO(device->contxt, "%s", "calling dc_custom_open())");
|
||||||
return dc_custom_open(iostream, context, DC_TRANSPORT_SERIAL, &callbacks, io);
|
return dc_custom_open(iostream, context, DC_TRANSPORT_SERIAL, &callbacks, io);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue