serial port Linux
BlitzMax Forums/BlitzMax Programming/serial port Linux
| ||
How could i access the serial port from Linux using BMax? Maybe using c includes from gcc? Or are there any modules, code and libs? |
| ||
so, anyone knows? i heard about using /dev/ttys0 as stream, but then? |
| ||
I am writing a module for win32. Today i try to engage a coffe machine. I can turn on and off a LED already. The C files are complete. Just hae to put it into BMax. But as is said, just fr win. IMurDOOM |
| ||
and for Lin, do you plane any release? it won't be too difficult, i think, 'cause its hardware. however you might use win interrupts, so i don't know... |
| ||
thats the problem at the time. I don't use interrupts at the moment, I can write bytes to a stream. Changing the baudrate and so on will follow but that has to be coded in BMax. The serial connection will be give, the rest has to be coded in Max. Changing the baud rate will be seperate function. It isn't difficult, i am no pro in C bute creating functions and handle them isn't the problem. You might get it to work under Linux |
| ||
could you send me your code, so i'll can learn more? PS: mail at: spiglerg @ gmail . com(without the spaces) |
| ||
PS: do you use pointers to the serial port memory area or direct access with /dev/ttys0? |
| ||
not tried it (in max) but under linux /dev/ttys0 should be like any other stream, so open an stream and read from it, check the docs about TStream. |
| ||
ok. now the problem is: i have to do all the functions to set the options and use the serial port buffer. is IMurDOOM could send me the code, maybe i could translate it to Linux. |
| ||
yes, it isn't ready yet. Whether i have finished the MaxModule ill send it to you. Yes i use pointers. The serial port is used like a file. Youll see it, on linux it will be completely different it'll be easier to write a new module, There's enough support on the internet. Google for it, my code won't help you. IMurDOOM |
| ||
ok. thanks. |
| ||
Finally, i've programmed the module, using C mixed to BMax. The main problem was with baud setting, and it hasn't the read function yet. If anyone would like to try it, please mail me at spiglerg @ gmail . com, because i have no time or intention to put it online. It's mainly for personal usage and i'll make it less compatible. |