mobile CCTV,mobile surveillance,police body worn cameras
标题:
安卓端向web端发送警告方法
[打印本页]
author:
lwqpdf
time:
2021-10-15 12:01
标题:
安卓端向web端发送警告方法
我们使用优视的android和web sdk做二次开发,请提供一下android端发送警报到web端的示例代码和web端接受到事件的代码,谢谢。
author:
lwqpdf
time:
2021-10-15 12:11
我这边使用的android端sdk是MCP_SDK2021-01-20
author:
wanzongyong
time:
2021-10-15 12:37
// android端发送报警命令
public static int sendEventSource(Context context, int eventType, int end, String dec) {
BVCU_Command command = new BVCU_Command();
command.iMethod = BVCU_Method.BVCU_METHOD_NOTIFY;
command.iSubMethod = BVCU_SubMethod.BVCU_SUBMETHOD_EVENT_NOTIFY;
command.szTargetID = mcu.getServerParam().szServerAddr; // 服务器ip 如:192.168.6.6
command.iTimeOut = 3000; // 超时时间 默认3000即可
command.stMsgContent = new BVCU_CmdMsgContent();
command.stMsgContent.iDataCount = 1;
BVCU_Event_Source event_Source = new BVCU_Event_Source();
event_Source.szID = "PU_666666"; // PU_ID
event_Source.iEventType = eventType; // 报警类型 参考 BVCU_EVENT_TYPE
event_Source.iSubDevIdx = 0;
event_Source.iValue = 0;
event_Source.bEnd = end;// 0:报警 1:解除报警
event_Source.szEventDesc = dec; // 报警描述 自定义字符串即可
event_Source.iLongitude = mcu.getMPUApplication().getGPSData().iLongitude; // 经纬度
event_Source.iLatitude = mcu.getMPUApplication().getGPSData().iLatitude;
Calendar calendar = Calendar.getInstance();
event_Source.stTime = new BVCU_WallTime();
event_Source.stTime.iYear = (short) calendar.get(Calendar.YEAR);
event_Source.stTime.iMonth = (char) (calendar.get(Calendar.MONTH) + 1);
event_Source.stTime.iDay = (char) calendar.get(Calendar.DAY_OF_MONTH);
event_Source.stTime.iHour = (char) calendar.get(Calendar.HOUR_OF_DAY);
event_Source.stTime.iMinute = (char) calendar.get(Calendar.MINUTE);
event_Source.stTime.iSecond = (char) calendar.get(Calendar.SECOND);
command.stMsgContent.pData = event_Source;
int token = BVCU.getSDK().sendCmd(command);
}
author:
jsb
time:
2021-10-15 15:01
[attach]3166[/attach][attach]3167[/attach]
[attach]3166[/attach]
在线文档:
http://61.191.27.18:8081/doc/index.html
事件报警通知可参考这个样例
http://61.191.27.18:8081/Demo/pushutdownrebooteventsource.html
欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/)
Powered by Discuz! X3.2