hi guys,
i have to createa program in C which talks 2 modem-to-modem connection
this can be done using AT
buthow do i use AT command in C???
ivesearched on net butcant find anything
hi guys,
i have to createa program in C which talks 2 modem-to-modem connection
this can be done using AT
buthow do i use AT command in C???
ivesearched on net butcant find anything
Tell us which OS and Compiler you're using.
C can do this, but there is no standard answer you can simply plug in and use.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
it is for linux
and i am using cygnos g++
i got bloodshed also but it sux cuz gaveme errors with my previous programs so im not gonna use it
> it is for linux
The whole of linux's access to the outside world is through device drivers, and they can all be found within the "/dev" directory.
If I remember, the first serial port is accessed through "/dev/ttyS0"
So it might look something like this
Code:#include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> int main ( ) { int fd; fd = open( "/dev/ttyS0", O_RDWR ); if ( fd != -1 ) { char *reset = "ATZ"; int n; n = write( fd, reset, strlen(reset) ); if ( n == -1 ) { perror( "Write failed" ); } close( fd ); } else { perror( "Can't open serial port" ); } return 0; }
> i got bloodshed also but it sux cuz gaveme errors with my previous programs so im not gonna use it
Perhaps if you posted some code, we could tell you where the real problem lies.
Many people use it quite successfully.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
it givesme error when i have this
input.open(argv[1], ios_base::binary);
butwith gnu it works fine
devfs is deprecated in 2.6 kernels.
Last edited by chrismiceli; 08-20-2004 at 06:47 AM.
Help populate a c/c++ help irc channel
server: irc://irc.efnet.net
channel: #c
>>/dev is deprecated in 2.6 kernels.
Linux Devfs (Device File System) FAQ
Serial HOWTO
Serial Programming HOWTO
Modem-HOWTO
gg
oh thnx man helped heaps
i gotta do this project and i mightbuy a book on serial programming
What are you trying to say with that link Codeplug? According to my 2.6.7 kernel, it says that devfs is "OBSOLETE". It says it has been replaced by udev:
Originally Posted by linux-2.6.7
Help populate a c/c++ help irc channel
server: irc://irc.efnet.net
channel: #c
Oops, I thought devfs was the new thing. Been heads-down in Windows for too long (but it pays the bills).
gg