跳转至
本 SDK 仅适用于过去 3 年内发布的设备。我们定期优化和更新 SDK，以确保兼容性和性能。对于超过 3 年的旧设备，我们不保证兼容性，也不会提供技术支持。

# NET_SDK_DEVICEINFO,LPNET_SDK_DEVICEINFO

### 结构体定义

C++C#

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    typedef struct _net_sdk_deviceinfo
    {
        unsigned int localVideoInputNum;
        unsigned char audioInputNum;
        unsigned char sensorInputNum;
        unsigned char sensorOutputNum;
        unsigned int displayResolutionMask;
        unsigned char videoOuputNum;
        unsigned char netVideoOutputNum;
        unsigned int netVideoInputNum;
        unsigned char IVSNum;
        unsigned char presetNumOneCH;
        unsigned char cruiseNumOneCH;
        unsigned char presetNumOneCruise;
        unsigned char trackNumOneCH;
        unsigned char userNum;
        unsigned char netClientNum;
        unsigned char netFirstStreamNum;
        unsigned char deviceType;
        unsigned char doblueStream;
        unsigned char audioStream;
        unsigned char talkAudio;
        unsigned char bPasswordCheck;
        unsigned char defBrightness;
        unsigned char defContrast;
        unsigned char defSaturation;
        unsigned char defHue;
        unsigned short videoInputNum;
        unsigned short deviceID;
        unsigned int videoFormat;
        unsigned int function[8];
        unsigned int deviceIP;
        unsigned char deviceMAC[6];
        unsigned short devicePort;
        unsigned int buildDate;
        unsigned int buildTime;
        char deviceName[36];
        char firmwareVersion[36];
        char kernelVersion[64];
        char hardwareVersion[36];
        char MCUVersion[36];
        char firmwareVersionEx[64];
        unsigned int softwareVer;
        char szSN[32];
        char deviceProduct[28];
        unsigned int dwProductType;
        char productionSerialNumber[64];
    } NET_SDK_DEVICEINFO, * LPNET_SDK_DEVICEINFO;

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    [StructLayout(LayoutKind.Sequential, Pack = 4)]
    public struct NET_SDK_DEVICEINFO
    {
        public UInt32 localVideoInputNum;
        public byte audioInputNum;
        public byte sensorInputNum;
        public byte sensorOutputNum;
        public UInt32 displayResolutionMask;
        public byte videoOuputNum;
        public byte netVideoOutputNum;
        public UInt32 netVideoInputNum;
        public byte IVSNum;
        public byte presetNumOneCH;
        public byte cruiseNumOneCH;
        public byte presetNumOneCruise;
        public byte trackNumOneCH;
        public byte userNum;
        public byte netClientNum;
        public byte netFirstStreamNum;
        public byte deviceType;
        public byte doblueStream;
        public byte audioStream;
        public byte talkAudio;
        public byte bPasswordCheck;
        public byte defBrightness;
        public byte defContrast;
        public byte defSaturation;
        public byte defHue;
        public UInt16 videoInputNum;
        public UInt16 deviceID;
        public UInt32 videoFormat;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U4, SizeConst = 8)]
        public UInt32[] function;
        public UInt32 deviceIP;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 6)]
        public byte[] deviceMAC;
        public UInt16 devicePort;
        public UInt32 buildDate;
        public UInt32 buildTime;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 36)]
        public byte[] deviceName;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 36)]
        public byte[] firmwareVersion;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 64)]
        public byte[] kernelVersion;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 36)]
        public byte[] hardwareVersion;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 36)]
        public byte[] MCUVersion;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 64)]
        public byte[] firmwareVersionEx;
        public UInt32 softwareVer;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 32)]
        public byte[] szSN;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 28)]
        public byte[] deviceProduct;
        public UInt32 dwProductType;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 64)]
        public byte[] productionSerialNumber;
        public IPAddress GetDeviceIP()
        {
            return new IPAddress(deviceIP);
        }
        public string GetDeviceIPStr()
        {
            return DevSdkHelper.IntToIp(deviceIP);
        }
        public string GetDeviceMAC()
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < deviceMAC.Length; i++)
            {
                string str = deviceMAC[i].ToString("X");
                str = str.Length == 1 ? "0" + str : str;
                if (i < 5)
                    sb.Append(str + ":");
                else
                    sb.Append(str);
            }
            return sb.ToString();
        }
        public string GetDeviceName()
        {
            return DevSdkHelper.ByteToStr(deviceName);
        }
        public string GetFirmwareVersion()
        {
            return DevSdkHelper.ByteToStr(firmwareVersion);
        }
        public string GetKernelVersion()
        {
            return DevSdkHelper.ByteToStr(kernelVersion);
        }
        public string GetHardwareVersion()
        {
            return DevSdkHelper.ByteToStr(hardwareVersion);
        }
        public string GetMCUVersion()
        {
            return DevSdkHelper.ByteToStr(MCUVersion);
        }
        public string GetFirmwareVersionEx()
        {
            return DevSdkHelper.ByteToStr(firmwareVersionEx);
        }
        public string GetDeviceProduct()
        {
            return DevSdkHelper.ByteToStr(deviceProduct);
        }
        public string GetProductionSerialNumber()
        {
            if (productionSerialNumber == null)
            {
                return "";
            }
            return DevSdkHelper.ByteToStr(productionSerialNumber);
        }
    }

