diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-11-21 17:14:16 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-11-21 17:14:16 +0000 |
commit | 90c6e3b262803c6035acd277bbbed29a38e97248 (patch) | |
tree | 146a4e26de41f5229cc7300aa0a99b4c89d641c4 /tools | |
parent | 4fce7d7b935d55219c999bc5bbd2ac02c516b0e1 (diff) | |
download | drakx-backup-do-not-use-90c6e3b262803c6035acd277bbbed29a38e97248.tar drakx-backup-do-not-use-90c6e3b262803c6035acd277bbbed29a38e97248.tar.gz drakx-backup-do-not-use-90c6e3b262803c6035acd277bbbed29a38e97248.tar.bz2 drakx-backup-do-not-use-90c6e3b262803c6035acd277bbbed29a38e97248.tar.xz drakx-backup-do-not-use-90c6e3b262803c6035acd277bbbed29a38e97248.zip |
alter detection sequence to better follow the standard, thus enabling
to detection MGE UPS connected through serial ports
Diffstat (limited to 'tools')
-rw-r--r-- | tools/serial_probe/serial.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/serial_probe/serial.c b/tools/serial_probe/serial.c index 0bedd0fd0..9ae3924c3 100644 --- a/tools/serial_probe/serial.c +++ b/tools/serial_probe/serial.c @@ -309,7 +309,7 @@ static int init_pnp_com_seq1( int fd ) { /* Wait for response, 1st phase */ modem_lines |= TIOCM_RTS; set_serial_lines(fd, modem_lines); - usleep(200000); + /* usleep(200000); => AQ: not valid as we should look to receive data during this time!! */ return rc; } @@ -336,7 +336,7 @@ static int init_pnp_com_seq2( int fd ) { /* turn on DTR and RTS */ modem_lines |= (TIOCM_DTR | TIOCM_RTS); set_serial_lines(fd, modem_lines); - usleep(200000); + /* usleep(200000); => AQ: not valid as we should look to receive data during this time!! */ return rc; } @@ -646,8 +646,11 @@ static int read_pnp_string( int fd, unsigned char *pnp_string, int *pnp_len, int done = 1; } pnp_string[pnp_index] = 0; - *pnp_len=pnp_index; - return PNP_COM_OK; + *pnp_len=pnp_index; + if(*pnp_len > 0) + return PNP_COM_OK; + else /* allows to call seq2 to be conformant */ + return PNP_COM_FAIL; } /* parse the PnP ID string into components */ |