Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Commit

Permalink
Fixed a problem with options getters
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Mar 8, 2018
1 parent aa10291 commit aa8b2fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# termiWin
### ~ A termios porting for Windows ~

Current Version 1.1.1 (02/03/2018)
Current Version 1.1.2 (08/03/2018)

## Introduction

Expand Down Expand Up @@ -203,9 +203,9 @@ Returns the file descriptor ready for the chosen operation or -1 if failed.
The function can be called using select instead of selectSerial (for termios compatibility).

#### HANDLE getHandle();

Returns the HANDLE from the COM structure.

### Multiple serial communications

At the moment is not possible to have more than one serial communication at the same time, this because it would be pretty complicated to implement in this library something which allows you to do that. I've thought of some solutions, but I'll try them when I have some time off.
Expand Down
12 changes: 6 additions & 6 deletions termiWin.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int getIXOptions(tcflag_t flag) {
#define i_PARMRK_IXON 0x06
#define i_PARMRK_IXON_IXOFF 0x07

int byte = getByte(flag,4,1);
int byte = getByte(flag,1,1);

return byte;

Expand All @@ -85,7 +85,7 @@ int getEchoOptions(tcflag_t flag) {
#define l_ECHOK_ECHONL 0x0c
#define l_ECHONL 0x08

int byte = getByte(flag,5,1);
int byte = getByte(flag,1,1);
return byte;

}
Expand All @@ -108,7 +108,7 @@ int getLocalOptions(tcflag_t flag) {
#define l_IEXTEN_NOFLSH 0xa0
#define l_NOFLSH 0x80

int byte = getByte(flag,5,0);
int byte = getByte(flag,1,0);
return byte;

}
Expand All @@ -117,7 +117,7 @@ int getToStop(tcflag_t flag) {

#define l_TOSTOP 0x01

int byte = getByte(flag,4,1);
int byte = getByte(flag,1,1);
return byte;

}
Expand All @@ -127,7 +127,7 @@ int getToStop(tcflag_t flag) {
int getCharSet(tcflag_t flag) {

//FLAG IS MADE UP OF 8 BYTES, A FLAG IS MADE UP OF A NIBBLE -> 4 BITS, WE NEED TO EXTRACT THE SECOND NIBBLE (1st) FROM THE FIFTH BYTE (6th).
int byte = getByte(flag,5,1);
int byte = getByte(flag,1,1);

switch(byte) {

Expand Down Expand Up @@ -164,7 +164,7 @@ int getControlOptions(tcflag_t flag) {
#define c_NOPARENB_CSTOPB 0x10
#define c_ALL_DISABLED 0x00

int byte = getByte(flag,5,0);
int byte = getByte(flag,1,0);
return byte;

}
Expand Down

0 comments on commit aa8b2fc

Please sign in to comment.