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

📄 getuserloc.java

📁 中国移动定位引擎的客户端
💻 JAVA
字号:
/**
* <p>Title: Smgp协议解析</p>
* <p>Description: SMGW 向MSP 下发短消息的操作包</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.le.message.tlv.TLVTable;

public class GetUserLoc extends LeMessage {
	private TLVTable Isdn=null;
	
/*	0:CURRENT 当前的位置---缺省值
	1:LAST 最近的位置
	2:CURRENT_OR_LAST 当前或最近
	3:INITIAL 在紧急呼叫中,呼叫建立时的位置*/

	private int LocType=0;
	private int lenLocType=4;
	public GetUserLoc() {
        super(GetUserLoc);
    }
	
	
	
	
	
	public int getBodyLength() {
	    int len = lenLocType;
	    if(Isdn!=null){
	    	len+=Isdn.getLength();
	    }
        return len;
     }
	
	
	/**
     * 读取协议包的包体
     * @param buf ByteBuffer
     * @throws MessageParseException
     * @return boolean
     */
    protected boolean readBody(ByteBuffer buf) throws
            LeProtocolException{
    	LocType=buf.getInt();
     	int l = PackLength -HEADER_LENGTH-getBodyLength();
    
    	if (l>0){
    		 byte[] byteTmp=new byte[l];
				buf.get(byteTmp);
				Isdn = new TLVTable();
				Isdn.readFrom(byteTmp,0,l);
    		}
    	return true;
    }


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

    	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("GetUserLoc:");
	    sb.append(super.toString());
	    
	    sb.append("Isdn");
        sb.append("=");
        if(Isdn!=null){
            sb.append(Isdn.toString());
            }
        sb.append(" ");
        
        sb.append("LocType");
        sb.append("=");
        sb.append(LocType);
        sb.append(" ");
               
        return sb.toString();
        
    }





	public TLVTable getIsdn() {
		return Isdn;
	}





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





	public int getLocType() {
		return LocType;
	}





	public void setLocType(int locType) {
		LocType = locType;
	}





	
	
}

⌨️ 快捷键说明

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