Fixed obtaining the baudrate and hardware flow from the configuration file
This commit is contained in:
parent
44b7b4e1db
commit
ce96b959b7
@ -1937,13 +1937,13 @@ static int _reset_configure(Hayes * hayes, char const * device, int fd)
|
|||||||
char const * p;
|
char const * p;
|
||||||
|
|
||||||
/* baud rate */
|
/* baud rate */
|
||||||
if((p = helper->config_get(helper->modem, "baudrate")) == 0
|
if((p = helper->config_get(helper->modem, "baudrate")) == NULL
|
||||||
|| strtoul(p, NULL, 10) == 0)
|
|| (baudrate = strtoul(p, NULL, 10)) == 0)
|
||||||
baudrate = 115200;
|
baudrate = 115200;
|
||||||
baudrate = _reset_configure_baudrate(hayes, baudrate);
|
baudrate = _reset_configure_baudrate(hayes, baudrate);
|
||||||
/* hardware flow */
|
/* hardware flow */
|
||||||
if((p = helper->config_get(helper->modem, "hwflow")) == 0
|
if((p = helper->config_get(helper->modem, "hwflow")) == NULL
|
||||||
|| strtoul(p, NULL, 10) == 0)
|
|| (hwflow = strtoul(p, NULL, 10)) != 0)
|
||||||
hwflow = 1;
|
hwflow = 1;
|
||||||
if(flock(fd, LOCK_EX | LOCK_NB) != 0)
|
if(flock(fd, LOCK_EX | LOCK_NB) != 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -2024,7 +2024,7 @@ static unsigned int _reset_configure_baudrate(Hayes * hayes,
|
|||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
error_set("%u%s%u%s", baudrate,
|
error_set("%u%s%u%s", baudrate,
|
||||||
"Unsupported baudrate (using ",
|
": Unsupported baudrate (using ",
|
||||||
115200, ")");
|
115200, ")");
|
||||||
hayes->helper->error(NULL, error_get(), 1);
|
hayes->helper->error(NULL, error_get(), 1);
|
||||||
return B115200;
|
return B115200;
|
||||||
|
Loading…
Reference in New Issue
Block a user