| | |
| | | this.deviceZone = deviceZone; |
| | | } |
| | | |
| | | /** 构造通道发现的请求报文({@code getdevinfo})。 */ |
| | | public String getDeviceInfoRequest() |
| | | { |
| | | return envelope("<cmd>getdevinfo</cmd>"); |
| | | } |
| | | |
| | | /** 构造按通道批量查询实时快照的请求报文({@code inquire});只接受属于本实例的通道身份。 */ |
| | | public String inquireRequest(Set<ChannelIdentity> channels, boolean includeBarcode) |
| | | { |
| | | StringBuilder list = new StringBuilder("<cmd>inquire</cmd><list count=\"").append(channels.size()).append("\">"); |
| | |
| | | |
| | | |
| | | |
| | | /** 解析 {@code getdevinfo_resp},按本实例的适配器编码生成检测柜通道清单。 */ |
| | | public List<DetectedChannel> parseDeviceInfo(String xml) |
| | | { |
| | | Document document = parse(xml, "getdevinfo_resp"); |
| | |
| | | return List.copyOf(channels); |
| | | } |
| | | |
| | | /** 解析 {@code inquire_resp} 并按通道身份归集实时快照;{@code receivedAt} 记为服务器接收时间。 */ |
| | | public Map<ChannelIdentity, RealtimeSnapshot> parseSnapshots(String xml, Instant receivedAt) |
| | | { |
| | | Document document = parse(xml, "inquire_resp"); |