termios???
Rsadeika
Posts: 3,837
Just curious as to why Parallax decided not to use termios, which has been used by C programmers for the last twenty years or so, and chose to go with SSER, FDS, ..., etc?
Since I have been working on my Kubuntu computer, I decided to see if I could come up with a serial terminal program written in C, so I could communicate with the XBee that is attached. I found some example code, mininterm.c, and I noticed that it uses termios, as do other code examples, my first exposure to that lib. The program uses two functions, write() and read(), that caught my attention, it seems like something like that could be of benifit in PropGCC. Also there is a lot of other stuff that is in the lib that I am still grappling with.
Because the miniterm.c example is still very complex even with the limited amount of code, I am going to try to see if I can come up with a program that is the absolute minimum amount of code, and still works, which uses termios. I have not come accross any example code with that feature, and still works as expected.
Ray
Since I have been working on my Kubuntu computer, I decided to see if I could come up with a serial terminal program written in C, so I could communicate with the XBee that is attached. I found some example code, mininterm.c, and I noticed that it uses termios, as do other code examples, my first exposure to that lib. The program uses two functions, write() and read(), that caught my attention, it seems like something like that could be of benifit in PropGCC. Also there is a lot of other stuff that is in the lib that I am still grappling with.
Because the miniterm.c example is still very complex even with the limited amount of code, I am going to try to see if I can come up with a program that is the absolute minimum amount of code, and still works, which uses termios. I have not come accross any example code with that feature, and still works as expected.
Ray
Comments
Eric
-the command line input would except the tty port and BAUD rate. example - kterm2 /dev/ttyUSB0 9600
-I added an echo feature, so the key press is visible
-exits program if the port is not available
Now I am able to work with the XBee module that is connected to my computer, and I will be able to add more features as needed. The program basically excepts one character at a time, strings will come latter, when I know what I am doing.This also works when I am logged into the computer via putty, which is a feature that I wanted. I tried to comment the code as much as I could understand what the code was doing. Some of the C experts might have to add some comments if they feel it would help.
Ray
Study this code example: http://code.google.com/p/propgcc/source/browse/loader/src/osint_linux.c