Make sure 8-bit connection is open in both directions.

This commit is contained in:
Chris Osborn 2016-06-16 14:43:27 -07:00
parent 9bf371d40b
commit 321b2ff260
2 changed files with 6 additions and 4 deletions

View File

@ -77,8 +77,7 @@ int line_connect(modem_config *cfg)
char *addy = cfg->dialno; char *addy = cfg->dialno;
/* Reset everything we know about the line, it may not be the same /* Reset everything we know about the line, it may not be the same as last time. */
as last time. */
line_init_config(cfg); line_init_config(cfg);
LOG(LOG_INFO, "Connecting"); LOG(LOG_INFO, "Connecting");
@ -97,9 +96,12 @@ int line_connect(modem_config *cfg)
send_nvt_command(cfg->line_data.fd, &cfg->line_data.nvt_data, NVT_WILL, NVT_OPT_ECHO); send_nvt_command(cfg->line_data.fd, &cfg->line_data.nvt_data, NVT_WILL, NVT_OPT_ECHO);
/* If space parity is detected treat it as 8 bit and try to enable binary mode */ /* If space parity is detected treat it as 8 bit and try to enable binary mode */
if (!cfg->parity) if (!cfg->parity) {
send_nvt_command(cfg->line_data.fd, &cfg->line_data.nvt_data, send_nvt_command(cfg->line_data.fd, &cfg->line_data.nvt_data,
NVT_WILL, NVT_OPT_TRANSMIT_BINARY); NVT_WILL, NVT_OPT_TRANSMIT_BINARY);
send_nvt_command(cfg->line_data.fd, &cfg->line_data.nvt_data,
NVT_DO, NVT_OPT_TRANSMIT_BINARY);
}
return 0; return 0;
} }
else { else {