Comments (6)
Well, this is pretty complicated I think.
In Linux when you initialize a communication with a serial device using the open() function and it returns to you a file descriptor (which is an integer), while in Windows the handler is stored in a HANDLE type variable, which is actually a void pointer.
Because of this, I don't think you coulduse the HANDLE of the COM structure to pass that control.
If I were you I'd check if it is possible to skip that check.
from termiwin.
I currently have ignored the check for windows.
In general the MSVC docs also have this function basically: https://msdn.microsoft.com/de-de/library/f4s0ddew.aspx and I found somewhere that it uses GetFileType() (https://msdn.microsoft.com/de-de/library/windows/desktop/aa364960(v=vs.85).aspx) and check for FILE_TYPE_CHAR.
So with this it could be added to your lib, or ?!
from termiwin.
PS: As alternative I would need kind if an "getHandle" method to get the Handle out of your struct to do such calls directly
from termiwin.
Ok, I've added getHandle() function to the library which returns the HANDLE from the COM structure
from termiwin.
then I use that one :-) thank you. Will report results later
from termiwin.
works. Maybe "getCurrentHandle" is better because in fact it can only habdle one serial connection, or ?!
from termiwin.
Related Issues (10)
- hard defines for read/write/select/open/close also affects other files HOT 4
- How to Cross-compile it with mingw-w64 from Linux system HOT 3
- Missing defines CREAD, CLOCAL and B600 HOT 4
- Control/Charset option handling is not working HOT 3
- tcdrain is always blocking ... HOT 12
- Serial port name init seems wrong/strange HOT 1
- Any way to use with a Python packages?
- Function openSerial() changes the portname parameter
- Tons of Errors HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termiwin.