mirror of
https://github.com/3cky/mbusd.git
synced 2024-09-26 03:43:04 +02:00
Make use of baudrate 0 as indicator of default baudrate, show error when trying to use unsupported baudrate
This commit is contained in:
parent
965ff443c8
commit
d24b257c13
@ -61,7 +61,7 @@ cfg_init(void)
|
||||
strncpy(cfg.logname, LOGNAME, INTBUFSIZE);
|
||||
#endif
|
||||
strncpy(cfg.ttyport, DEFAULT_PORT, INTBUFSIZE);
|
||||
cfg.ttyspeed = DEFAULT_SPEED;
|
||||
cfg.ttyspeed = 0;
|
||||
strncpy(cfg.ttymode, DEFAULT_MODE, INTBUFSIZE);
|
||||
#ifdef TRXCTL
|
||||
cfg.trxcntl = TRX_ADDC;
|
||||
|
@ -201,7 +201,7 @@ tty_transpeed(int speed)
|
||||
switch (speed)
|
||||
{
|
||||
case 0:
|
||||
tspeed = B0;
|
||||
tspeed = DEFAULT_BSPEED;
|
||||
break;
|
||||
#if defined(B50)
|
||||
case 50:
|
||||
@ -312,8 +312,8 @@ tty_transpeed(int speed)
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
tspeed = DEFAULT_BSPEED;
|
||||
break;
|
||||
logw(2, "unsupported baudrate (%d)", speed);
|
||||
exit (-1);
|
||||
}
|
||||
return tspeed;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user