Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial and USB ports
#11
i'm sorry for misleading everybody in my previous post.  i had totally forgotten the name of the user's home directory.

to the o.p.: i guess you know this also.  but you could download the source code of the linux kernel.  figure out from there how usb is processed.  as i've said it will not be for the weak of heart.

i say this because i used to have a computer.  which came with windows10 from year 2017.  in the device manager i got ahold of one driver which was written in 2006.  put me off they were doing everything they could to kill all 16-bit and legacy code for backward compatibility.  but don't update all their drivers and stuff like that.

you could also study some of the source code of qb64 phoenix.  look for how _devices$ and other related functions are processed in linux.
Reply
#12
The com ports will work in linux with qb64. 
But you need to use a shell command to open them, and open the device file not com port like normal.


Shell "  stty -F /dev/ttyS0 9600 raw -ixon -ixoff -crtscts cs8 -echo -parenb -cstopb -icanon min 0 time 0"
Open "/dev/ttyS0" for binary as #1

You might have to mess around with the stty command.
I tried using this on laptop with usb serial, desktop with built in serial port, and orange pi uart ports. Just find the ports in the dev folder and adjust stty command and open command.

This is just how I found I can make it work is with the stty command and open in binary mode.
I have a timer set to check port 10x per second and if any data is there it reads it otherwise just checks 10x a second waiting so it doesn't waste crazy cpu cycles.

I can't use strings, I use a _byte variable to read.
So you use get to grab byte by byte.
Can send strings though.
It was a trick to figure out but now it's not bad.
Reply




Users browsing this thread: 1 Guest(s)