NET_DVR_GetDeviceStatus

Call this API to get device status.

API Definition

BOOL NET_DVR_GetDeviceStatus(
  LONG      lUserID,
  DWORD     dwCommand,
  DWORD     dwCount,
  LPVOID    lpInBuffer,
  DWORD     dwInBufferSize,
  LPVOID    lpStatusList,
  LPVOID    lpOutBuffer,
  DWORD     dwOutBufferSize
);

Parameters

lUserID

[IN] Value returned by NET_DVR_Login_V40.

dwCommand

[IN] Commands for getting the device status.

dwCount

[IN] Number of devices' statuses to be obtained.

lpInBuffer

[IN] Condition buffer of getting status, which is different acoording to different commands (dwCommand).

dwInBufferSize

[IN] Condition buffer size.

lpStatusList

[OUT] Error information list, and its memory is allocated by user, each error information contains 4 bytes (a unsigned 32-bit integer).

There is a one-to-one correspondence between the errors in the list and the cameras that need to be searched, e.g. lpStatusList[2] corresponds to lpInBuffer[2].

If the parameter value is 0, it refers to getting succeeded; if the value is larger than 0, it indicates getting failed.

lpOutBuffer

[OUT] Status details returned by device, which veries with the command (dwCommand), and one-to-one corresponds to the cameras that need to be searched.

If the IpStatusList value of a camera is larger than 0, the corresponding IpOutBuffer is invalid.

dwOutBufferSize

[IN] Output buffer size

Return Values

Returns TRUE for success, and returns FALSE for all failed. If returns TRUE, it does not mean that all settings are succeeded, you can check the value of lpStatusList[n] to judge which one is succeeded.

If returning failed, you can call NET_DVR_GetLastError to get the error code.

Remarks

  • If you want to get all devices' statuses, you should set the dwCount to 0xffffffff, set lpInBuffer to NULL, set dwInBufferSize to 0, set lpStatusList to NULL.

  • For IpOutBuffer, the first 4-byte is the total number of structures returned by device, and the following bytes contain the structures details. If the configured output buffer is insufficient, only a part of structures will be returned.