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
d2ec372c
Commit
d2ec372c
authored
3 weeks ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Log modem status value, helpful when debugging serial line/modem issues
parent
740dfa69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#8701
failed
3 weeks ago
Stage: build
Stage: test
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sexpots/sexpots.c
+10
-4
10 additions, 4 deletions
src/sexpots/sexpots.c
with
10 additions
and
4 deletions
src/sexpots/sexpots.c
+
10
−
4
View file @
d2ec372c
...
...
@@ -675,6 +675,8 @@ BOOL modem_response(COM_HANDLE com_handle, char *str, size_t maxlen)
return
TRUE
;
}
int
modem_status
(
COM_HANDLE
com_handle
);
/****************************************************************************/
/****************************************************************************/
BOOL
modem_command
(
COM_HANDLE
com_handle
,
const
char
*
cmd
)
...
...
@@ -686,18 +688,20 @@ BOOL modem_command(COM_HANDLE com_handle, const char* cmd)
if
(
terminated
)
return
FALSE
;
if
(
i
)
{
lprintf
(
LOG_WARNING
,
"Retry #%u: sending modem command (%s) on %s"
,
i
,
cmd
,
com_dev
);
lprintf
(
LOG_WARNING
,
"Retry #%u: sending modem command (%s) on %s (status: %x)"
,
i
,
cmd
,
com_dev
,
modem_status
(
com_handle
));
lprintf
(
LOG_DEBUG
,
"Dropping DTR on %s"
,
com_dev
);
if
(
!
comLowerDTR
(
com_handle
))
lprintf
(
LOG_ERR
,
"ERROR %u lowering DTR on %s"
,
COM_ERROR_VALUE
,
com_dev
);
SLEEP
(
dtr_delay
);
lprintf
(
LOG_DEBUG
,
"Raising DTR on %s
"
,
com_dev
);
lprintf
(
LOG_DEBUG
,
"Raising DTR on %s
(status: %x)"
,
com_dev
,
modem_status
(
com_handle
)
);
if
(
!
comRaiseDTR
(
com_handle
))
lprintf
(
LOG_ERR
,
"ERROR %u raising DTR on %s"
,
COM_ERROR_VALUE
,
com_dev
);
SLEEP
(
5000
);
}
if
(
!
modem_send
(
com_handle
,
cmd
))
{
lprintf
(
LOG_ERR
,
"ERROR %u sending modem command (%s) on %s"
,
COM_ERROR_VALUE
,
cmd
,
com_dev
);
lprintf
(
LOG_ERR
,
"ERROR %u sending modem command (%s) on %s
(status: %x)
"
,
COM_ERROR_VALUE
,
cmd
,
com_dev
,
modem_status
(
com_handle
)
);
continue
;
}
...
...
@@ -1668,6 +1672,8 @@ service_loop(int argc, char** argv)
com_setup
();
lprintf
(
LOG_INFO
,
"COM Port DTE rate: %ld bps"
,
comGetBaudRate
(
com_handle
));
comSetFlowControl
(
com_handle
,
COM_FLOW_CONTROL_RTS_CTS
);
lprintf
(
LOG_INFO
,
"COM Port flow control: %d"
,
comGetFlowControl
(
com_handle
));
if
(
ident
)
_beginthread
(
ident_server_thread
,
0
,
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