⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tp_address.java

📁 试用JAVA通过COMM口发送短信的代码.
💻 JAVA
字号:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   TP_Address.java

package org.cross.sms.msg;


// Referenced classes of package org.cross.sms.msg:
//            TP_Element_Inter, _CharacterUtil, SMSGSMEncoding

public abstract class TP_Address
    implements TP_Element_Inter
{

    public TP_Address()
    {
        init();
    }

    public void readPdu(String pdu)
    {
        m_len = Integer.parseInt(pdu.substring(0, 2), 16);
        m_pdu = pdu.substring(0, getTotalLength());
        if(m_len > 0)
        {
            m_type = m_pdu.substring(2, 4);
            m_code = m_pdu.substring(4);
            int addr = Integer.parseInt(m_type, 16);
            if((addr & 0x40) != 0 && (addr & 0x20) == 0 && (addr & 0x10) != 0)
            {
                String str1 = _CharacterUtil.hexToString(m_code, "gsm_default");
                String originator = "";
                for(int i = 0; i < str1.length(); i++)
                    if(str1.charAt(i) == '\033')
                        originator = originator + SMSGSMEncoding.hex2ExtChar(str1.charAt(++i), 1);
                    else
                        originator = originator + SMSGSMEncoding.hex2Char(str1.charAt(i), 1);

                m_code = originator;
            } else
            {
                m_code = _CharacterUtil.toBCDFormat(m_code);
                if(m_code.endsWith("F"))
                    m_code = m_code.substring(0, m_code.length() - 1);
            }
        }
    }

    public String getPdu()
    {
        return m_pdu;
    }

    protected void init()
    {
        m_code = "";
        m_len = 0;
        m_type = "";
        m_pdu = "00";
    }

    public abstract int getTotalLength();

    public abstract void setPhone(String s);

    String m_code;
    String m_type;
    String m_pdu;
    int m_len;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -