海康ehome协议分析(4):GPS上传

海康带有GPS的设备,是通过报警(Alarm)服务进行GPS上传的,具体通信通道是根据配置文件,可选择UDP,UDP&TCP,MQTT方式分别对应的配置是:

    <Param>
        <LogPath>C:/EHomeSdkLogs/LogPath>
        <LogLevel>3LogLevel>
        <LogAutoDel>falseLogAutoDel>
        <KeepAliveSeconds>15KeepAliveSeconds>
        <KeepAliveCount>6KeepAliveCount>
        //报警方式: 0:udp,1:UDP&TCP, 2:MQTT
        <AlarmServerType>2AlarmServerType>
        // ALARM的报警地址
        <AlarmServerIP>192.168.31.253AlarmServerIP>
        // ALARM的报警端口
        <AlarmServerUdpPort>7332AlarmServerUdpPort>
        <AlarmServerTcpPort>7333AlarmServerTcpPort>
        <AlarmServerMqttPort>7334AlarmServerMqttPort>
        <AlarmServerPortUseCms>0AlarmServerPortUseCms>
        <NTPServerIP>10.17.132.231NTPServerIP>
        <NTPServerPort>123NTPServerPort>
        <NTPInterval>3600NTPInterval>
        <PictureServerType>2PictureServerType>
        <PictureServerIP>192.168.1.243PictureServerIP>
        <PictureServerPort>10002PictureServerPort>
        <CmsAccessSecurity>0CmsAccessSecurity>
        <AlarmAccessSecurity>0AlarmAccessSecurity>
        <StreamAccessSecurity>0StreamAccessSecurity>
        <AlarmPictureSeparate>1AlarmPictureSeparate>
    Param>
上报文
  • 接收

<PPVSPMessage>
    <Version>2.0Version>
    <Sequence>1137Sequence>
    <CommandType>REQUESTCommandType>
    <Command>GPSCommand>
    <Params>
        //设备ID
        <DeviceID>123457DeviceID>
        //上报时间
        <Time>2021-08-23 16:35:35Time>
        //方向
        <DivisionEW>EDivisionEW>
        //经度 范围:0-(180*3600*100)
        //转换公式:实际度数*3600*100+实际分数*60*100+实际秒数*100
        <Longitude>43713595Longitude>
        <DivisionNS>NDivisionNS>
        //纬度
        //转换公式:实际度数*3600*100+实际分数*60*100+实际秒数*100
        <Latitude>11214118Latitude>
        //方向 0表示正北
        <Direction>0Direction>
        //速度 cm/h
        <Speed>0Speed>
        //星数
        <Satellites>7Satellites>  
        //精度
        <Precision>13Precision>
        //高度
        <Height>2160Height>
        <RetransFlag>1RetransFlag>
        <NeedsResponse>1NeedsResponse>
        <TimeZone>+08:00TimeZone>
        <Remark>test/debugRemark>
    Params>
PPVSPMessage>
  • 回复

<PPVSPMessage>
    <Version>2.5Version>
    <Sequence>1137Sequence>
    <CommandType>RESPONSECommandType>
    <WhichCommand>GPSWhichCommand>
    <Status>200Status>
    <Description>OKDescription>
    <Params>
        <RetransFlag>1RetransFlag>
    Params>
PPVSPMessage>

你可能感兴趣的:(海康ehome,udp,tcp/ip)