Skip to content
Snippets Groups Projects
Commit 2b8f6ace authored by deuce's avatar deuce
Browse files

More modem-related updates

parent 7273a718
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ vpath %.c ../sbbs3 ../smblib ../uifc ../guts ../comio
INSTALL_EXE ?= install
INSTALL_DATA ?= install -m 0444
OBJS += $(MTOBJODIR)$(DIRSEP)comio_nix$(OFILE)
$(SYNCTERM): $(EXEODIR) $(OBJS) $(BUILD_DEPENDS)
@echo Linking $@
${QUIET}$(CC) $(LDFLAGS) $(MT_LDFLAGS) $(OBJS) -o $@ $(UIFC-MT_LIBS) $(CIOLIB-MT_LIBS) $(XPDEV-MT_LIBS)
......
SRC_ROOT = ..
!include ${SRC_ROOT}\build\Common.bmake
CFLAGS = $(CFLAGS) $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS) -I..\sbbs3;..\smblib;..\..\include\cryptlib
CFLAGS = $(CFLAGS) $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS) -I..\sbbs3;..\smblib;..\..\include\cryptlib;..\comio
LDFLAGS = $(LDFLAGS) $(UIFC-MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS)
.path.c = .;..\sbbs3;..\smblib;..\uifc
.path.c = .;..\sbbs3;..\smblib;..\uifc;..\comio
OBJS = $(OBJS) $(MTOBJODIR)$(DIRSEP)comio_win32$(OFILE)
$(SYNCTERM): $(OBJS)
@echo Linking $@
......
......@@ -6,6 +6,7 @@
#include "sockwrap.h"
#include "modem.h"
#include "syncterm.h"
#include "bbslist.h"
#include "conn.h"
......@@ -94,7 +95,7 @@ int modem_response(char *str, size_t maxlen, int timeout)
continue;
if(ch=='\r') {
while(comReadByte(com,&ch)); /* eat trailing ctrl chars (e.g. 'LF') */
// while(comReadByte(com,&ch)); /* eat trailing ctrl chars (e.g. 'LF') */
break;
}
str[len++]=ch;
......@@ -116,8 +117,15 @@ int modem_connect(struct bbslist *bbs)
conn_api.terminate=-1;
return(-1);
}
if(!comSetBaudRate(com, 115200)) {
uifcmsg("Cannot Set Baudrate", "`Cannot Set Baudrate`\n\n"
"Cannot open the specified modem device.\n");
conn_api.terminate=-1;
return(-1);
}
uifc.pop("Initializing...");
comWriteString(com, settings.mdm.init_string);
comWriteString(com, "\r");
......@@ -131,6 +139,18 @@ int modem_connect(struct bbslist *bbs)
conn_api.terminate=-1;
return(INVALID_SOCKET);
}
if(strstr(respbuf, settings.mdm.init_string))
if(modem_response(respbuf, sizeof(respbuf), 5)) {
modem_close();
uifc.pop(NULL);
uifcmsg("Modem Not Responding", "`Modem Not Responding`\n\n"
"The modem did not respond to the initializtion string\n"
"Check your init string and phone number.\n");
conn_api.terminate=-1;
return(INVALID_SOCKET);
}
if(strstr(respbuf, settings.mdm.init_string))
if(!strstr(respbuf, "OK")) {
modem_close();
uifc.pop(NULL);
......@@ -156,6 +176,8 @@ int modem_connect(struct bbslist *bbs)
return(INVALID_SOCKET);
}
if(!strstr(respbuf, "CONNECT")) {
uifc.pop(NULL);
uifc.pop(respbuf);
modem_close();
uifc.pop(NULL);
uifcmsg("Connection Failed", "`Connection Failed`\n\n"
......
......@@ -10,7 +10,6 @@ OBJS = \
$(MTOBJODIR)$(DIRSEP)conn_telnet$(OFILE) \
$(MTOBJODIR)$(DIRSEP)conn$(OFILE) \
$(MTOBJODIR)$(DIRSEP)comio$(OFILE) \
$(MTOBJODIR)$(DIRSEP)comio_nix$(OFILE) \
$(MTOBJODIR)$(DIRSEP)telnet$(OFILE) \
$(MTOBJODIR)$(DIRSEP)term$(OFILE) \
$(MTOBJODIR)$(DIRSEP)window$(OFILE) \
......
#ifndef _ST_CRYPT_H_
#define _ST_CRYPT_H_
#include "cryptlib.h"
#include"cryptlib.h"
struct crypt_funcs {
C_RET (*PopData)( C_IN CRYPT_HANDLE envelope, C_OUT void C_PTR buffer,
......@@ -36,4 +36,4 @@ extern int crypt_loaded;
int init_crypt(void);
void exit_crypt(void);
#endif
#endif
\ No newline at end of file
......@@ -861,8 +861,6 @@ void load_settings(struct syncterm_settings *set)
set->startup_mode=iniReadInteger(inifile,"SyncTERM","VideoMode",FALSE);
set->backlines=iniReadInteger(inifile,"SyncTERM","ScrollBackLines",2000);
char* iniReadString(FILE*, const char* section, const char* key
,const char* deflt, char* value);
/* Modem settings */
iniReadString(inifile, "SyncTERM", "ModemInit", "AT&F", set->mdm.init_string);
iniReadString(inifile, "SyncTERM", "ModemDevice", "/dev/ttyd0", set->mdm.device_name);
......
# Microsoft Developer Studio Project File - Name="syncterm" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=syncterm - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "syncterm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "syncterm.mak" CFG="syncterm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "syncterm - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "syncterm - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "syncterm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "msvc.win32.release"
# PROP Intermediate_Dir "msvc.win32.release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\xpdev" /I "..\conio" /I "..\uifc" /I "..\sbbs3" /I "..\smblib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "syncterm - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "msvc.win32.debug"
# PROP Intermediate_Dir "msvc.win32.debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\xpdev" /I "..\conio" /I "..\uifc" /I "..\sbbs3" /I "..\smblib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "syncterm - Win32 Release"
# Name "syncterm - Win32 Debug"
# Begin Source File
SOURCE=.\bbslist.c
# End Source File
# Begin Source File
SOURCE=.\conn.c
# End Source File
# Begin Source File
SOURCE=..\smblib\crc16.c
# End Source File
# Begin Source File
SOURCE=..\smblib\crc32.c
# End Source File
# Begin Source File
SOURCE=..\uifc\filepick.c
# End Source File
# Begin Source File
SOURCE=.\fonts.c
# End Source File
# Begin Source File
SOURCE=.\menu.c
# End Source File
# Begin Source File
SOURCE=.\syncterm.c
# End Source File
# Begin Source File
SOURCE=..\sbbs3\telnet.c
# End Source File
# Begin Source File
SOURCE=.\telnet_io.c
# End Source File
# Begin Source File
SOURCE=.\term.c
# End Source File
# Begin Source File
SOURCE=.\uifcinit.c
# End Source File
# Begin Source File
SOURCE=.\window.c
# End Source File
# Begin Source File
SOURCE=..\sbbs3\zmodem.c
# End Source File
# End Target
# End Project
# Microsoft Developer Studio Project File - Name="syncterm" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=syncterm - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "syncterm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "syncterm.mak" CFG="syncterm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "syncterm - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "syncterm - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "syncterm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "msvc.win32.release"
# PROP Intermediate_Dir "msvc.win32.release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\xpdev" /I "..\conio" /I "..\uifc" /I "..\sbbs3" /I "..\smblib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "syncterm - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "msvc.win32.debug"
# PROP Intermediate_Dir "msvc.win32.debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\xpdev" /I "..\conio" /I "..\uifc" /I "..\sbbs3" /I "..\smblib" /I "..\comio" /I "..\..\include\cryptlib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "syncterm - Win32 Release"
# Name "syncterm - Win32 Debug"
# Begin Source File
SOURCE=.\bbslist.c
# End Source File
# Begin Source File
SOURCE=..\comio\comio.c
# End Source File
# Begin Source File
SOURCE=..\comio\comio_win32.c
# End Source File
# Begin Source File
SOURCE=.\conn.c
# End Source File
# Begin Source File
SOURCE=.\conn_telnet.c
# End Source File
# Begin Source File
SOURCE=..\smblib\crc16.c
# End Source File
# Begin Source File
SOURCE=..\smblib\crc32.c
# End Source File
# Begin Source File
SOURCE=..\uifc\filepick.c
# End Source File
# Begin Source File
SOURCE=.\fonts.c
# End Source File
# Begin Source File
SOURCE=.\menu.c
# End Source File
# Begin Source File
SOURCE=.\modem.c
# End Source File
# Begin Source File
SOURCE=.\rlogin.c
# End Source File
# Begin Source File
SOURCE=.\ssh.c
# End Source File
# Begin Source File
SOURCE=.\st_crypt.c
# End Source File
# Begin Source File
SOURCE=.\syncterm.c
# End Source File
# Begin Source File
SOURCE=..\sbbs3\telnet.c
# End Source File
# Begin Source File
SOURCE=.\telnet_io.c
# End Source File
# Begin Source File
SOURCE=.\term.c
# End Source File
# Begin Source File
SOURCE=.\uifcinit.c
# End Source File
# Begin Source File
SOURCE=.\window.c
# End Source File
# Begin Source File
SOURCE=..\sbbs3\zmodem.c
# End Source File
# End Target
# End Project
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment