aboutsummaryrefslogtreecommitdiff
path: root/atinout.1
blob: bfb69f727fa438c1e7d55db556067ee6da9d7b1f (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ATINOUT" "1" "September 2013" "" ""
.
.SH "NAME"
\fBatinout\fR \- Send AT commands to modem, capturing the response
.
.SH "SYNOPSIS"
\fBatinout\fR \fIinput_file\fR|\fB\-\fR \fImodem_device\fR \fIoutput_file\fR|\fB\-\fR
.
.br
\fBatinout\fR \fB\-\-version\fR
.
.br
\fBatinout\fR \fB\-\-usage\fR
.
.br
\fBatinout\fR \fB\-\-help\fR
.
.br
.
.SH "DESCRIPTION"
\fBAtinout\fR reads a list of AT commands\. It sends those commands one by one to the modem, waiting for the final result code for the currently running command before continuing with the next command in the list\. The output from the commands is saved\.
.
.P
Notice that \fBatinout\fR is strictly about sending AT commands only; it cannot be used for AT commands that expect additional input data (e\.g\. AT+CMGS etc)\.
.
.SH "FILES"
\fBAtinout\fR expects \fIinput_file\fR to be a list of AT command to be run\. If the file name \fB\-\fR is used then standard input is read\.
.
.P
Although the above states a list of AT commands it is actually not just a list of command but more generally a list of AT command lines\. However the rest of the man page will just refer to AT commands; running several commands in one command line offers no benefits, and if one of them fails you have no idea of which one failed\. So unless maybe for a single run on the command line (see EXAMPLES), I recommend against putting more than one command on each command line\.
.
.P
And if the distinction between AT command and AT command line was not something you were deeply familiar with you should read the ITU V\.250 specification about AT commands\. In fact, unless you already have read V\.250 before, you absolutely should go to http://www\.itu\.int/rec/T\-REC\-V\.250\-200307\-I/en and do so right away\.
.
.P
The modem is identified with \fImodem_device\fR (e\.g\. /dev/ttyS0 (COM1), /dev/ttyACM0 (USB phone serial interface), \.\.\.)\. No serial configuration (e\.g\. speed, parity) is done before opening the device\.
.
.P
The responses from the AT commands are written to \fIoutput_file\fR, or standard output i the file name \fB\-\fR is given\.
.
.SH "OPTIONS"
The following list of options are supported:
.
.TP
\fB\-h\fR, \fB\-\-help\fR
Prints explanation and gives an example on usage\.
.
.TP
\fB\-\-usage\fR
Prints information about arguments and options\.
.
.TP
\fB\-\-version\fR
Print version information\. If this is the only option given, also prints copyright/licensing information\.
.
.SH "EXAMPLES"
Check that the modem is connected and alive\.
.
.IP "" 4
.
.nf

$ echo AT | atinout \- /dev/ttyACM0 \-
AT
OK
$
.
.fi
.
.IP "" 0
.
.P
Hang up any calls\.
.
.IP "" 4
.
.nf

$ echo ATH | atinout \- /dev/ttyACM0 \-
ATH
OK
$
.
.fi
.
.IP "" 0
.
.P
Query how many entries the phone book has for ME storage\.
.
.IP "" 4
.
.nf

$ echo \'AT+CPBS="ME"; +CPBR=?\' | atinout \- /dev/ttyACM0 \-
AT+CPBS="ME"; +CPBR=?

+CPBR: (1\-7000),80,62

OK
$
.
.fi
.
.IP "" 0
.
.P
Backup all phone numbers\. This will most likely not be the same as a full backup of all contact information, but at least the names and numbers are saved which is the most vital information\.
.
.IP "" 4
.
.nf

$ cat > save\-phonebooks <<EOF
AT+CSCS="UTF\-8"
AT+CGMI
AT+CGMR
AT+CPBS="SM"
AT+CPBR=1,240
AT+CPBS="ME"
AT+CPBR=1,7000
EOF
$ atinout save\-phonebooks /dev/ttyACM0 phonebook_backup\.`date "+%Y\-%m\-%d_%H\-%M"`
$
.
.fi
.
.IP "" 0
.
.P
List current calls\. The information text format is (see 27\.007 for details):
.
.IP "" 4
.
.nf

+CLCC: <id1>,<dir>,<stat>,<mode>,<mpty>[,<number>,<type>[,<alpha>[,<priority>]]]

# No active calls
$ echo AT+CLCC | atinout \- /dev/ttyACM0 \-
AT+CLCC
OK
$

# One active call
$ echo AT+CLCC | atinout \- /dev/ttyACM0 \-
AT+CLCC
+CLCC: 1,0,3,0,0,"0123456789",129,"",0

OK
$
.
.fi
.
.IP "" 0
.
.SH "ENVIRONMENT"
No environmental variables are used\.
.
.SH "BUGS"
\fBAtinout\fR does not support reading response lines longer than 4095 characters\.
.
.P
\fBAtinout\fR does not do any serial port configuration, it just opens the device as is\.
.
.SH "COPYRIGHT"
Atinout is Copyright (C) 2013 Håkon Løvdal \fIhlovdal@users\.sourceforge\.net\fR
.
.SH "SEE ALSO"
V\.250 (http://www\.itu\.int/rec/T\-REC\-V\.250\-200307\-I/en), 27\.007 (http://www\.3gpp\.org/ftp/Specs/html\-info/27007\.htm), 27\.005 (http://www\.3gpp\.org/ftp/Specs/html\-info/27005\.htm)