Description
Parameters
Return codes
Examples
Changes and modifications
Document revisions
The sendsms.exe program is used for sending text SMS by means of GSM modems. Tested by using a GSM modem of the Ericsson GM12 type. Modem must support AT set of commands for work with SMS according to the ETSI GSM 07.05 standard.
Command line parameters:
sendsms TO: number SCA: number [PIN: number] [-h TcpHost] [-p TcpPort] -m messfile | "message"
Parameter | Description |
---|---|
TO: number | Number of a GSM mobile phone along with the GSM operator prefix. E.g. the GSM Orange-SK number 0905/432454 must be entered as 0905432454. Required parameter. |
SCA: number | Number of a message center for sending messages. The number must be defined in the full format along with the character "+" before the number. Message center number of Orange-SK must be defined as +421905303303, T-mobile SK as +421903333000 and O2-SK as +421949909909. Required parameter. |
PIN: number | If SIM card is blocked by a PIN code, it must be defined by means of the parameter. |
-h TcpHost | If AT commands are not sent via serial line, parameter defines host whit which the utility should create TCP connection. |
-p SerialPort/TcpPort | Serial communication port entered in the form of COMx (e.g. COM2). In case of TCP communication, this parameter defines TCP port, to which the utility is to be connected. |
-m messfile | Contents of the SMS message to send is stored in the file messfile. |
"message" | Contents of the SMS to sent. If a sequence \n is in the message, the sequence will be replaced by the characters CR and LF. |
Note: For sending a message, there must be defined either the parameter message or -M messfile. Parameters are evaluated from the left to the right.
Return code | Meaning |
---|---|
0 | OK, error-free SMS transmission. |
1 | Incorrect or missing parameter, the program lists the error specification. |
2 | Serial port error (doesn't exist, busy, etc.). |
3 | GSM modem is not connected to given port or is not running. |
4 | Error when entering a PIN code (invalid PIN code). |
5 | Error when the modem executes AT commands. The program lists the error specification. |
6 | SMS message probably was not sent in order. |
7 | Problem when initiating physical interface (serial / TCP/IP). |
Sending a SMS to the GSM Orange-SK number of 0905111222 via the Orange-SK message center number +421905303303, message contents is defined in the command line:
sendsms PIN: 1234 TO: 0905111222 SCA: +421905303303 ”This is a SMS contents”
Sending a SMS to the GSM Orange-SK number of 0905333444 via the Orange-SK message center number +421905303303, message contents is stored in the file C:\Messages\sms1.txt :
sendsms PIN: 1234 TO: 0905333444 SCA: +421905303303 –m C:\Messages\sms1.txt