Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
ae167dfa
Commit
ae167dfa
authored
17 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Make the modem dial string configurable.
Update the modem-related help screens.
parent
8ddd460f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/syncterm/bbslist.c
+34
-19
34 additions, 19 deletions
src/syncterm/bbslist.c
src/syncterm/modem.c
+1
-1
1 addition, 1 deletion
src/syncterm/modem.c
src/syncterm/syncterm.c
+1
-11
1 addition, 11 deletions
src/syncterm/syncterm.c
src/syncterm/syncterm.h
+12
-0
12 additions, 0 deletions
src/syncterm/syncterm.h
with
48 additions
and
31 deletions
src/syncterm/bbslist.c
+
34
−
19
View file @
ae167dfa
...
@@ -181,7 +181,7 @@ char *music_names[]={"ESC [ | only", "BANSI Style", "All ANSI Music enabled", NU
...
@@ -181,7 +181,7 @@ char *music_names[]={"ESC [ | only", "BANSI Style", "All ANSI Music enabled", NU
char
*
address_help
=
"`Address` or `Phone Number`
\n\n
"
char
*
address_help
=
"`Address` or `Phone Number`
\n\n
"
"Enter the hostname, IP address, or phone number of the system
\n
"
"Enter the hostname, IP address, or phone number of the system
\n
"
"to connect to.
i.e.
`nix.synchro.net`"
;
"to connect to.
Example:
`nix.synchro.net`"
;
char
*
conn_type_help
=
"`Connection Type`
\n\n
"
char
*
conn_type_help
=
"`Connection Type`
\n\n
"
"Select the type of connection you wish to make:
\n\n
"
"Select the type of connection you wish to make:
\n\n
"
"`RLogin`...........: Auto-login with RLogin protocol
\n
"
"`RLogin`...........: Auto-login with RLogin protocol
\n
"
...
@@ -778,7 +778,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
...
@@ -778,7 +778,7 @@ int edit_list(struct bbslist **list, struct bbslist *item,char *listpath,int isd
}
}
break
;
break
;
case
1
:
case
1
:
uifc
.
helpbuf
=
uifc
.
helpbuf
=
address_help
;
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
item
->
conn_type
==
CONN_TYPE_MODEM
?
"Phone Number"
:
"Address"
,
item
->
conn_type
==
CONN_TYPE_MODEM
?
"Phone Number"
:
"Address"
,
item
->
addr
,
LIST_ADDR_MAX
,
K_EDIT
);
,
item
->
addr
,
LIST_ADDR_MAX
,
K_EDIT
);
...
@@ -1056,8 +1056,8 @@ void change_settings(void)
...
@@ -1056,8 +1056,8 @@ void change_settings(void)
char
inipath
[
MAX_PATH
+
1
];
char
inipath
[
MAX_PATH
+
1
];
FILE
*
inifile
;
FILE
*
inifile
;
str_list_t
inicontents
;
str_list_t
inicontents
;
char
opts
[
7
][
80
];
char
opts
[
8
][
80
];
char
*
opt
[
8
];
char
*
opt
[
9
];
int
i
,
j
;
int
i
,
j
;
char
str
[
64
];
char
str
[
64
];
int
cur
=
0
;
int
cur
=
0
;
...
@@ -1071,9 +1071,9 @@ void change_settings(void)
...
@@ -1071,9 +1071,9 @@ void change_settings(void)
inicontents
=
strListInit
();
inicontents
=
strListInit
();
}
}
for
(
i
=
0
;
i
<
7
;
i
++
)
for
(
i
=
0
;
i
<
8
;
i
++
)
opt
[
i
]
=
opts
[
i
];
opt
[
i
]
=
opts
[
i
];
opt
[
7
]
=
NULL
;
opt
[
i
]
=
NULL
;
for
(;;)
{
for
(;;)
{
...
@@ -1089,9 +1089,11 @@ void change_settings(void)
...
@@ -1089,9 +1089,11 @@ void change_settings(void)
"~ Scrollback Buffer Lines ~
\n
"
"~ Scrollback Buffer Lines ~
\n
"
" The number of lines in the scrollback buffer.
\n\n
"
" The number of lines in the scrollback buffer.
\n\n
"
"~ Modem Device ~
\n
"
"~ Modem Device ~
\n
"
" The device name of the modem.
\n\n
"
" The device name of the modem
's communications port
.
\n\n
"
"~ Modem Init String ~
\n
"
"~ Modem Init String ~
\n
"
" An init string to use for the modem.
\n\n
"
;
" The command string to use to initialize the modem.
\n\n
"
"~ Modem Dial String ~
\n
"
" The command string to use to dial the modem.
\n\n
"
;
sprintf
(
opts
[
0
],
"Confirm Program Exit %s"
,
settings
.
confirm_close
?
"Yes"
:
"No"
);
sprintf
(
opts
[
0
],
"Confirm Program Exit %s"
,
settings
.
confirm_close
?
"Yes"
:
"No"
);
sprintf
(
opts
[
1
],
"Prompt to Save %s"
,
settings
.
prompt_save
?
"Yes"
:
"No"
);
sprintf
(
opts
[
1
],
"Prompt to Save %s"
,
settings
.
prompt_save
?
"Yes"
:
"No"
);
sprintf
(
opts
[
2
],
"Startup Screen Mode %s"
,
screen_modes
[
settings
.
startup_mode
]);
sprintf
(
opts
[
2
],
"Startup Screen Mode %s"
,
screen_modes
[
settings
.
startup_mode
]);
...
@@ -1099,6 +1101,7 @@ void change_settings(void)
...
@@ -1099,6 +1101,7 @@ void change_settings(void)
sprintf
(
opts
[
4
],
"Scrollback Buffer Lines %d"
,
settings
.
backlines
);
sprintf
(
opts
[
4
],
"Scrollback Buffer Lines %d"
,
settings
.
backlines
);
sprintf
(
opts
[
5
],
"Modem Device %s"
,
settings
.
mdm
.
device_name
);
sprintf
(
opts
[
5
],
"Modem Device %s"
,
settings
.
mdm
.
device_name
);
sprintf
(
opts
[
6
],
"Modem Init String %s"
,
settings
.
mdm
.
init_string
);
sprintf
(
opts
[
6
],
"Modem Init String %s"
,
settings
.
mdm
.
init_string
);
sprintf
(
opts
[
7
],
"Modem Dial String %s"
,
settings
.
mdm
.
dial_string
);
switch
(
uifc
.
list
(
WIN_MID
|
WIN_SAV
|
WIN_ACT
,
0
,
0
,
0
,
&
cur
,
NULL
,
"Program Settings"
,
opt
))
{
switch
(
uifc
.
list
(
WIN_MID
|
WIN_SAV
|
WIN_ACT
,
0
,
0
,
0
,
&
cur
,
NULL
,
"Program Settings"
,
opt
))
{
case
-
1
:
case
-
1
:
goto
write_ini
;
goto
write_ini
;
...
@@ -1227,31 +1230,43 @@ void change_settings(void)
...
@@ -1227,31 +1230,43 @@ void change_settings(void)
break
;
break
;
case
5
:
case
5
:
uifc
.
helpbuf
=
"`Modem Device`
\n\n
"
uifc
.
helpbuf
=
"`Modem Device`
\n\n
"
#ifdef _WIN32
"Enter the name of the device used to communicate with the modem.
\n\n
"
"Enter the modem device name (ie: COM1)."
;
"Example:
\"
`"
#else
DEFAULT_MODEM_DEV
"Enter the modem device name (ie: /dev/ttyd0)."
;
"`
\"
"
;
#endif
if
(
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Device"
,
settings
.
mdm
.
device_name
,
LIST_NAME_MAX
,
K_EDIT
)
>=
0
)
if
(
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Device"
,
settings
.
mdm
.
device_name
,
LIST_NAME_MAX
,
K_EDIT
)
>=
0
)
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemDevice"
,
settings
.
mdm
.
device_name
,
&
ini_style
);
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemDevice"
,
settings
.
mdm
.
device_name
,
&
ini_style
);
break
;
break
;
case
6
:
case
6
:
uifc
.
helpbuf
=
"`Modem Init String`
\n\n
"
uifc
.
helpbuf
=
"`Modem Init String`
\n\n
"
"Your modem init string goes here.
\n
"
"Your modem initialization string goes here.
\n\n
"
"For reference, here are the expected settings and USR inits
\n\n
"
"Example:
\n
"
"State USR Init
\n
"
"
\"
`AT&F`
\"
will load a Hayes compatible modem's factory default settings.
\n\n
"
"------------------------------------
\n
"
"For reference, here are the expected Hayes-compatible settings:
\n\n
"
"State Command
\n
"
"----------------------------------
\n
"
"Echo on E1
\n
"
"Echo on E1
\n
"
"Verbal result codes Q0V1
\n
"
"Verbal result codes Q0V1
\n
"
"Include connection speed &X4
\n
"
"Normal CD Handling &C1
\n
"
"Normal CD Handling &C1
\n
"
"Locked speed &B1
\n
"
"Normal DTR &D2
\n
"
"Normal DTR &D2
\n
"
"
\n\n
"
"For reference, here are the expected USRobotics-compatible settings:
\n\n
"
"State Command
\n
"
"----------------------------------
\n
"
"Include connection speed &X4
\n
"
"Locked speed &B1
\n
"
"CTS/RTS Flow Control &H1&R2
\n
"
"CTS/RTS Flow Control &H1&R2
\n
"
"Disable Software Flow &I0
\n
"
;
"Disable Software Flow &I0
\n
"
;
if
(
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Init String"
,
settings
.
mdm
.
init_string
,
LIST_NAME_MAX
,
K_EDIT
)
>=
0
)
if
(
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Init String"
,
settings
.
mdm
.
init_string
,
LIST_NAME_MAX
,
K_EDIT
)
>=
0
)
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemInit"
,
settings
.
mdm
.
init_string
,
&
ini_style
);
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemInit"
,
settings
.
mdm
.
init_string
,
&
ini_style
);
break
;
break
;
case
7
:
uifc
.
helpbuf
=
"`Modem Dial String`
\n\n
"
"The command string to dial the modem goes here.
\n\n
"
"Example:
\"
`ATDT`
\"
will dial a Hayes-compatible modem in touch-tone mode."
;
if
(
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Dial String"
,
settings
.
mdm
.
dial_string
,
LIST_NAME_MAX
,
K_EDIT
)
>=
0
)
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemDial"
,
settings
.
mdm
.
dial_string
,
&
ini_style
);
break
;
}
}
}
}
write_ini:
write_ini:
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/modem.c
+
1
−
1
View file @
ae167dfa
...
@@ -162,7 +162,7 @@ int modem_connect(struct bbslist *bbs)
...
@@ -162,7 +162,7 @@ int modem_connect(struct bbslist *bbs)
uifc
.
pop
(
NULL
);
uifc
.
pop
(
NULL
);
uifc
.
pop
(
"Dialing..."
);
uifc
.
pop
(
"Dialing..."
);
comWriteString
(
com
,
"ATDT"
);
comWriteString
(
com
,
settings
.
mdm
.
dial_string
);
comWriteString
(
com
,
bbs
->
addr
);
comWriteString
(
com
,
bbs
->
addr
);
comWriteString
(
com
,
"
\r
"
);
comWriteString
(
com
,
"
\r
"
);
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/syncterm.c
+
1
−
11
View file @
ae167dfa
...
@@ -36,17 +36,6 @@ char* syncterm_version = "SyncTERM 0.9.1"
...
@@ -36,17 +36,6 @@ char* syncterm_version = "SyncTERM 0.9.1"
#endif
#endif
;
;
/* Default modem device */
#if defined(__APPLE__) && defined(__MACH__)
/* Mac OS X */
#define DEFAULT_MODEM_DEV "/dev/tty.modem"
#elif defined(_WIN32)
#define DEFAULT_MODEM_DEV "COM1"
#else
/* FreeBSD */
#define DEFAULT_MODEM_DEV "/dev/ttyd0"
#endif
char
*
inpath
=
NULL
;
char
*
inpath
=
NULL
;
int
default_font
=
0
;
int
default_font
=
0
;
struct
syncterm_settings
settings
;
struct
syncterm_settings
settings
;
...
@@ -984,6 +973,7 @@ void load_settings(struct syncterm_settings *set)
...
@@ -984,6 +973,7 @@ void load_settings(struct syncterm_settings *set)
/* Modem settings */
/* Modem settings */
iniReadString
(
inifile
,
"SyncTERM"
,
"ModemInit"
,
"AT&F"
,
set
->
mdm
.
init_string
);
iniReadString
(
inifile
,
"SyncTERM"
,
"ModemInit"
,
"AT&F"
,
set
->
mdm
.
init_string
);
iniReadString
(
inifile
,
"SyncTERM"
,
"ModemDial"
,
"ATDT"
,
set
->
mdm
.
dial_string
);
iniReadString
(
inifile
,
"SyncTERM"
,
"ModemDevice"
,
DEFAULT_MODEM_DEV
,
set
->
mdm
.
device_name
);
iniReadString
(
inifile
,
"SyncTERM"
,
"ModemDevice"
,
DEFAULT_MODEM_DEV
,
set
->
mdm
.
device_name
);
/* Sort order */
/* Sort order */
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/syncterm.h
+
12
−
0
View file @
ae167dfa
...
@@ -16,8 +16,20 @@ enum {
...
@@ -16,8 +16,20 @@ enum {
,
SYNCTERM_PATH_CACHE
,
SYNCTERM_PATH_CACHE
};
};
/* Default modem device */
#if defined(__APPLE__) && defined(__MACH__)
/* Mac OS X */
#define DEFAULT_MODEM_DEV "/dev/tty.modem"
#elif defined(_WIN32)
#define DEFAULT_MODEM_DEV "COM1"
#else
/* FreeBSD */
#define DEFAULT_MODEM_DEV "/dev/ttyd0"
#endif
struct
modem_settings
{
struct
modem_settings
{
char
init_string
[
INI_MAX_VALUE_LEN
];
char
init_string
[
INI_MAX_VALUE_LEN
];
char
dial_string
[
INI_MAX_VALUE_LEN
];
char
device_name
[
INI_MAX_VALUE_LEN
+
1
];
char
device_name
[
INI_MAX_VALUE_LEN
+
1
];
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment