63 lines
1.6 KiB
XML
63 lines
1.6 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<packet name="racal.sunyard.main"
|
|
version="1.0"
|
|
cn="雷卡-信雅达"
|
|
transEncode="ascii"
|
|
:match="match()">
|
|
|
|
racal 指令体系 sunyard 实现
|
|
|
|
<req>
|
|
<length len="2" :final="calcLen()" cn="长度"></length>
|
|
<header len="8" cn="包序号">
|
|
该消息头随后即被无变化地返回给主机。
|
|
通常填充为异步通信的包序号。
|
|
</header>
|
|
<command len="2" index="unique" cn="命令字符"></command>
|
|
<data :value="Map" cn="数据段"></data>
|
|
</req>
|
|
|
|
<res>
|
|
<length len="2" :final="calcLen()" cn="长度"></length>
|
|
<header len="8" cn="包序号">
|
|
该消息头随后即被无变化地返回给主机。
|
|
通常填充为异步通信的包序号。
|
|
</header>
|
|
<command len="2" index="unique" cn="命令字符"></command>
|
|
<data :value="Map" cn="数据段"></data>
|
|
</res>
|
|
|
|
<script>
|
|
function match(){
|
|
|
|
}
|
|
|
|
function calcLen(){
|
|
// 数据段的长度 + 10
|
|
// 低位在前高位在后二进制填充
|
|
int len = $final.getSection("data").getLen();
|
|
len += 10
|
|
|
|
//println("包长 " + len);
|
|
|
|
byte[] ret = new byte[2];
|
|
ret[0] = len / 256
|
|
ret[1] = len % 256
|
|
|
|
return ret
|
|
}
|
|
|
|
|
|
function catchError(e){
|
|
if( "0000".equals(e) || "3030".equals(e) ){
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</packet>
|
|
|
|
|