package isapi import ( "encoding/xml" ) //能力 //http://192.168.1.64/ISAPI/Smart/FieldDetection/1/capabilities //http://192.168.1.64/ISAPI/Smart/channels/1/calibrations/capabilities // FieldDetection 区域入侵 type FieldDetection struct { XMLName xml.Name `xml:"FieldDetection"` Xmlns string `xml:"xmlns,attr"` Version string `xml:"version,attr"` ID string `xml:"id"` Enabled string `xml:"enabled"` StartTriggerTime string `xml:"startTriggerTime"` EndTriggerTime string `xml:"endTriggerTime"` NormalizedScreenSize struct { NormalizedScreenWidth string `xml:"normalizedScreenWidth"` NormalizedScreenHeight string `xml:"normalizedScreenHeight"` } `xml:"normalizedScreenSize"` FieldDetectionRegionList struct { Size string `xml:"size,attr"` FieldDetectionRegion []struct { ID string `xml:"id"` Enabled string `xml:"enabled"` SensitivityLevel string `xml:"sensitivityLevel"` TimeThreshold string `xml:"timeThreshold"` DetectionTarget string `xml:"detectionTarget"` AlarmConfidence struct { Opt string `xml:"opt,attr"` } `xml:"alarmConfidence"` RegionCoordinatesList struct { RegionCoordinates []struct { PositionX string `xml:"positionX"` PositionY string `xml:"positionY"` } `xml:"RegionCoordinates"` } `xml:"RegionCoordinatesList"` } `xml:"FieldDetectionRegion"` } `xml:"FieldDetectionRegionList"` IsSupportMultiScene string `xml:"isSupportMultiScene"` IsSupportHumanMisinfoFilter string `xml:"isSupportHumanMisinfoFilter"` IsSupportVehicleMisinfoFilter string `xml:"isSupportVehicleMisinfoFilter"` } func (c *Client) GetFieldDetectionCap() ([]byte, error) { return c.CommonGet("/ISAPI/Smart/FieldDetection/1/capabilities") } func (c *Client) GetSizeFd() ([]byte, error) { return c.CommonGet("/ISAPI/Smart/channels/1/calibrations/FieldDetection") } func (c *Client) PutSizeFd(data []byte) ([]byte, error) { return c.CommonPut(data, "/ISAPI/Smart/channels/1/calibrations/FieldDetection") } // PutFieldDetection 设置区域入侵报警区域 func (c *Client) PutFieldDetection(data []byte) ([]byte, error) { return c.CommonPut(data, "/ISAPI/Smart/FieldDetection/1") } // GetFieldDetection 获取报警区域 func (c *Client) GetFieldDetection() ([]byte, error) { return c.CommonGet("/ISAPI/Smart/FieldDetection/1") }