mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
view: 19599|reply: 178
打印 prevThread nextThread

适配BVCSP.h接口出现问题

[copyURL]

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
owner
poston 2019-6-3 17:05 | 显示全部楼层
au_rsa.h

本帖子中包含更多资源

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

x
reply

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
sofa
poston 2019-6-3 17:24 | 显示全部楼层
可能还需要编译cpp文件。一起打包了一下。

本帖子中包含更多资源

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

x
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
bench
poston 2019-6-4 11:15 | 显示全部楼层
meige post on2019-6-4 10:55
这是打log的代码:
int au_rsa_encrypt(AU_RSA * pubkey, char * src, int src_len, char * dst, int dst_ ...

au_rsa_key_get_hex里的参数都是多少
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
ground
poston 2019-6-4 12:12 | 显示全部楼层
meige post on2019-6-4 11:37
// 这里的密钥是公司提供的开发者账号

     AU_RSA* auRsa = nullptr;

好。我看到了。你把这一楼层重新编辑下,删掉。
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
5#
poston 2019-6-4 12:50 | 显示全部楼层
不用au_rsa接口了,尝试下直接调用。

本帖子中包含更多资源

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

x
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
6#
poston 2019-6-4 14:49 | 显示全部楼层
meige post on2019-6-4 14:38
利用你给的方法认证已经成功了,但是登入不成功,这是是否要你那边授权。
}  

确认调用成功了么,BVCSP_Auth(&param); 返回值多少。
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
7#
poston 2019-6-4 14:57 | 显示全部楼层
meige post on2019-6-4 14:38
利用你给的方法认证已经成功了,但是登入不成功,这是是否要你那边授权。
}  

BVCSP_Auth 之前有设置回调么。 param.OnAuthEvent = OnAuthEvent;
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
8#
poston 2019-6-4 18:16 | 显示全部楼层
meige post on2019-6-4 17:44
void  PU_OnAuthEvent(struct BVRAuthParam* param, enum BVRAuthResult result, enum BVRPermission* per ...

// 这个是我这边调用流程。
CallAuth(2);
static void CallAuth(int request){

        BVRAuthParam param;
        memset(&param, 0, sizeof(param));

        param.iSize = sizeof(param);
        // 参数对应改下
        strcpy(param.termInfo.CPU, "ARM");
        strcpy(param.termInfo.Desc, "Besovideo copyright");
        strcpy(param.termInfo.HardwareProvider, lo_billRequest.stEntity.szBrand);
        strcpy(param.termInfo.HardwareSN, lo_billRequest.stEntity.szFingerPrint);
        strcpy(param.termInfo.HardwareVersion, "1.0");
        strcpy(param.termInfo.ID, lo_billRequest.szAppDeviceID);
        strcpy(param.termInfo.IMEI, lo_billRequest.stEntity.szDeviceID);
        strcpy(param.termInfo.MAC, lo_billRequest.stEntity.szMacAddress);
        strcpy(param.termInfo.ModelNumber, lo_billRequest.stEntity.szModel);
        strcpy(param.termInfo.DeviceModelNumber, lo_billRequest.stEntity.szModel);
        strcpy(param.termInfo.OSID, lo_billRequest.stEntity.szAndroidID);
        strcpy(param.termInfo.OSType, "Android");
        sprintf(param.termInfo.OSVersion,"%d", lo_billRequest.stEntity.iAPILevel);
        strcpy(param.termInfo.SoftwareProvider, "Besovideo");
        strcpy(param.termInfo.SoftwareVersion, "v1.0");
        strcpy(param.termInfo.Type, lo_billRequest.szAppType);
        strcpy(param.termInfo.UserLabel,lo_billRequest.szUserLabel);
        LOGI("CallAuth lo_billRequest.szProductKey = %s", lo_billRequest.szProductKey);
        strcpy(param.termInfo.ProductKey,lo_billRequest.szProductKey);

        AU_RSA* rsa = NULL;

        char* n = "xxxxxxxxxxxxxx";
        char* e = "xxxxxxxxxxxxxxx";
        char data[256];
        int data_len = 0;
        int len = 0;
        char base64[512];
        int base64_len;

        char encrypt[512];
        int encrypt_len = 0;

        data_len = sizeof(data);
        memset(data, 0, sizeof(data));

        encrypt_len = sizeof(encrypt);
        memset(encrypt, 0, sizeof(encrypt));

        base64_len = sizeof(base64);
        memset(base64, 0, sizeof(base64));

        au_rsa_init();
        au_rsa_key_get_hex(&rsa, n, e, NULL);

        // 获取需要字符串
        BVCSP_GetEncryptedData(data, &data_len);
        len = au_rsa_encrypt(rsa, data, data_len, encrypt, encrypt_len);
        if (len > 0) {
                base64_len = base64_encode((const unsigned char*) encrypt, len, base64);
                strcpy(param.appInfo.appId, "app_xxxxxxxxx");
                param.appInfo.ciph_data = base64;
                param.appInfo.ciph_len = strlen(base64);
        }

        if(strlen(lo_billRequest.szInnerInfo) > 0){
                param.innerInfo.ciphertext = lo_billRequest.szInnerInfo;
                param.innerInfo.length = strlen(lo_billRequest.szInnerInfo)+1;
        }

        memcpy(param.SerialNumber, lo_billRequest.szSerialNumber, 128);

        param.user_data = (void*)request;

        param.OnAuthEvent = BVOnAuthEvent;
        param.OnMessage =BVOnMessage;

#if 1
        BVCU_Result br = BVCSP_Auth(&param);
        if(BVCU_Result_FAILED(br)){
                LOGI("auth call error!");
        }else{
                LOGI("auth call success!");
        }
#endif
        LOGI("***************>> request: %d\n", request);
}

reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
9#
poston 2019-6-5 09:40 | 显示全部楼层
meige post on2019-6-5 09:15
这个ip 47.107.87.21,ping不通。

服务器那边说不允许ping。 用这个ip和端口建立一个socket连接试下。另外调用auth之后,如果一直连不上服务器,回调里会回复一个超时,时间挺长,多等一会以测试回调流程是否正常。
reply agree Against

使用道具 report

1

主题

311

帖子

1105

积分

vipMem

Rank: 6Rank: 6

积分
1105
10#
poston 2019-6-5 14:42 | 显示全部楼层
meige post on2019-6-5 12:01
兄弟,我这边在研究,这个是你们的东西,可以有些东西对于你们来说简单,但是我们这边可能要研究很久,这 ...

label_    把这个值传入param.termInfo.UserLabel。然后再次调用认证,调用完成后说下,我们这边授权。
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-5-10 07:39 , Processed in 0.071292 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList