mirror of
https://github.com/n5ac/smartsdr-dsp.git
synced 2026-02-06 23:24:17 +01:00
CID12153 - Make sure we get a correct serial descriptor on startup if not loop until we do
This commit is contained in:
parent
a3e918ee32
commit
eda34ee255
|
|
@ -568,8 +568,13 @@ void thumbDV_init(const char * serial_device_name, int * serial_fd)
|
|||
pthread_rwlock_unlock(&_decoded_list_lock);
|
||||
|
||||
|
||||
|
||||
*serial_fd = thumbDV_openSerial("/dev/ttyUSB0");
|
||||
do {
|
||||
*serial_fd = thumbDV_openSerial("/dev/ttyUSB0");
|
||||
if ( *serial_fd < 0 ) {
|
||||
output("Could not open serial. Waiting 1 second before trying again.\n");
|
||||
usleep(1000 * 1000);
|
||||
}
|
||||
} while ( *serial_fd < 0 ) ;
|
||||
|
||||
unsigned char reset[5] = { 0x61, 0x00, 0x01, 0x00, 0x33 };
|
||||
thumbDV_writeSerial(*serial_fd, reset, 5);
|
||||
|
|
|
|||
Loading…
Reference in a new issue