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
ae14d7f7
Commit
ae14d7f7
authored
18 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Clean up modem dialing.
Add more init string help.
parent
1681226b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/syncterm/bbslist.c
+12
-1
12 additions, 1 deletion
src/syncterm/bbslist.c
src/syncterm/modem.c
+27
-42
27 additions, 42 deletions
src/syncterm/modem.c
with
39 additions
and
43 deletions
src/syncterm/bbslist.c
+
12
−
1
View file @
ae14d7f7
...
@@ -662,7 +662,18 @@ void change_settings(void)
...
@@ -662,7 +662,18 @@ void change_settings(void)
break
;
break
;
case
4
:
case
4
:
uifc
.
helpbuf
=
"`Modem Init String`
\n\n
"
uifc
.
helpbuf
=
"`Modem Init String`
\n\n
"
"Your modem init string goes here."
;
"Your modem init string goes here.
\n
"
;
"For reference, here are the expected settings and USR inits
\n\n
"
"State USR Init"
"------------------------------------"
"Echo on E1"
"Verbal result codes Q0V1"
"Include connection speed &X4"
"Normal CD Handling C1"
"Locked speed &B1"
"Normal DTR &D2"
"CTS/RTS Flow Control &H1&R2"
"Disable Software Flow &I0"
;
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Init String"
,
settings
.
mdm
.
init_string
,
LIST_NAME_MAX
,
K_EDIT
);
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Modem Init String"
,
settings
.
mdm
.
init_string
,
LIST_NAME_MAX
,
K_EDIT
);
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemInit"
,
settings
.
mdm
.
init_string
,
&
ini_style
);
iniSetString
(
&
inicontents
,
"SyncTERM"
,
"ModemInit"
,
settings
.
mdm
.
init_string
,
&
ini_style
);
break
;
break
;
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/modem.c
+
27
−
42
View file @
ae14d7f7
...
@@ -136,6 +136,7 @@ int modem_connect(struct bbslist *bbs)
...
@@ -136,6 +136,7 @@ int modem_connect(struct bbslist *bbs)
comWriteString
(
com
,
"
\r
"
);
comWriteString
(
com
,
"
\r
"
);
/* Wait for "OK" */
/* Wait for "OK" */
while
(
1
)
{
if
(
modem_response
(
respbuf
,
sizeof
(
respbuf
),
5
))
{
if
(
modem_response
(
respbuf
,
sizeof
(
respbuf
),
5
))
{
modem_close
();
modem_close
();
uifc
.
pop
(
NULL
);
uifc
.
pop
(
NULL
);
...
@@ -145,20 +146,10 @@ int modem_connect(struct bbslist *bbs)
...
@@ -145,20 +146,10 @@ int modem_connect(struct bbslist *bbs)
conn_api
.
terminate
=-
1
;
conn_api
.
terminate
=-
1
;
return
(
-
1
);
return
(
-
1
);
}
}
uifc
.
pop
(
NULL
);
if
(
strstr
(
respbuf
,
settings
.
mdm
.
init_string
))
/* Echo is on */
uifc
.
pop
(
respbuf
);
continue
;
if
(
strstr
(
respbuf
,
settings
.
mdm
.
init_string
))
break
;
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
(
-
1
);
}
}
uifc
.
pop
(
NULL
);
uifc
.
pop
(
respbuf
);
if
(
!
strstr
(
respbuf
,
"OK"
))
{
if
(
!
strstr
(
respbuf
,
"OK"
))
{
modem_close
();
modem_close
();
...
@@ -176,6 +167,7 @@ uifc.pop(respbuf);
...
@@ -176,6 +167,7 @@ uifc.pop(respbuf);
comWriteString
(
com
,
"
\r
"
);
comWriteString
(
com
,
"
\r
"
);
/* Wait for "CONNECT" */
/* Wait for "CONNECT" */
while
(
1
)
{
if
(
modem_response
(
respbuf
,
sizeof
(
respbuf
),
30
))
{
if
(
modem_response
(
respbuf
,
sizeof
(
respbuf
),
30
))
{
modem_close
();
modem_close
();
uifc
.
pop
(
NULL
);
uifc
.
pop
(
NULL
);
...
@@ -184,18 +176,11 @@ uifc.pop(respbuf);
...
@@ -184,18 +176,11 @@ uifc.pop(respbuf);
conn_api
.
terminate
=-
1
;
conn_api
.
terminate
=-
1
;
return
(
-
1
);
return
(
-
1
);
}
}
uifc
.
pop
(
NULL
);
if
(
strstr
(
respbuf
,
"ATA"
))
/* Dial command echoed */
uifc
.
pop
(
respbuf
);
continue
;
if
(
modem_response
(
respbuf
,
sizeof
(
respbuf
),
30
))
{
break
;
modem_close
();
uifc
.
pop
(
NULL
);
uifcmsg
(
"No Answer"
,
"`No Answer`
\n\n
"
"The modem did not connect withing 30 seconds.
\n
"
);
conn_api
.
terminate
=-
1
;
return
(
-
1
);
}
}
uifc
.
pop
(
NULL
);
uifc
.
pop
(
respbuf
);
if
(
!
strstr
(
respbuf
,
"CONNECT"
))
{
if
(
!
strstr
(
respbuf
,
"CONNECT"
))
{
modem_close
();
modem_close
();
uifc
.
pop
(
NULL
);
uifc
.
pop
(
NULL
);
...
...
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