sydapi/DProto/7D.xml
2021-06-29 11:32:24 +08:00

128 lines
3.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" ?>
<packet extend="base">
<req>
<command>
<hex>7D</hex>
</command>
<data extend="data">
<hashType len="1" cn="HASH类型">
<options>
<option cn="SHA1">
<hex>0</hex>
</option>
<option cn="SHA256">
<hex>1</hex>
</option>
<option cn="MD5">
<hex>2</hex>
</option>
</options>
</hashType>
<packSn len="1" cn="消息块号">
<options>
<option cn="仅一块">
<hex>0</hex>
</option>
<option cn="第一块">
<hex>1</hex>
</option>
<option cn="中间块">
<hex>2</hex>
</option>
<option cn="最后块">
<hex>3</hex>
</option>
</options>
</packSn>
<dataLength len="4" :value="dataLen()" cn="消息长度">
消息长度。
</dataLength>
<msg cn="消息数据">
二进制的消息块
</msg>
<filterDataLen len="4" :value="filterDataLength()" :if="hasFilterDataLen()" cn="过渡数据长度">
只对“消息块号”为 2、3 时有效
</filterDataLen>
<filterData :if="hasFilterData()" cn="过渡消息数据">
只对“消息块号”为 2、3 时有效
</filterData>
</data>
</req>
<res>
<command>
<hex>7E</hex>
</command>
<data>
<error len="2" cn="错误码" format="X" :catch="catchError('%s')">
<options>
<option cn="无错误">
<hex>00</hex>
</option>
<option cn="输入数据错">
<hex>15</hex>
</option>
<option cn="数据长度错">
<hex>80</hex>
</option>
</options>
</error>
<hash len="32" :if="0 == $packet.data.packSn$option || 3 == $packet.data.packSn$option" cn="hash"></hash>
<filterDataLen len="4" :value="filterDataLength()" :if="2 == $packet.data.packSn$option || 1 == $packet.data.packSn$option" cn="过渡数据长度">
只对“消息块号”为 2、1 时有效
</filterDataLen>
<filterData :len="getFilterDataLen()" :if="2 == $packet.data.packSn$option || 1 == $packet.data.packSn$option " cn="过渡消息数据">
只对“消息块号”为 2、1 时有效
</filterData>
<tailSep len="1" required="false" cn="尾分隔">
可选项。如果显示消息尾域,则该域必须显示。值为 “X19”。
<hex>19</hex>
</tailSep>
<tail maxLen="32" required="false" cn="尾部">
可选项。最大长度为 32个字符。
</tail>
</data>
</res>
<script>function dataLen(){
var data = $packet.data;
return data.msg.length;
}
function filterDataLength(){
var data = $packet.data;
return data.filterData.length;
}
function getFilterDataLen() {
return Util.a2i( $final.getSection('data').getSection('filterDataLen') )
}
def hasFilterDataLen(){
try{ return 2 == $packet.data.packSn$option || 3 == $packet.data.packSn$option}catch(Exception e){e.printStackTrace();}
}
def hasFilterData(){
try{ return 2 == $packet.data.packSn$option || 3 == $packet.data.packSn$option}catch(Exception e){e.printStackTrace();}
}
</script>
</packet>