mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
view: 883|reply: 3
打印 prevThread nextThread

安卓端向web端发送警告方法

[copyURL]

2

主题

4

帖子

24

积分

newBie

Rank: 1

积分
24
jumpTo
owner
poston 2021-10-15 12:01 | authorOnly 回帖奖励 |倒序浏览 |阅读模式
我们使用优视的android和web sdk做二次开发,请提供一下android端发送警报到web端的示例代码和web端接受到事件的代码,谢谢。
reply

使用道具 report

2

主题

4

帖子

24

积分

newBie

Rank: 1

积分
24
sofa
 Owner| poston 2021-10-15 12:11 | authorOnly
我这边使用的android端sdk是MCP_SDK2021-01-20
reply agree Against

使用道具 report

4

主题

70

帖子

242

积分

midMem

Rank: 3Rank: 3

积分
242
bench
poston 2021-10-15 12:37 | authorOnly
// 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);
        }
reply agree Against

使用道具 report

11

主题

200

帖子

925

积分

advMem

Rank: 4

积分
925
ground
poston 2021-10-15 15:01 | authorOnly



在线文档:http://61.191.27.18:8081/doc/index.html


事件报警通知可参考这个样例 http://61.191.27.18:8081/Demo/pushutdownrebooteventsource.html





本帖子中包含更多资源

pls login 才可以下载或查看,没有帐号?registerNow

x
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-4-29 15:50 , Processed in 0.061526 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList