Short message

xiaoxiao2021-03-06  81

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 related to the SMS-related GSM AT instructions as shown in Table 1: Table 1 The relevant GSM AT command has three implementation paths for SMS: block mode; text mode based on AT command; based on AT command PDU Mode. 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 = , the screen displays Siemens. Typically, the test command AT cmgs =? , if OK is returned, the phone supports this instruction. The full language format of the instruction is as follows: if PDU MODE ( CMGF = 0) cmgs = PDU IS Given If the short message format instruction AT CMGF is 0, the SMS format is PDU Mode, then execute the AT CMGS = command, the phone returns ">" symbol and wait for input, enter the PDU data and ends with the ^ z or ESC key.

If the information is sent successfully, return OK, and display the information number: cmgs: Returns the following information: CMS Error: PDU Data Format The following is the information stored in the phone Analysis to introduce the data format of the SMS PDU. First, write a short message with your mobile phone, send the mobile phone number 13605696031, the information content is "Hello World!". This article can be read by executing AT CMGL = 2. The operation process is as follows (the oblique character is a response information, {} is noted): AT OK AT CMGL = 2 {Read Not Short Information} cmgl: 1, 2, 24 {1 Representation Information Number, 2 indicates that the information is not sent, 24 indicate total information} 08 91 683108501505f0 11 00 0b 81 3106656930f1 0000A7 0B E8329BFD06DDDF723619 OK Next analysis This information: 08: Short message center address length. 91: Short message center number type, 91 is Ton / NPI. 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.

转载请注明原文地址:https://www.9cbs.com/read-107975.html

New Post(0)