12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package isapi
- import (
- "encoding/xml"
- "github.com/sirupsen/logrus"
- )
- // DeviceInfo 设备信息
- type DeviceInfo struct {
- DeviceName string `xml:"deviceName,omitempty" json:"deviceName,omitempty"`
- DeviceID string `xml:"deviceID,omitempty" json:"deviceID,omitempty"`
- DeviceDescription string `xml:"deviceDescription,omitempty" json:"deviceDescription,omitempty"`
- DeviceLocation string `xml:"deviceLocation,omitempty" json:"deviceLocation,omitempty"`
- SystemContact string `xml:"systemContact,omitempty" json:"systemContact,omitempty"` //生产商
- Model string `xml:"model,omitempty" json:"model,omitempty"`
- SerialNumber string `xml:"serialNumber,omitempty" json:"serialNumber,omitempty"`
- MacAddress string `xml:"macAddress,omitempty" json:"macAddress,omitempty"`
- FirmwareVersion string `xml:"firmwareVersion,omitempty" json:"firmwareVersion,omitempty"`
- FirmwareReleasedDate string `xml:"firmwareReleasedDate,omitempty" json:"firmwareReleasedDate,omitempty"`
- EncoderVersion string `xml:"encoderVersion,omitempty" json:"encoderVersion,omitempty"`
- EncoderReleasedDate string `xml:"encoderReleasedDate,omitempty" json:"encoderReleasedDate,omitempty"`
- BootVersion string `xml:"bootVersion,omitempty" json:"bootVersion,omitempty"`
- BootReleasedDate string `xml:"bootReleasedDate,omitempty" json:"bootReleasedDate,omitempty"`
- HardwareVersion string `xml:"hardwareVersion,omitempty" json:"hardwareVersion,omitempty"`
- DeviceType string `xml:"deviceType,omitempty" json:"deviceType,omitempty"`
- TelecontrolID string `xml:"telecontrolID,omitempty" json:"telecontrolID,omitempty"`
- SupportBeep string `xml:"supportBeep,omitempty" json:"supportBeep,omitempty"`
- SupportVideoLoss string `xml:"supportVideoLoss" json:"supportVideoLoss"`
- FirmwareVersionInfo string `xml:"firmwareVersionInfo" json:"firmwareVersionInfo"`
- Manufacturer string `xml:"manufacturer" json:"manufacturer"`
- SubSerialNumber string `xml:"subSerialNumber" json:"subSerialNumber"`
- OEMCode string `xml:"OEMCode" json:"OEMCode"`
- }
- func (c *Client) GetDeviceInfo() (resp DeviceInfo, err error) {
- bytes, err := c.CommonGet("/ISAPI/System/deviceInfo")
- if err != nil {
- logrus.Error("请求出错", err)
- return
- }
- err = xml.Unmarshal(bytes, &resp)
- return
- }
|