IP及端口准备
本机IP&端口
选择局域网内一个ip及端口,IP一般默认为跟设备同一网关的本机IP,比如192.168.0.72
端口本机则默认绑定37020
即可
广播IP及端口
局域网广播IP :239.255.255.250 端口:37020
报文情况
本机发送
代码语言:javascript复制<?xml version="1.0" encoding="utf-8"?>
<Probe>
<!--随意生成UUID,每次发送报文不一样-->
<Uuid>8282F1DB-2FA6-4709-B261-3C6B6A48CA17</Uuid>
<Types>inquiry</Types>
</Probe>
报文回复
回复格式:
代码语言:javascript复制<?xml version="1.0" encoding="UTF-8" ?>
<ProbeMatch>
<!--与发送的uuid一一对应-->
<Uuid>8282F1DB-2FA6-4709-B261-3C6B6A48CA17</Uuid>
<Types>inquiry</Types>
<Encrypt>true</Encrypt>
<Salt>9bb2be4e49c225d4e57e659ecb97214a1ba295f2f7bec69bba7df83c55cc5e18</Salt>
<DeviceType>44322</DeviceType>
<DeviceDescription>DS-7804HQH-K1</DeviceDescription>
<DeviceSN>DS-7804HQH-K10420190822CCCHD53257168WCVU</DeviceSN>
<CommandPort>8000</CommandPort>
<HttpPort>80</HttpPort>
<MAC>68-6d-bc-ee-f8-f0</MAC>
<IPv4Address>192.168.1.227</IPv4Address>
<IPv4SubnetMask>255.255.255.0</IPv4SubnetMask>
<IPv4Gateway>192.168.1.1</IPv4Gateway>
<IPv6Address>fe80::6a6d:bcff:feee:f8f0</IPv6Address>
<IPv6Gateway>::</IPv6Gateway>
<IPv6MaskLen>64</IPv6MaskLen>
<DHCP>false</DHCP>
<AnalogChannelNum>4</AnalogChannelNum>
<DigitalChannelNum>5</DigitalChannelNum>
<SoftwareVersion>V3.5.38build 191215</SoftwareVersion>
<DSPVersion>V5.0, build 191213</DSPVersion>
<BootTime>2021-05-19 14:31:12</BootTime>
<OEMInfo>N/A</OEMInfo>
<Activated>true</Activated>
<PasswordResetAbility>true</PasswordResetAbility>
<SyncIPCPassword>true</SyncIPCPassword>
<PasswordResetModeSecond>true</PasswordResetModeSecond>
<DeviceLock>true</DeviceLock>
<SupportGUID>true</SupportGUID>
<SupportSecurityQuestion>true</SupportSecurityQuestion>
<SupportHCPlatform>true</SupportHCPlatform>
<HCPlatformEnable>false</HCPlatformEnable>
<IsModifyVerificationCode>false</IsModifyVerificationCode>
</ProbeMatch>
注意 :如果局域网内搜索到几个设备,这里就会放回几条报文,这些报文的uuid是相同的。
流程简述
- 搜索器 发送搜索 广播报文
- 设备搜到广播后 回复广播消息
- 设备同样发送消息至本机搜索器端口