Reputation: 10658
does ansi c allows serial communication on rs232 null modem?
if yes then any one give me example?
thanx in advance
Upvotes: 1
Views: 1084
Reputation: 12019
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 open
ing a device node, using ioctl
to configure it (baud rate etc), then you can simply read
and write
on the open file descriptor.
Upvotes: 2
Reputation: 104198
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).
Upvotes: 10