### 功能描述

设备信息。

### 成员说明

成员 | 类型 | 说明
--- | --- | ---
localVideoInputNum | unsigned int | 本地视频输入通道数目。
audioInputNum | unsigned char | 音频输入通道数目。
sensorInputNum | unsigned char | 传感器输入通道数目。
sensorOutputNum | unsigned char | 继电器输出数目。
displayResolutionMask | unsigned int | 监视器可选择的分辨率。
videoOuputNum | unsigned char | 视频输出数目（及支持回放最大通道数）。
netVideoOutputNum | unsigned char | 网络回放最大通道数目。
netVideoInputNum | unsigned int | 数字信号接入通道数目。
IVSNum | unsigned char | 智能分析通道数目。
presetNumOneCH | unsigned char | 每个通道预置点数目。
cruiseNumOneCH | unsigned char | 每个通道巡航线数目。
presetNumOneCruise | unsigned char | 每个巡航线的预置点数目。
trackNumOneCH | unsigned char | 每个通道轨迹数目。
userNum | unsigned char | 用户数目。
netClientNum | unsigned char | 最多客户端数目。
netFirstStreamNum | unsigned char | 主码流传输的通道最大数目，即同时可以有几个客户端查看主码流。
deviceType | unsigned char | 参考`NET_SDK_DEVICE_TYPE`。
doblueStream | unsigned char | 是否有提供双码流。
audioStream | unsigned char | 是否有提供音频流。
talkAudio | unsigned char | 是否有对讲功能: 1表示有对讲功能;0表示没有。
bPasswordCheck | unsigned char | 操作是否要输入密码。
defBrightness | unsigned char | 缺省亮度。
defContrast | unsigned char | 缺省对比度。
defSaturation | unsigned char | 缺省饱和度。
defHue | unsigned char | 缺省色调。
videoInputNum | unsigned short | 视频输入通道数目（本地加网络）。
deviceID | unsigned short | 设备ID号。
videoFormat | unsigned int | 系统当前制式。
function | unsigned int[8] | 功能描述。
deviceIP | unsigned int | 设备网络地址。
deviceMAC | unsigned char[6] | 设备物理地址。
devicePort | unsigned short | 设备端口。
buildDate | unsigned int | 创建日期:year<<16 + month<<8 + mday。
buildTime | unsigned int | 创建时间:hour<<16 + min<<8 + sec。
deviceName | char[36] | 设备名称。
firmwareVersion | char[36] | 固件版本。
kernelVersion | char[64] | 内核版本。
hardwareVersion | char[36] | 硬件版本。
MCUVersion | char[36] | 单片机版本。
firmwareVersionEx | char[64] | 固件版本扩展，主要针对新产品。
softwareVer | unsigned int | 软件协议版本，目前用于IPC的版本兼容。
szSN | char[32] | sn。
deviceProduct | char[28] | 设备型号。
dwProductType | unsigned int | 产品类型，参考`NET_SDK_DEVICE_TYPE`

错误码