-
Notifications
You must be signed in to change notification settings - Fork 909
/
libsms_modem.h
55 lines (35 loc) · 1.29 KB
/
libsms_modem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
SMS Server Tools
Copyright (C) 2000 Stefan Frings
This program is free software unless you got it under another license directly
from the author. You can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation.
Either version 2 of the License, or (at your option) any later version.
http://www.isis.de/members/~s.frings
mailto:s.frings@mail.isis.de
*/
#ifndef _LIBSMS_MODEM_H
#define _LIBSMS_MODEM_H
#include <termios.h>
#include "sms_funcs.h"
#define MODE_OLD 1
#define MODE_DIGICOM 2
#define MODE_ASCII 3
#define MODE_NEW 4
#define READ_SLEEP 10000
#define READ_TIMEOUT 10
typedef int (*cds_report)(struct modem *, char *, int);
/* put_command
Sends a command to the modem and waits max timeout*0.1 seconds for an answer.
The function returns the length of the answer.
The answer can be Ok, ERROR or expect.
The command may be empty or NULL */
int put_command(struct modem *mdm, char *command, int clen, char *answer,
int max, int timeout, char *expect);
int setmodemparams(struct modem *mdm);
int checkmodem(struct modem *mdm);
int initmodem(struct modem *mdm, cds_report cds_report_f);
int setsmsc(struct modem *mdm, char *smsc);
int openmodem(struct modem *mdm);
int closemodem(struct modem *mdm);
#endif