isapi_system_deviceInfo.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package isapi
  2. import (
  3. "encoding/xml"
  4. "github.com/sirupsen/logrus"
  5. )
  6. // DeviceInfo 设备信息
  7. type DeviceInfo struct {
  8. DeviceName string `xml:"deviceName,omitempty" json:"deviceName,omitempty"`
  9. DeviceID string `xml:"deviceID,omitempty" json:"deviceID,omitempty"`
  10. DeviceDescription string `xml:"deviceDescription,omitempty" json:"deviceDescription,omitempty"`
  11. DeviceLocation string `xml:"deviceLocation,omitempty" json:"deviceLocation,omitempty"`
  12. SystemContact string `xml:"systemContact,omitempty" json:"systemContact,omitempty"` //生产商
  13. Model string `xml:"model,omitempty" json:"model,omitempty"`
  14. SerialNumber string `xml:"serialNumber,omitempty" json:"serialNumber,omitempty"`
  15. MacAddress string `xml:"macAddress,omitempty" json:"macAddress,omitempty"`
  16. FirmwareVersion string `xml:"firmwareVersion,omitempty" json:"firmwareVersion,omitempty"`
  17. FirmwareReleasedDate string `xml:"firmwareReleasedDate,omitempty" json:"firmwareReleasedDate,omitempty"`
  18. EncoderVersion string `xml:"encoderVersion,omitempty" json:"encoderVersion,omitempty"`
  19. EncoderReleasedDate string `xml:"encoderReleasedDate,omitempty" json:"encoderReleasedDate,omitempty"`
  20. BootVersion string `xml:"bootVersion,omitempty" json:"bootVersion,omitempty"`
  21. BootReleasedDate string `xml:"bootReleasedDate,omitempty" json:"bootReleasedDate,omitempty"`
  22. HardwareVersion string `xml:"hardwareVersion,omitempty" json:"hardwareVersion,omitempty"`
  23. DeviceType string `xml:"deviceType,omitempty" json:"deviceType,omitempty"`
  24. TelecontrolID string `xml:"telecontrolID,omitempty" json:"telecontrolID,omitempty"`
  25. SupportBeep string `xml:"supportBeep,omitempty" json:"supportBeep,omitempty"`
  26. SupportVideoLoss string `xml:"supportVideoLoss" json:"supportVideoLoss"`
  27. FirmwareVersionInfo string `xml:"firmwareVersionInfo" json:"firmwareVersionInfo"`
  28. Manufacturer string `xml:"manufacturer" json:"manufacturer"`
  29. SubSerialNumber string `xml:"subSerialNumber" json:"subSerialNumber"`
  30. OEMCode string `xml:"OEMCode" json:"OEMCode"`
  31. }
  32. func (c *Client) GetDeviceInfo() (resp DeviceInfo, err error) {
  33. bytes, err := c.CommonGet("/ISAPI/System/deviceInfo")
  34. if err != nil {
  35. logrus.Error("请求出错", err)
  36. return
  37. }
  38. err = xml.Unmarshal(bytes, &resp)
  39. return
  40. }