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
77fa5ede
Commit
77fa5ede
authored
17 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Log errors with comGetModemStatus.
parent
408d2c7d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sexpots/sexpots.c
+33
-9
33 additions, 9 deletions
src/sexpots/sexpots.c
with
33 additions
and
9 deletions
src/sexpots/sexpots.c
+
33
−
9
View file @
77fa5ede
...
...
@@ -675,7 +675,8 @@ BOOL modem_command(COM_HANDLE com_handle, const char* cmd)
char
resp
[
128
];
if
(
!
modem_send
(
com_handle
,
cmd
))
{
lprintf
(
LOG_ERR
,
"ERROR %u sending modem command"
,
COM_ERROR_VALUE
);
lprintf
(
LOG_ERR
,
"ERROR %u sending modem command (%s)"
,
COM_ERROR_VALUE
,
cmd
);
return
FALSE
;
}
...
...
@@ -742,6 +743,7 @@ BOOL wait_for_call(COM_HANDLE com_handle)
char
*
p
;
BOOL
result
=
TRUE
;
DWORD
events
=
0
;
int
mdm_status
;
ZERO_VAR
(
cid_name
);
ZERO_VAR
(
cid_number
);
...
...
@@ -806,7 +808,10 @@ BOOL wait_for_call(COM_HANDLE com_handle)
}
continue
;
/* don't check DCD until we've received all the modem msgs */
}
if
(
comGetModemStatus
(
com_handle
)
&
COM_DCD
)
if
((
mdm_status
=
comGetModemStatus
(
com_handle
))
==
COM_ERROR
)
lprintf
(
LOG_ERR
,
"Error %u getting modem status (line %u)"
,
COM_ERROR_VALUE
,
__LINE__
);
else
if
(
mdm_status
&
COM_DCD
)
break
;
}
...
...
@@ -1179,6 +1184,7 @@ BOOL handle_call(void)
int
result
;
int
rd
;
int
wr
;
int
mdm_status
;
fd_set
socket_set
;
struct
timeval
tv
=
{
0
,
0
};
...
...
@@ -1199,9 +1205,16 @@ BOOL handle_call(void)
while
(
!
terminated
)
{
if
(
!
dcd_ignore
&&
(
comGetModemStatus
(
com_handle
)
&
COM_DCD
)
==
0
)
{
lprintf
(
LOG_WARNING
,
"Loss of Carrier Detect (DCD) detected"
);
break
;
if
(
!
dcd_ignore
)
{
if
((
mdm_status
=
comGetModemStatus
(
com_handle
))
==
COM_ERROR
)
{
lprintf
(
LOG_ERR
,
"Error %u getting modem status (line %u)"
,
COM_ERROR_VALUE
,
__LINE__
);
break
;
}
if
((
mdm_status
&
COM_DCD
)
==
0
)
{
lprintf
(
LOG_WARNING
,
"Loss of Carrier Detect (DCD) detected"
);
break
;
}
}
#if 0
if(comReadByte(com_handle, &ch)) {
...
...
@@ -1256,10 +1269,16 @@ BOOL handle_call(void)
/****************************************************************************/
BOOL
hangup_call
(
COM_HANDLE
com_handle
)
{
time_t
start
;
time_t
start
;
int
attempt
;
int
mdm_status
;
if
((
comGetModemStatus
(
com_handle
)
&
COM_DCD
)
==
0
)
/* DCD already low */
if
((
mdm_status
=
comGetModemStatus
(
com_handle
))
==
COM_ERROR
)
{
lprintf
(
LOG_ERR
,
"Error %u getting modem status (line %u)"
,
COM_ERROR_VALUE
,
__LINE__
);
return
TRUE
;
}
if
((
mdm_status
&
COM_DCD
)
==
0
)
/* DCD already low */
return
TRUE
;
lprintf
(
LOG_DEBUG
,
"Waiting for transmit buffer to empty"
);
...
...
@@ -1270,10 +1289,15 @@ BOOL hangup_call(COM_HANDLE com_handle)
lprintf
(
LOG_ERR
,
"ERROR %u lowering DTR"
,
COM_ERROR
);
continue
;
}
lprintf
(
LOG_
INFO
,
"Waiting for loss of Carrier Detect (DCD)"
);
lprintf
(
LOG_
DEBUG
,
"Waiting for loss of Carrier Detect (DCD)"
);
start
=
time
(
NULL
);
while
(
time
(
NULL
)
-
start
<=
dcd_timeout
)
{
if
((
comGetModemStatus
(
com_handle
)
&
COM_DCD
)
==
0
)
if
((
mdm_status
=
comGetModemStatus
(
com_handle
))
==
COM_ERROR
)
{
lprintf
(
LOG_ERR
,
"Error %u getting modem status (line %u)"
,
COM_ERROR_VALUE
,
__LINE__
);
return
TRUE
;
}
if
((
mdm_status
&
COM_DCD
)
==
0
)
return
TRUE
;
SLEEP
(
1000
);
}
...
...
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