Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File / port cconventions and use
#6
The short answer is that you're probably not going to get this to work on Linux for a variety of reasons. On Windows `Open` has special support for serial devices via `OPEN COM`, but similar functionality is not implemented on Linux and Mac OS and the regular file logic is not designed for streams.

Your best bet would be writing a little bit of C code to read/write from the stream using `open()`, `read()`, `write()`, etc. and then call that code from QB64 using `DECLARE LIBRARY`. In theory you could do it all via pure QB64 and directly calling `open()`, `read()`, `write()`, etc. (via `DECLARE LIBRARY`) but you wouldn't be able to use the C constants for `open()` so there would be more potential for mistakes.

I'm also pretty sure the `stty` shell call won't work as intended, I don't think those settings will persist after the `Shell` call. If I'm right on that then you'll have to set the tty settings using the C APIs (`tcgetattr()` and `tcsetattr()`). Those functions pass a `struct termios` structure back and forth so you really don't want to bother trying to do that with QB64, writing C code for that would be a lot simpler.
Reply


Messages In This Thread
File / port cconventions and use - by Parkland - 03-30-2025, 12:31 AM
RE: File / port cconventions and use - by Pete - 03-30-2025, 01:52 AM
RE: File / port cconventions and use - by DSMan195276 - 03-30-2025, 02:13 AM
RE: File / port cconventions and use - by Pete - 03-30-2025, 02:49 AM
RE: File / port cconventions and use - by Pete - 03-30-2025, 03:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error when inputting ASCII text from COM port MichelleL 11 1,956 01-24-2024, 08:01 AM
Last Post: mdijkens
  BIOS com port eoredson 9 1,986 09-08-2023, 04:37 PM
Last Post: DSMan195276
  Comm and VCSP port twiddling controls sigs doppler 2 867 06-08-2023, 07:19 PM
Last Post: doppler
  _OPENHOST to port 443 fails jleger2023 9 1,931 01-19-2023, 08:20 PM
Last Post: SpriggsySpriggs

Forum Jump:


Users browsing this thread: 1 Guest(s)