Skip to content
Snippets Groups Projects
Commit ee5f1e62 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 192436d0
No related branches found
No related tags found
No related merge requests found
...@@ -248,6 +248,7 @@ static char *conn_type_help= "`Connection Type`\n\n" ...@@ -248,6 +248,7 @@ static char *conn_type_help= "`Connection Type`\n\n"
"`SSH`..............: Connect using the Secure Shell (SSH-2) protocol\n" "`SSH`..............: Connect using the Secure Shell (SSH-2) protocol\n"
"`Modem`............: Connect using a dial-up modem\n" "`Modem`............: Connect using a dial-up modem\n"
"`Serial`...........: Connect directly to a serial communications port\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" "`Shell`............: Connect to a local PTY (*nix only)\n"
"`MBBS GHost`.......: Communicate using the Major BBS 'GHost' protocol\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 ...@@ -980,7 +981,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
sprintf(opt[i++], "Name %s",itemname); sprintf(opt[i++], "Name %s",itemname);
if(item->conn_type==CONN_TYPE_MODEM) if(item->conn_type==CONN_TYPE_MODEM)
sprintf(opt[i++], "Phone Number %s",item->addr); 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); sprintf(opt[i++], "Device Name %s",item->addr);
else if(item->conn_type==CONN_TYPE_SHELL) else if(item->conn_type==CONN_TYPE_SHELL)
sprintf(opt[i++], "Command %s",item->addr); sprintf(opt[i++], "Command %s",item->addr);
...@@ -1166,6 +1167,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd ...@@ -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 uifc.input(WIN_MID|WIN_SAV,0,0
,item->conn_type==CONN_TYPE_MODEM ? "Phone Number" ,item->conn_type==CONN_TYPE_MODEM ? "Phone Number"
:item->conn_type==CONN_TYPE_SERIAL ? "Device Name" :item->conn_type==CONN_TYPE_SERIAL ? "Device Name"
:item->conn_type==CONN_TYPE_SERIAL_NORTS ? "Device Name"
:item->conn_type==CONN_TYPE_SHELL ? "Command" :item->conn_type==CONN_TYPE_SHELL ? "Command"
: "Address" : "Address"
,item->addr,LIST_ADDR_MAX,K_EDIT); ,item->addr,LIST_ADDR_MAX,K_EDIT);
...@@ -1173,7 +1175,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd ...@@ -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); iniSetString(&inifile,itemname,"Address",item->addr,&ini_style);
break; break;
case 3: 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" uifc.helpbuf = "`Flow Control`\n\n"
"Select the desired flow control type.\n" "Select the desired flow control type.\n"
"This should usually be left as \"RTS/CTS\".\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 ...@@ -1281,7 +1283,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
item->user[0] = 0; 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 && item->conn_type!=CONN_TYPE_SHELL
) { ) {
/* Set the port too */ /* Set the port too */
...@@ -2413,6 +2415,7 @@ struct bbslist *show_bbslist(char *current, int connected) ...@@ -2413,6 +2415,7 @@ struct bbslist *show_bbslist(char *current, int connected)
list[listcount-1]->conn_type++; list[listcount-1]->conn_type++;
if(list[listcount-1]->conn_type!=CONN_TYPE_MODEM 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
&& list[listcount-1]->conn_type!=CONN_TYPE_SERIAL_NORTS
&& list[listcount-1]->conn_type!=CONN_TYPE_SHELL && list[listcount-1]->conn_type!=CONN_TYPE_SHELL
) { ) {
/* Set the port too */ /* Set the port too */
...@@ -2434,6 +2437,7 @@ struct bbslist *show_bbslist(char *current, int connected) ...@@ -2434,6 +2437,7 @@ struct bbslist *show_bbslist(char *current, int connected)
uifc.input(WIN_MID|WIN_SAV,0,0 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_MODEM ? "Phone Number"
:list[listcount-1]->conn_type==CONN_TYPE_SERIAL ? "Device Name" :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" :list[listcount-1]->conn_type==CONN_TYPE_SHELL ? "Command"
:"Address" :"Address"
,list[listcount-1]->addr,LIST_ADDR_MAX,K_EDIT); ,list[listcount-1]->addr,LIST_ADDR_MAX,K_EDIT);
......
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
#include "conn_telnet.h" #include "conn_telnet.h"
struct conn_api conn_api; 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_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","Shell","MBBS GHost","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}; short unsigned int conn_ports[]={0,513,513,23,0,22,22,0,0,0,65535,992,0};
struct conn_buffer conn_inbuf; struct conn_buffer conn_inbuf;
...@@ -377,6 +377,7 @@ int conn_connect(struct bbslist *bbs) ...@@ -377,6 +377,7 @@ int conn_connect(struct bbslist *bbs)
#endif #endif
#ifndef __HAIKU__ #ifndef __HAIKU__
case CONN_TYPE_SERIAL: case CONN_TYPE_SERIAL:
case CONN_TYPE_SERIAL_NORTS:
conn_api.connect=modem_connect; conn_api.connect=modem_connect;
conn_api.close=serial_close; conn_api.close=serial_close;
break; break;
......
...@@ -24,6 +24,7 @@ enum { ...@@ -24,6 +24,7 @@ enum {
,CONN_TYPE_SSHNA ,CONN_TYPE_SSHNA
,CONN_TYPE_MODEM ,CONN_TYPE_MODEM
,CONN_TYPE_SERIAL ,CONN_TYPE_SERIAL
,CONN_TYPE_SERIAL_NORTS
,CONN_TYPE_SHELL ,CONN_TYPE_SHELL
,CONN_TYPE_MBBS_GHOST ,CONN_TYPE_MBBS_GHOST
,CONN_TYPE_TELNETS ,CONN_TYPE_TELNETS
......
...@@ -224,7 +224,7 @@ int syncmenu(struct bbslist *bbs, int *speed) ...@@ -224,7 +224,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
} }
break; break;
case 5: /* Output rate */ 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" uifcmsg("Not supported for this connection type"
,"Cannot change the display rate for Modem/Serial connections."); ,"Cannot change the display rate for Modem/Serial connections.");
} }
......
...@@ -142,7 +142,7 @@ int modem_connect(struct bbslist *bbs) ...@@ -142,7 +142,7 @@ int modem_connect(struct bbslist *bbs)
if (!bbs->hidepopups) if (!bbs->hidepopups)
init_uifc(TRUE, TRUE); 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((com=comOpen(bbs->addr)) == COM_HANDLE_INVALID) {
if (!bbs->hidepopups) if (!bbs->hidepopups)
uifcmsg("Cannot Open Port", "`Cannot Open Port`\n\n" uifcmsg("Cannot Open Port", "`Cannot Open Port`\n\n"
...@@ -160,6 +160,9 @@ int modem_connect(struct bbslist *bbs) ...@@ -160,6 +160,9 @@ int modem_connect(struct bbslist *bbs)
return(-1); return(-1);
} }
} }
if (bbs->conn_type == CONN_TYPE_SERIAL_NORTS) {
comLowerRTS(com);
}
if(!comRaiseDTR(com)) { if(!comRaiseDTR(com)) {
if (!bbs->hidepopups) if (!bbs->hidepopups)
uifcmsg("Cannot Raise DTR", "`Cannot Raise DTR`\n\n" uifcmsg("Cannot Raise DTR", "`Cannot Raise DTR`\n\n"
......
...@@ -2505,7 +2505,7 @@ BOOL doterm(struct bbslist *bbs) ...@@ -2505,7 +2505,7 @@ BOOL doterm(struct bbslist *bbs)
int speedwatch = 0; int speedwatch = 0;
gettextinfo(&txtinfo); 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; speed = 0;
else else
speed = bbs->bpsrate; speed = bbs->bpsrate;
...@@ -2549,7 +2549,7 @@ BOOL doterm(struct bbslist *bbs) ...@@ -2549,7 +2549,7 @@ BOOL doterm(struct bbslist *bbs)
hold_update=TRUE; hold_update=TRUE;
sleep=TRUE; sleep=TRUE;
if(!term.nostatus) 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--) { for(remain=count_data_waiting() /* Hack for connection check */ + (!is_connected(NULL)); remain; remain--) {
if(speed) if(speed)
thischar=xp_timer(); thischar=xp_timer();
...@@ -3001,7 +3001,7 @@ BOOL doterm(struct bbslist *bbs) ...@@ -3001,7 +3001,7 @@ BOOL doterm(struct bbslist *bbs)
key = 0; key = 0;
break; break;
case 0x9800: /* ALT-Up */ 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) if(speed)
speed=rates[get_rate_num(speed)+1]; speed=rates[get_rate_num(speed)+1];
else else
...@@ -3010,7 +3010,7 @@ BOOL doterm(struct bbslist *bbs) ...@@ -3010,7 +3010,7 @@ BOOL doterm(struct bbslist *bbs)
} }
break; break;
case 0xa000: /* ALT-Down */ 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); i=get_rate_num(speed);
if(i==0) if(i==0)
speed=0; speed=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment