I need help with C for Linux

  • Thread starter =?ISO-8859-1?Q?Jo=E3o_Pires?=
  • Start date
?

=?ISO-8859-1?Q?Jo=E3o_Pires?=

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!

Thks

JP
 
M

Martin Ambuhl

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.
 
K

Kevin Easton

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?

This is actually a Linux programming question rather than a C
programming question (there's no standard "C way" to access the serial
ports, but there are standard "Linux ways" that work in lots of
languages on Linux). So ask away in comp.os.linux.development.apps.

- Kevin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top