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
3ae353f3
Commit
3ae353f3
authored
4 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Hack in get/set TxFlowControl things... have it also control Rx flow control.
parent
b24efb69
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/comio/comio_nix.c
+64
-0
64 additions, 0 deletions
src/comio/comio_nix.c
with
64 additions
and
0 deletions
src/comio/comio_nix.c
+
64
−
0
View file @
3ae353f3
...
...
@@ -294,6 +294,70 @@ BOOL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
return
TRUE
;
}
BOOL
comGetTxFlowControl
(
COM_HANDLE
handle
)
{
BOOL
ret
=
FALSE
;
struct
termios
t
;
if
(
tcgetattr
(
handle
,
&
t
)
==-
1
)
return
FALSE
;
ret
=
(
t
.
c_cflag
&
(
0
/* The next two are pretty much never used */
#ifdef CCTX_OFLOW
|
CCTS_OFLOW
/* CTS flow control of output */
#endif
#ifdef CRTSCTS
|
CRTSCTS
/* same as CCTS_OFLOW */
#endif
#ifdef CRTS_IFLOW
|
CRTS_IFLOW
/* RTS flow control of input */
#endif
))
?
TRUE
:
FALSE
;
return
ret
;
}
BOOL
comSetTxFlowControl
(
COM_HANDLE
handle
,
BOOL
enable
)
{
struct
termios
t
;
if
(
tcgetattr
(
handle
,
&
t
)
==-
1
)
return
FALSE
;
if
(
enable
)
{
t
.
c_cflag
|=
(
0
/* The next two are pretty much never used */
#ifdef CCTX_OFLOW
|
CCTS_OFLOW
/* CTS flow control of output */
#endif
#ifdef CRTSCTS
|
CRTSCTS
/* same as CCTS_OFLOW */
#endif
#ifdef CRTS_IFLOW
|
CRTS_IFLOW
/* RTS flow control of input */
#endif
);
}
else
{
t
.
c_cflag
&=
~
(
0
/* The next two are pretty much never used */
#ifdef CCTX_OFLOW
|
CCTS_OFLOW
/* CTS flow control of output */
#endif
#ifdef CRTSCTS
|
CRTSCTS
/* same as CCTS_OFLOW */
#endif
#ifdef CRTS_IFLOW
|
CRTS_IFLOW
/* RTS flow control of input */
#endif
);
}
if
(
tcsetattr
(
handle
,
TCSANOW
,
&
t
)
==-
1
)
return
FALSE
;
return
TRUE
;
}
int
comGetModemStatus
(
COM_HANDLE
handle
)
{
int
status
;
...
...
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