Serial Communications in ASCII

E

Ewan Sinclair

Sorry if this question seems naive, but I'm a bit new to C:

I would like to write something that can send and receive ASCII characters
over a serial port, then pass them somewhere else for interpretation.

All the resources I have been able to find are vague or don't have anything
C specific. Would anyone be able to point me to a good resource page? Also,
if anyone knows of any free code I can use for this, that'd be nice too.

Am I likely to need any extra libraries for C, or is serial port control
built in at some level?

Ewan
 
M

Mark Gordon

Sorry if this question seems naive, but I'm a bit new to C:

I would like to write something that can send and receive ASCII
characters over a serial port, then pass them somewhere else for
interpretation.

All the resources I have been able to find are vague or don't have
anything C specific. Would anyone be able to point me to a good
resource page? Also, if anyone knows of any free code I can use for
this, that'd be nice too.

Am I likely to need any extra libraries for C, or is serial port
control built in at some level?

C as defined by the ISO standard does not include support for the serial
port. Depending on your OS and requirements you *may* be able to treat
the serial port as a file, e.g. COM1: or /dev/ttyS0 etc, however this is
limited and Off Topic for this group.

Your best bet is to ask on a group dedicated to your platform (Windows,
Unix or whatever) where people may be able to point you in the direction
of relevant documentation.

Also, the C language does not mandate the use of ASCII and
implementations *do* exist that use other character sets.
 
M

Mark McIntyre

Sorry if this question seems naive, but I'm a bit new to C:

I would like to write something that can send and receive ASCII characters
over a serial port, then pass them somewhere else for interpretation.

Communication via the serial port is very hardware specific and not
part of C . You will have to ask in a group specialising in your
hardware or compiler platform.
All the resources I have been able to find are vague or don't have anything
C specific.

Thats because its not a feature of C, but of specific hardware.
Am I likely to need any extra libraries for C, or is serial port control
built in at some level?

C has no builtin control for serial ports, however many
implementations do. Read your compiler manual for morew info, or ask
in a group specialising in it.
 

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,020
Latest member
GenesisGai

Latest Threads

Top