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

📄 pdureport.java

📁 首先在串口上连接一个或者多个MODEL(简单的说就是可以收发短信的手机)
💻 JAVA
字号:

public class PduReport extends PduData {
	//fcs 在提交短信报告中,就是短信的MR
	protected String DischargeTime;
	protected int  Status;
	public    String Report;
	
	public PduReport(PduSms mainBody) throws Exception
    {
    	super(mainBody);
    }
    protected void DecodeSMS()  throws Exception 
    {
    	String pdu=MainBody.UD;
    	DischargeTime=PduUtil.SwapByte(pdu.substring(0,14));
    	Status=PduUtil.ReadByte(pdu,14);
    	switch(Status)
    	{
    	case 0:Report="Short message received by the SME";break;
    	case 1:Report="Short message forwarded by the SC to the SME but the SC is unable to confirm delivery"; break;
    	case 2:Report="Short message replaced by the SC";break;
    	default:
    	  int v=Status&0xC0/64;
    	   switch (v)
    	   {
    	   case 1:Report="Temporary error,SC still trying to transfer SM";break;
    	   case 2:Report="Permanent error,SC is not making any more transfer attempts";break;
    	   case 3:Report="Temporary error,SC is not making any more transfer attempts";break;
    	   default:
    		     Report="Reserved error";
    		   break;
    	   }   //switch
    	
    	 break;
    	
    	}  //switch
 	  Msg=Report;	
    }//end DecodeSMS
     
    public String getDischargeTime()
    {
    	return PduUtil.getTime(DischargeTime);
    }
    public String toString()
    {
    	 String str=MainBody.OA +"  "+MainBody.getSCTS()+"  "+SmsType+"\r\n "
    	      +getDischargeTime()+" Report "+Report;
  	   return str;
    }
}

⌨️ 快捷键说明

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