sprintf() and siginterrupt() portability problems fixed.
[mdsms.git] / mdsms.1.in
1 .TH SMS9110 1 "7 Sep 1999" ~    VERSION ~ "SMS9110 Manual"
2
3 .\~ $Id$
4
5 .SH NAME
6 sms9110 \- send SmartMessaging SMSes through Nokia 9110
7
8 .SH SYNOPSIS
9 .B sms9110
10 .RB [ "-c <cfgfile>" ]
11 .RB [ "-d <device>" ]
12 .RB [ "-L <file>" ]
13 .RB [ "-b <rate>" ]
14 .RB [ "-l <lockfile>" ]
15 .RB [ "-s <smsc #>" ]
16 .RB [ "-m <#>" ]
17 .RB [ "-r <sec>" ]
18 .RB [ "-t <msec>" ]
19 .RB [ "-T <msec>" ]
20 .RB [ "\-vhV" ]
21 .RB [ "<dest. phone>" ]
22 .RB [ "<logo filename>" ]
23 .RB [ "<GSMnet id>" ]
24
25 .SH DESCRIPTION
26 Program sends one SmartMessaging SMS through Nokia 9110 device.
27
28 .SH OPTIONS
29 .TP
30 .BR -c | --config\  < cfgfile >
31 Process recursively this file and read all options from it. See the section
32 .B CONFIGURATION
33 for more information.
34 .TP
35 .BR -d | --device\  < device >
36 Specify serial device to communicate with Nokia. If only bare name is
37 specified, "\fB/dev/\fP" is prepended automatically. This device name is used
38 subsequently with
39 .BR -l | --lockfile
40 option, see below.
41 .TP
42 .BR -L | --log\  < file >
43 Log all important messages to this file preceded by timestamp, machine hostname
44 etc., similar to output of
45 .BR syslogd (8).
46 If set to empty string (which is default - ~\fB DEF_LOGNAME     \fP~), nothing
47 is logged anywhere.
48 .TP
49 .BR -b | --baud\  < rate >
50 Sets custom baudrate for accessing Nokia modem. Supported speeds are currently:
51 \fB2400\fP,
52 \fB4800\fP,
53 \fB9600\fP,
54 \fB19200\fP,
55 \fB38400\fP,
56 \fB57600\fP. Default is \fB     DEF_BAUD        \fP.
57 .TP
58 .BR -l | --lockfile\  < lockfile >
59 Prior to accessing serial device specified above the lockfile should be
60 acquired for correct concurrent processes behaviour. Although this name
61 can be given as direct filename more common method is to use pattern
62 with embedded "\fB%s\fP" where this mark is replaced by actual basename
63 (last component of pathname with all preceding directory names stripped)
64 of serial device used.
65 Default name for lockfile is ~\fB       DEF_LOCKFILE    \fP~.
66 .TP
67 .BR -s | --smsc\  < smsc\ # >
68 Specify custom SMS center number. If not specified (or overriden as empty
69 string by \fB-s ""\fP)
70 .B sms9110
71 asks by "\fBAT+CSCA?\fP"
72 Siemens A1 for its default SMS center. Situation with undeterminable SMS center
73 is unrecoverable and casues immediate fail. It is a common practice to use
74 plus sign ("\fB+\fP") to indicate international number type.
75 Known SMS centers as of May 1999:
76 .RS
77 .TP
78 .BR "CZ Paegas " ( "230 01" "): " +420603052000
79 .TP
80 .BR "CZ EuroTel " ( "230 02" "): " +420602909909
81 .RE
82 .TP
83 .BR -m | --maxretry\  < # >
84 Maximum retries of any \fBAT\fP-style command during the session. All the
85 retries are summed during one run of
86 .B sms9110
87 and no more retries of the command are permitted. After exceeding this
88 value the program is terminated.
89 .TP
90 .BR -r | --readtime\  < sec >
91 Maximum response read timeout before command retry.
92 .B sms9110
93 sends the requested \fBAT\fP-style command to
94 .B Nokia
95 and expects response. After exceeding this time interval,
96 .B sms9110
97 reissues the last command until the maximum retry count (\fBmaxretry\fP) is exhausted.
98 Standard value is
99 .BR DEF_READTIME
100 seconds and should be enough for standard
101 .B Nokia
102 responses.
103 .TP
104 .BR -t | --chartime\  < msec >
105 Although the fixed used baudrate of
106 .B 19200
107 is pretty low, MobilDock/Siemens A1 couple
108 .RB "aren't"
109 able to accept steady
110 stream of data at this speed. Even the used XON/XOFF handshaking is just not
111 enough. The only possible workaround is to slowdown the communication by
112 waiting a bit after character sent to give relax time to these devices.
113 When full rate communication was used, occasional longer SMS data corruption
114 was observed. Argument is given in milliseconds and its default value is
115 .BR DEF_CHARTIME ms.
116 \fB(This paragraph\fP
117 .BR "doesn't"
118 \fBapply to Nokia 9110 but the functionality has been
119 retained just to be on the safe side.)\fP
120 .TP
121 .BR -T | --cmdtime\  < msec >
122 This delay is given before sending any
123 .B AT-style
124 command to Nokia.
125 Its primary purpose is to let any previous entered commands to finish and
126 to clear any input before actually sending our own command. Also all Siemens
127 devices are known that they strongly dislike fast edge-to-edge communication
128 and to satisfy these requirements this delay was considered as the best
129 approach.
130 \fB(This sentence\fP
131 .BR "doesn't"
132 \fBapply to Nokia 9110 but the functionality has been
133 retained just to be on the safe side.)\fP
134 The default value is
135 .BR DEF_CMDTIME ms.
136 .TP
137 .BR -v | --verbose
138 Increase verbosity level by one. Currently the maximum defined level is
139 .BR 3 ,
140 the default value is
141 .BR 0 .
142 .TP
143 .BR -h | --help
144 Give short parameters description to
145 .I stderr
146 (standard error output stream).
147 .TP
148 .BR -V | --version
149 Print the version number and exit.
150 .TP
151 .RB < "dest. phone" >
152 This mandatory parameter specifies the telephone number of the recipient
153 of SmartMessaging message. International prefix character plus
154 .RB ( + )
155 is supported the national mode without plus
156 .RB ( + )
157 prefix is supported and the meaning is specific to the GSM operator currently
158 being roamed in (NOT the native
159 .RB "'home'"
160 operator of the SIM card!).
161 This number can be made default in system configuration files, see below
162 for section
163 .BR CONFIGURATION .
164 .TP
165 .RB < "logo filename" >
166 Here you specifify the filename of the logo file to be uploaded. Currently
167 recognized file formats are \fBNOL\fP (Nokia logo?) and \fBNGG\fP (Nokia
168 Group Graphics). These formats are proprietary by \fBKESSLER Wireless Design\fP
169 and \fBsms9110\fP currently "can't" edit them. More info can be found on:
170 .RS
171 .B http:/       /www.kessler-design.com/wireless/operatorlogo.php3
172 .RE
173 .TP
174 .RB < "GSMnet id" >
175 Specify GSM network code to be set on the logo being uploaded. Upon upload to
176 Nokia phone each operator logo has a GSM network code binded with it. When
177 you are registered (even roamed) into such network the logo is displayed on
178 the phone. Current Nokia mobile phones can handle only one logo loaded
179 simultaneously, it will be rewritten by any other upload. You can also
180 specify string ~\fB     WORD_GROUP      \fP~ to send the logo as group graphics
181 (even from \fBNOL\fP format) or string ~\fB     WORD_NET        \fP~ to force detection
182 of network code from \fBNOL\fP. The default if this parameter is not specified
183 is ~\fB WORD_NET        \fP~ for \fBNOL\fP files and ~\fB       WORD_GROUP      \fP~ for
184 \fBNGG\fP files.
185
186 .SH CONFIGURATION
187 .B sms9110
188 reads ~\fB      CONFIG_MAIN     \fP~ followed by ~\fB$HOME      CONFIG_HOME     \fP~
189 configuration files. The content of these files (and also any file read by
190 .BR -c | --config
191 option)
192 has the usual
193 .BR getopt (3)
194 syntax with dashes. Newlines are taken as whitespace, both double ("\fB~\fP")
195 and single ("\fB'\fP")
196 quoting is supported. Embedded quote characters can be escaped by backslash
197 ("\fB\\\fP").
198 Arguments are processes in order as specified in configuration files and
199 finally the command-line of the program itself, overriding any previous
200 values.  Although the order of
201 .BR -c | --config
202 options on one line is preserved the first file is read AFTER all of the
203 current options are processed. Recursive use of
204 .B -c
205 is permitted and the files are read in LIFO (Last-In First-Out, AKA stack)
206 order. You should use "\fB-v -v\fP"
207 to see details of option processing with more complex configuration setups.
208
209 .SH OPERATION
210 Upon startup
211 .B sms9110
212 locks the port (see option
213 .BR -l | --lockfile
214 for details) and opens the serial device with specified baudrate (default
215 \fB     DEF_BAUD        \fP baud), software handshaking (XON/XOFF style), 8 bits,
216 no parity. Then issues the following commands:
217 .TP
218 .BR AT <ESCAPE>
219 .B AT
220 is used to fool Nokia and pass the following
221 .B <ESCAPE>
222 (ascii decimal code 27) character to Nokia and break it from eventual
223 .B AT+CMGS
224 mode in which it may errorneously remain from previous sessions.
225 .TP
226 .B AT
227 Test the responsiveness of Nokia.
228 .TP
229 \fBAT+CSCA="\fPsmc # from user\fB"\fP
230 This command is omitted if
231 .B "smsc #"
232 is not specified by user (or specified/overriden as empty string \fB""\fP
233 .TP
234 \fBAT+CSCA?\fP
235 Query the currently set SMC center number to detect possibly unset SMS center.
236 .TP
237 \fBAT+CSMP=81,,0,245\fP
238 Sets PDU type to 81 (\fBSMS-SUBMIT\fP + integer-type for \fBvalidity\fP
239 + \fBUDHI\fP - user data header indicator), PID (protocol identifier) to
240 0 (standard non-converted SMS) and DCS (data coding scheme) to 0xF5
241 (\fBdata coding\fP/\fBmessage class\fP, \fB8-bit data\fP + \fBmobile-equipment\fP
242 specific).
243 .TP
244 \fBAT+CMGS="\fPphone # from user\fB"\fP
245 This command physically sends the message and the resulting "\fB+CMGS:\fP" output
246 is catched and returned as
247 .B MR
248 (message reference) number to the user.
249 .TP
250 \fBAT+CSMP=17,,0,0\fP
251 Resets back PDU type to 17 (\fBSMS-SUBMIT\fP + integer-type for \fBvalidity\fP),
252 PID (protocol identifier) to 0 (standard non-converted SMS) and DCS (data coding
253 scheme) to 0 (\fBalphabet indication\fP, \fBdefault 7-bit alphabet\fP).
254 .TP
255 \fBAT\fP
256 Check that Nokia survived the sending of the message.
257
258 .SH SEE ALSO
259 .TP
260 .B GSM 03.40
261 ETSI documentation for SMS messages in GSM networks
262 .TP
263 .B GNokii, tools and drivers for Nokia mobile phones
264 Nokia logo data format was read from its sources:
265 .B http:/       www.gnokii.org/
266 .TP
267 .B "Developers'" Guide: SMS with the A1
268 Tech note on PDU SMS format etc:
269 .B http:/               /www.siemens.se/telefoner/ovrigtgsm/fragorsvar/a1_sms.pdf
270 .TP
271 .B Technical Description of the Siemens A1
272 Siemens A1 command description
273 .B http:/               /www.siemens.se/telefoner/ovrigtgsm/fragorsvar/a1_manual.pdf
274
275 .SH FILES
276 .TP
277 \fB     CONFIG_MAIN     \fP
278 Main configuration file
279 .TP
280 \fB$HOME        CONFIG_HOME     \fP
281 User personalized local configuration file
282
283 .SH AUTHOR
284 .B sms9110
285 was written by Jan Kratochvil who should be responsible for all the bugs
286 included. Please see the file "\fBAUTHORS\fP"
287 shipped with the original distribution archive for more details.