vb.net encoded PDU in SMS (i.)

Source: Internet
Author: User

The encoder of the PDU works as a reverse process of the decoder. It is relatively straightforward to work with the PDU code sent only by the encoder as required . This article explains the coding idea, the specific code please refer to the Blog pduencoder part

I took The PDU code is divided into two parts,SMS and EMS. the EMS section I only provided the Concatenatedshortmessage encoder. This is the code of the long text message, the most used.

SMS Encoding

encode a SMS generally requires the following information:

Tp_data_coding_scheme tp_ud Encoding method

Tp_destination_address the other number

Tp_message_reference Reference Number

Tp_status_report_request Status Report

Tp_user_data User Information

Tp_validity_priod Validity

Servicecenternumber SMS Center number

so there are the above attributes in the encoder, and the A processing code is added to the set to convert the readable information into the corresponding hexadecimal information.

the special attention is the Tp_user_data property, which automatically sets tp_udl based on user data encoding . For pure English encoding,tp_udl is the number of characters; for Unicode encoding, because one character is represented by two bytes,tp_udl is the number of characters . Note that the length of the Tp_user_data is checked, and the encoded tp_ud length cannot exceed the number of bytes for SMS . In other words , the English characters (140/7*8), Chinese characters .

for Tp_ud code in the decoder also has a description, not to repeat this.

I've also designed several enumeration variables:

Enum_tp_dcs Encoding Method

Enum_tp_sri Status Report

Enum_tp_valid_period Validity

ENUM_TP_VPF Expiration Format

These enumeration variables can simplify the input and also facilitate future expansion.

when the above content is set up, basically a message shelf is out. At this point the call Getsmspducode is combined, the simple hexadecimal stitching together to form a complete PDU code.

Transfer from bbs.sendsms.cn


vb.net encoded PDU in SMS (i.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.