39 lines
617 B
C
39 lines
617 B
C
|
|
/*
|
||
|
|
* wecker.c
|
||
|
|
* Kommuniziert mit dem Modem
|
||
|
|
*
|
||
|
|
* Version 1.00
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <stdio.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
#include <sys/time.h>
|
||
|
|
#include <sys/types.h>
|
||
|
|
#include <unistd.h>
|
||
|
|
#include <sys/ioctl.h>
|
||
|
|
#include <termios.h>
|
||
|
|
#include <fcntl.h>
|
||
|
|
#include <signal.h>
|
||
|
|
#include <ctype.h>
|
||
|
|
#include <syslog.h>
|
||
|
|
|
||
|
|
|
||
|
|
int main(int argc, char *argv[])
|
||
|
|
{
|
||
|
|
int fd = 0;
|
||
|
|
|
||
|
|
|
||
|
|
if ((fd = open("/dev/modem", O_RDWR | O_NDELAY)) == -1)
|
||
|
|
{
|
||
|
|
perror("open failed!");
|
||
|
|
return 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ( write (fd, "AT&F1X3DT23\r", 13)==-1)
|
||
|
|
{perror ("write failed!");}
|
||
|
|
|
||
|
|
close(fd);
|
||
|
|
return 1;
|
||
|
|
}
|