tags:

views:

189

answers:

2

does ansi c allows serial communication on rs232 null modem?

if yes then any one give me example?

thanx in advance

+10  A: 

Ansi C has nothing to do with serial communications. ANSI C is a formal description of the C language, it doesn't define libraries. Communicating with an RS-232 modem is possible with C language, but it will be completely different in different platforms (Windows, Linux, embedded processors).

kgiannakakis
+2  A: 

It does, in as much as there's nothing in the language which prevents it, but it depends on your OS/platform to provide access to an appropriate device driver (or an abstraction of one).

For an (elaborate) example, refer to the source to the minicom package (GPL). Something simpler (on a POSIX-like platform) might involve opening a device node, using ioctl to configure it (baud rate etc), then you can simply read and write on the open file descriptor.

crazyscot