| | |
| | | return result; |
| | | } |
| | | |
| | | //查询通道名称 |
| | | public static String getChannelName(NetSDKLib.LLong hLoginHandle, Integer channel) { |
| | | String channelName = ""; |
| | | NetSDKLib.AV_CFG_ChannelName channelTitleName = new NetSDKLib.AV_CFG_ChannelName(); |
| | | if (ToolKits.GetDevConfig(hLoginHandle, channel - 1, NetSDKLib.CFG_CMD_CHANNELTITLE, channelTitleName)) { |
| | | try { |
| | | channelName = new String(channelTitleName.szName, "GBK"); |
| | | } catch (Exception e) { |
| | | log.error("getChannelName Failed!"); |
| | | } |
| | | } else { |
| | | log.error("Get Channel Name Failed." + ToolKits.getErrorCodePrint()); |
| | | } |
| | | return channelName; |
| | | } |
| | | |
| | | public static boolean GetDevConfig(NetSDKLib.LLong hLoginHandle, int nChn, String strCmd, Structure cmdObject) { |
| | | boolean result = true; |
| | | IntByReference error = new IntByReference(0); |
| | |
| | | return result; |
| | | } |
| | | |
| | | //查询相机状态 |
| | | public static boolean queryCameraState(NetSDKLib.LLong hLoginHandle, Integer chanNum, Integer chanNo) { |
| | | boolean bRet = false; |
| | | try { |
| | |
| | | stOut.read(); |
| | | ToolKits.GetPointerDataToStructArr(stOut.pCameraStateInfo, arrCameraStatus); // 将Pointer拷贝到数组内存 |
| | | final String[] connectionState = {"未知", "正在连接", "已连接", "未连接", "通道未配置,无信息", "通道有配置,但被禁用"}; |
| | | |
| | | if (connectionState[arrCameraStatus[chanNo - 1].emConnectionState].equals("已连接")) { |
| | | log.debug("通道" + arrCameraStatus[chanNo - 1].nChannel + connectionState[arrCameraStatus[chanNo - 1].emConnectionState]); |
| | | //log.debug("通道:" + arrCameraStatus[chanNo - 1].nChannel + "状态:" + connectionState[arrCameraStatus[chanNo - 1].emConnectionState]); |
| | | bRet = true; |
| | | } else { |
| | | bRet = false; |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |