Skip to content
Snippets Groups Projects
Commit 0203737e authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Add new 3-wire (No RTS) connection type

This is for weird embedded systems where RTS is not supported by
the communications channel, but is actually controlling something
else (TX, Bootloader update mode, etc).
parent 77e624dd
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3374 passed
......@@ -248,6 +248,7 @@ static char *conn_type_help= "`Connection Type`\n\n"
"`SSH`..............: Connect using the Secure Shell (SSH-2) protocol\n"
"`Modem`............: Connect using a dial-up modem\n"
"`Serial`...........: Connect directly to a serial communications port\n"
"`3-wire (no RTS)`..: As with Serial, but lower RTS\n"
"`Shell`............: Connect to a local PTY (*nix only)\n"
"`MBBS GHost`.......: Communicate using the Major BBS 'GHost' protocol\n";
;
......@@ -980,7 +981,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
sprintf(opt[i++], "Name %s",itemname);
if(item->conn_type==CONN_TYPE_MODEM)
sprintf(opt[i++], "Phone Number %s",item->addr);
else if(item->conn_type==CONN_TYPE_SERIAL)
else if (item->conn_type == CONN_TYPE_SERIAL || item->conn_type == CONN_TYPE_SERIAL_NORTS)
sprintf(opt[i++], "Device Name %s",item->addr);
else if(item->conn_type==CONN_TYPE_SHELL)
sprintf(opt[i++], "Command %s",item->addr);
......@@ -1166,6 +1167,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
uifc.input(WIN_MID|WIN_SAV,0,0
,item->conn_type==CONN_TYPE_MODEM ? "Phone Number"
:item->conn_type==CONN_TYPE_SERIAL ? "Device Name"
:item->conn_type==CONN_TYPE_SERIAL_NORTS ? "Device Name"
:item->conn_type==CONN_TYPE_SHELL ? "Command"
: "Address"
,item->addr,LIST_ADDR_MAX,K_EDIT);
......@@ -1173,7 +1175,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
iniSetString(&inifile,itemname,"Address",item->addr,&ini_style);
break;
case 3:
if (item->conn_type == CONN_TYPE_MODEM || item->conn_type == CONN_TYPE_SERIAL) {
if (item->conn_type == CONN_TYPE_MODEM || item->conn_type == CONN_TYPE_SERIAL || item->conn_type == CONN_TYPE_SERIAL_NORTS) {
uifc.helpbuf = "`Flow Control`\n\n"
"Select the desired flow control type.\n"
"This should usually be left as \"RTS/CTS\".\n";
......@@ -1281,7 +1283,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
item->user[0] = 0;
}
if(item->conn_type!=CONN_TYPE_MODEM && item->conn_type!=CONN_TYPE_SERIAL
if(item->conn_type!=CONN_TYPE_MODEM && item->conn_type!=CONN_TYPE_SERIAL && item->conn_type != CONN_TYPE_SERIAL_NORTS
&& item->conn_type!=CONN_TYPE_SHELL
) {
/* Set the port too */
......@@ -2413,6 +2415,7 @@ struct bbslist *show_bbslist(char *current, int connected)
list[listcount-1]->conn_type++;
if(list[listcount-1]->conn_type!=CONN_TYPE_MODEM
&& list[listcount-1]->conn_type!=CONN_TYPE_SERIAL
&& list[listcount-1]->conn_type!=CONN_TYPE_SERIAL_NORTS
&& list[listcount-1]->conn_type!=CONN_TYPE_SHELL
) {
/* Set the port too */
......@@ -2434,6 +2437,7 @@ struct bbslist *show_bbslist(char *current, int connected)
uifc.input(WIN_MID|WIN_SAV,0,0
,list[listcount-1]->conn_type==CONN_TYPE_MODEM ? "Phone Number"
:list[listcount-1]->conn_type==CONN_TYPE_SERIAL ? "Device Name"
:list[listcount-1]->conn_type==CONN_TYPE_SERIAL_NORTS ? "Device Name"
:list[listcount-1]->conn_type==CONN_TYPE_SHELL ? "Command"
:"Address"
,list[listcount-1]->addr,LIST_ADDR_MAX,K_EDIT);
......
......@@ -47,8 +47,8 @@
#include "conn_telnet.h"
struct conn_api conn_api;
char *conn_types_enum[]={"Unknown","RLogin","RLoginReversed","Telnet","Raw","SSH","SSHNA","Modem","Serial","Shell","MBBSGhost","TelnetS", NULL};
char *conn_types[]={"Unknown","RLogin","RLogin Reversed","Telnet","Raw","SSH","SSH (no auth)","Modem","Serial","Shell","MBBS GHost","TelnetS",NULL};
char *conn_types_enum[]={"Unknown","RLogin","RLoginReversed","Telnet","Raw","SSH","SSHNA","Modem","Serial","NoRTS","Shell","MBBSGhost","TelnetS", NULL};
char *conn_types[]={"Unknown","RLogin","RLogin Reversed","Telnet","Raw","SSH","SSH (no auth)","Modem","Serial","3-wire (No RTS)","Shell","MBBS GHost","TelnetS",NULL};
short unsigned int conn_ports[]={0,513,513,23,0,22,22,0,0,0,65535,992,0};
struct conn_buffer conn_inbuf;
......@@ -377,6 +377,7 @@ int conn_connect(struct bbslist *bbs)
#endif
#ifndef __HAIKU__
case CONN_TYPE_SERIAL:
case CONN_TYPE_SERIAL_NORTS:
conn_api.connect=modem_connect;
conn_api.close=serial_close;
break;
......
......@@ -24,6 +24,7 @@ enum {
,CONN_TYPE_SSHNA
,CONN_TYPE_MODEM
,CONN_TYPE_SERIAL
,CONN_TYPE_SERIAL_NORTS
,CONN_TYPE_SHELL
,CONN_TYPE_MBBS_GHOST
,CONN_TYPE_TELNETS
......
......@@ -224,7 +224,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
}
break;
case 5: /* Output rate */
if(bbs->conn_type==CONN_TYPE_MODEM || bbs->conn_type==CONN_TYPE_SERIAL) {
if(bbs->conn_type==CONN_TYPE_MODEM || bbs->conn_type==CONN_TYPE_SERIAL || bbs->conn_type == CONN_TYPE_SERIAL_NORTS) {
uifcmsg("Not supported for this connection type"
,"Cannot change the display rate for Modem/Serial connections.");
}
......
......@@ -142,7 +142,7 @@ int modem_connect(struct bbslist *bbs)
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
if(bbs->conn_type == CONN_TYPE_SERIAL) {
if(bbs->conn_type == CONN_TYPE_SERIAL || bbs->conn_type == CONN_TYPE_SERIAL_NORTS) {
if((com=comOpen(bbs->addr)) == COM_HANDLE_INVALID) {
if (!bbs->hidepopups)
uifcmsg("Cannot Open Port", "`Cannot Open Port`\n\n"
......@@ -160,6 +160,9 @@ int modem_connect(struct bbslist *bbs)
return(-1);
}
}
if (bbs->conn_type == CONN_TYPE_SERIAL_NORTS) {
comLowerRTS(com);
}
if(!comRaiseDTR(com)) {
if (!bbs->hidepopups)
uifcmsg("Cannot Raise DTR", "`Cannot Raise DTR`\n\n"
......
......@@ -2505,7 +2505,7 @@ BOOL doterm(struct bbslist *bbs)
int speedwatch = 0;
gettextinfo(&txtinfo);
if(bbs->conn_type == CONN_TYPE_SERIAL)
if(bbs->conn_type == CONN_TYPE_SERIAL || bbs->conn_type == CONN_TYPE_SERIAL_NORTS)
speed = 0;
else
speed = bbs->bpsrate;
......@@ -2549,7 +2549,7 @@ BOOL doterm(struct bbslist *bbs)
hold_update=TRUE;
sleep=TRUE;
if(!term.nostatus)
update_status(bbs, (bbs->conn_type == CONN_TYPE_SERIAL)?bbs->bpsrate:speed, ooii_mode);
update_status(bbs, (bbs->conn_type == CONN_TYPE_SERIAL || bbs->conn_type == CONN_TYPE_SERIAL_NORTS)?bbs->bpsrate:speed, ooii_mode);
for(remain=count_data_waiting() /* Hack for connection check */ + (!is_connected(NULL)); remain; remain--) {
if(speed)
thischar=xp_timer();
......@@ -3001,7 +3001,7 @@ BOOL doterm(struct bbslist *bbs)
key = 0;
break;
case 0x9800: /* ALT-Up */
if(bbs->conn_type != CONN_TYPE_SERIAL) {
if(bbs->conn_type != CONN_TYPE_SERIAL && bbs->conn_type != CONN_TYPE_SERIAL_NORTS) {
if(speed)
speed=rates[get_rate_num(speed)+1];
else
......@@ -3010,7 +3010,7 @@ BOOL doterm(struct bbslist *bbs)
}
break;
case 0xa000: /* ALT-Down */
if(bbs->conn_type != CONN_TYPE_SERIAL) {
if(bbs->conn_type != CONN_TYPE_SERIAL && bbs->conn_type != CONN_TYPE_SERIAL_NORTS) {
i=get_rate_num(speed);
if(i==0)
speed=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment