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

📄 dstanreport.java

📁 中国移动定位引擎的客户端
💻 JAVA
字号:
/**
* <p>Title: 位置信息管理模块同定位前置的包解析</p>
* <p>Description: 定位前置 向位置信息管理模块返回位置信息报告的操作包</p>
* <p>Company: 福富软件 </p>
* @author chenxin
* @version 1.0 $Date 2007-07-05
*/
package ffcs.lbp.le.message;

import java.io.IOException;
import java.nio.ByteBuffer;

import ffcs.lbp.MessageParseException;
import ffcs.lbp.le.message.tlv.TLVTable;
import ffcs.lbp.le.message.tlv.Tag;

public class DstanReport extends LeMessage {


	private String	 Isdn	=null;
	private int RetType;	
	private int	ShapeType;
	private TLVTable ShapeDesc=null;

	private int lenIsdn=36;
	private int lenRetType=4;
	private int lenShapeType=4;

	
	
	private int lenMessageBody=lenIsdn + lenIsdn+lenRetType
								+ lenShapeType ;
	
	public DstanReport() {
        super(DstanReport);
    }
	
	
	
	
	
	public int getBodyLength() {

	    int len = lenMessageBody ;
	    if (ShapeDesc!=null){
			len+=ShapeDesc.getLength();
		}
    
        
        return len;
       
        
        
        
    }
	
	
	/**
     * 读取协议包的包体
     * @param buf ByteBuffer
     * @throws MessageParseException
     * @return boolean
     */
    protected boolean readBody(ByteBuffer buf) throws
            LeProtocolException{
      	return true;
    }


    /**
     * 读取协议包的包体
     * @param buf ByteBuffer
     * @return boolean
     */
    protected  boolean writeBody(ByteBuffer buf){
    	


    	Isdn=readOString(buf,lenIsdn);
    	buf.putInt(RetType);
    	buf.putInt(ShapeType);
     	if (ShapeDesc!=null){
			try {
				ShapeDesc.writeTo(buf);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
    	return true;
    }

    /**
     * Convert this packet to a String. Not to be interpreted programmatically,
     * it's just dead handy for debugging!
     */
    public String toString() {

        StringBuffer sb=new StringBuffer("Deliver:");
	    sb.append(super.toString());
	    
        sb.append("Isdn");
        sb.append("=");
        sb.append(Isdn);
        sb.append(" ");
        
        sb.append("RetType");
        sb.append("=");
        sb.append(RetType);
        sb.append(" ");
        
        sb.append("ShapeType");
        sb.append("=");
        sb.append(ShapeType);
        sb.append(" ");
        
        sb.append("ShapeDesc");
        sb.append("=");
        sb.append((String)ShapeDesc.get(Tag.ShapeDesc));
        sb.append(" ");
        
        return sb.toString();
        
    }





	public String getIsdn() {
		return Isdn;
	}





	public void setIsdn(String isdn) {
		Isdn = isdn;
	}





	public int getRetType() {
		return RetType;
	}





	public void setRetType(int retType) {
		RetType = retType;
	}





	public TLVTable getShapeDesc() {
		return ShapeDesc;
	}





	public void setShapeDesc(TLVTable shapeDesc) {
		ShapeDesc = shapeDesc;
	}





	public int getShapeType() {
		return ShapeType;
	}





	public void setShapeType(int shapeType) {
		ShapeType = shapeType;
	}
	
	

}

⌨️ 快捷键说明

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