João Pires said:
I have a program write in VB and I need to convert the code to C for Linux.
Well, I began to do that but I have some problems ...
- How can I write te code in C to comunicate with the serial port?
I hope someone could help me!
Communicating with a serial port often requires knowledge of how to handle
OS- or hardware-specific characteristics. The C language itself deals only
with logical streams which can be handled with the <stdio.h> functions. It
is possible that your implementation supplies a layer allowing you to
handle these ports as FILE*'s, but that's hardly guaranteed and would be
non-portable.
More often, these things are handled via non-standard libraries, which may
be supplied with your implementation or by third parties.
In any case, they would not be topical here, since there is nothing in the
C standard that can be appealed to for us to decide what ought to be
happening. If your goal includes maximizing where such programs could be
run, it may be best to look for a library with BSD-functionality. Not only
would these generally be portable to Unix-like systems, but such libraries
exist for Windows (or just DOS) and Mac platforms. Discussion of problems
with them belongs, of course, somewhere other than comp.lang.c.