|
- private void login(String ip, int port, String username, String password) {
- BVCU_SessionParam param = new BVCU_SessionParam();
- BVCU_ServerParam serverParam = new BVCU_ServerParam();
- serverParam.szClientID = getClientID();
- serverParam.iCmdProtoType = 1;
- serverParam.szServerAddr = ip;
- serverParam.iServerPort = port;
- serverParam.szUserName = username;
- serverParam.szPassword = password;
- serverParam.szUserAgent = Constant.USER_AGENT;
- BVPU_ServerParam bvpuServerParam = new BVPU_ServerParam();
- param.iClientType = BVCU_CLIENT_TYPE.BVCU_CLIENT_TYPE_CU;
- param.iCmdProtoType = serverParam.iCmdProtoType;
- param.iMaxChannelOpenCount = 0;
- param.iServerPort = serverParam.iServerPort;
- param.iTimeOut = 30 * 1000;
- param.szClientID = serverParam.szClientID;
- param.szPassword = serverParam.szPassword;
- param.szServerAddr = serverParam.szServerAddr;
- param.szUserAgent = serverParam.szUserAgent;
- param.szUserName = serverParam.szUserName;
- bvpuServerParam.szDeviceName = "SDK测试";
- bvpuServerParam.iMediaDir ^= BVCU_MediaDir.BVCU_MEDIADIR_VIDEOSEND;
- bvpuServerParam.iMediaDir ^= BVCU_MediaDir.BVCU_MEDIADIR_TALKONLY;
- if (serverParam.szClientID.contains("UA")) {
- param.iClientType = BVCU_CLIENT_TYPE.BVCU_CLIENT_TYPE_UA;
- param.stEntityInfo = new BVCU_EntityInfo();
- PUDeviceInfo.initPUEntityInfo(param.stEntityInfo, bvpuServerParam);
- }
- int loginStatus = BVCU.getSDK().login(param);
- Log.d(TAG, "loginStatus:" + loginStatus);
- }
copycode
这句返回的
|
|