At present, the application of mobile phone short messages is increasing, there are more and more sites sent by short messages on the Internet, but some sites are not satisfactory, often sending short messages on the sea. The most reliable transmission method is of course the mobile phone in your hand. If the status report is set, it is more exactly whether the other party has received this information. The phone is transmitted, although it is more reliable, there is also a problem that is incurred, low efficiency. This article describes a method as long as the phone can be connected to the computer (through the infrared port or connect the serial port with the mobile phone data cable, the mobile phone supports the GSM AT instruction set), you can send the software through the short message to send the software through its own short message. send.
Most of the mobile phones now supports a GSM AT instruction set similar to MODEM control, which is developed by Nokia, Ericsson, Motorola and HP and other manufacturers, which contains SMS (Short Message Service). control. The GSM AT-related instructions are shown in Table 1 of the GSM AT instructions related to SMS:
Table 1 The relevant GSM AT instructions have three implementation paths for SMS: block mode; text mode based on AT command; PDU Mode based on AT command. Text Mode is relatively simple, and a plurality of Nokia phones support this mode. Most of the Siemens mobile phone only supports the PDU mode. The PDU mode is a method of transmitting or receiving mobile SMS information, and the short message body is transmitted after hexadecimal encoding. Currently, the PDU has replaced Block Mode, so this paper mainly explores the transmission of PDU mode. Communication for computers and mobile phones This article describes Siemens S3568i as an example, describes how to achieve short message transmission. The data cable is first connected to the computer serial line port by S35 / 25 data line. Then, open the hyper terminal, select the direct serial port connection, the port parameter is set to 19200 rate, no check, data bit 8, stop bit 1. Infrared connection If you use a computer with an infrared port, you can set the wireless connection with your phone. First confirm that the computer's infrared port has been opened, and the infrared port of the phone is opened, the infrared port, the infrared port, the computer system tray should appear on the Siemens S35 (if no infrared monitor is installed). Then, open the HyperTerminal, select the serial port on the IRDA. Connection Test Click the call button on the Hyper Terminal Toolbar, enter the AT and Enter. If OK occurs on the screen, it indicates that the connection to the computer is successful, then you can enter all kinds of GSM AT instructions. Such as: Query mobile phone manufacturers, enter AT CGMI =
Ton / NPI complies with the International / E.164 standard, refers to the number of ' ' before the number; there can be other values, but 91 is most common. 683108501505F0: Short message number is the service center address used. Due to the slightly processing, the actual number should be: 8613805515500 (the letter F means the length is 1), which is the number of the author's GSM Short Message Center. 11: Document header bytes (Header Byte, is a bitmask). Here 11 refers to normal transmission of short information. 00: Information type. 0b: The length of the called number. 81: The called number type. 3106656930f1: The called number, has also been displaced, the actual number is 13605696031. 0000A7: Short message encoding type GSM Default alphabet, if Chinese is 000010. 0B: Short message length. E8329BFD06DDDF723619: Short message content "Hello World!". Short message encoding method and programming Implementation Let's introduce the information encoding method of pure English and pure Chinese. By testing we found that the front portion of each transmitted message is the same, but the called number and short message content change. 1. See Table 2 in English Coding, Show Short Message Content is "Hello World!". The default GSM character set can be 7-bit encoding. It can be simply understood as the ASCII code (the ASCII value is less than 80 HEX, so Bit8 is ignored), and the next 7 digits encoded will move to the front, form new 8-bit coding, see Table 2 Arrow Indication. It should be noted that the 9th line, the shift count has reached 7 bits, and the encoded is added directly to 0. GSM does not support all ASCII characters. The implementation of English coding is the other Delphi 5 code to implement English code: // English format encoding, S is String Function Encode1 (var s: string): String; Var i, J, Len: Integer; Cur: Integer ; t: string; begin result: = '; len: = length (s); // j is used for shift count i: = 1; j: = 0; while i <= len do begin if i