mobile CCTV,mobile surveillance,police body worn cameras

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

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

[copyURL]

4

主题

70

帖子

242

积分

midMem

Rank: 3Rank: 3

积分
242
owner
poston 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);
        }
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-5-15 16:21 , Processed in 0.056643 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList