|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 对上线数据进行分析 | 
|---|
|  |  |  | * @param aepImei 电信平台传来的IMEI号 | 
|---|
|  |  |  | * @param upBuf 上行数据 | 
|---|
|  |  |  | * @return OnLineResult | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | OnLineResult parse(String aepImei, byte[] upBuf)throws Exception ; | 
|---|
|  |  |  | OnLineResult parse(byte[] upBuf)throws Exception ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 分析结果 | 
|---|
|  |  |  | 
|---|
|  |  |  | class OnLineResult{ | 
|---|
|  |  |  | public int result ;//分析结果 | 
|---|
|  |  |  | public String protocolName ;//协议名称 | 
|---|
|  |  |  | public String rtuAddr ;//IMEI号 | 
|---|
|  |  |  | public String meterNo ;//水表号 | 
|---|
|  |  |  | public Short protocolVersion ;//协议版本号 | 
|---|
|  |  |  | public String rtuAddr ;//Rtu地址 | 
|---|
|  |  |  | public byte[] remoteData;//需要向Rtu回写的数据 | 
|---|
|  |  |  | public OnLineResult(){ | 
|---|
|  |  |  | result = OnLineAction_fail ; | 
|---|
|  |  |  | rtuAddr = null ; | 
|---|
|  |  |  | meterNo = null ; | 
|---|
|  |  |  | remoteData = null ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final int OnLineAction_fail = 0; //分析上线数据失败,如提供的数据为null等原因 | 
|---|
|  |  |  | public static final int OnLineAction_success = 1; //分析上线数据成功,并能得到IMEI号 | 
|---|
|  |  |  | public static final int OnLineAction_success_noMe = 2; //分析上线数据成功,识别出不是本协议数据 | 
|---|
|  |  |  | public static final int OnLineAction_success_response = 3; //分析上线数据成功,并需要向Rtu回写数据 | 
|---|
|  |  |  | int OnLineAction_fail = 0; //分析上线数据失败,如提供的数据为null等原因 | 
|---|
|  |  |  | int OnLineAction_success = 1; //分析上线数据成功,并能得到Rtu地址 | 
|---|
|  |  |  | int OnLineAction_success_noMe = 2; //分析上线数据成功,识别出不是本协议数据 | 
|---|
|  |  |  | int OnLineAction_success_response = 3; //分析上线数据成功,并需要向Rtu回写数据 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|