mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
Owner: meige
打印 prevThread nextThread

适配BVCSP.h接口出现问题

[copyURL]

11

主题

157

帖子

533

积分

advMem

Rank: 4

积分
533
31#
 Owner| poston 2019-6-4 16:22 | authorOnly
我的代码是从你们给的开发手册里-->功能演示-->会话相关-->被动打开和关闭会话,这里考出来的。或者你们能否提供下你们的demo代码?#include <Windows.h>头文件找不到,问下删除上述代码有没有影响.
reply agree Against

使用道具 report

0

主题

22

帖子

90

积分

member

Rank: 2

积分
90
32#
poston 2019-6-4 16:42 | authorOnly
不影响认证. 附件中有个demo,你运行下试试(输入6, 测试认证)

本帖子中包含更多资源

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

x
reply agree Against

使用道具 report

11

主题

157

帖子

533

积分

advMem

Rank: 4

积分
533
33#
 Owner| poston 2019-6-4 16:46 | authorOnly
35;1m[2019/06/04 16:45:18:8337] NOTICE: libwebsockets version: 3.0.1 unknown-build-hash
0U test   1:CU test  2:cmd  3:notify  4:dialog  5:exit  6:auth  7: encode rect
6
[D] [06-04 16:45:24] [WebClient::push:1037] auth randcode: 100041
0U test   1:CU test  2:cmd  3:notify  4:dialog  5:exit  6:auth  7: encode rect
[D] [06-04 16:45:24] [WebClient::connect:0217] connect 47.107.87.21 : 18866 ...
[D] [06-04 16:45:24] [callback_auth:0123] create  LWS_CALLBACK_WSI_CREATE
[D] [06-04 16:45:24] [WebClient::wsOnConnected:0342]
[D] [06-04 16:45:25] [WebClient::wsOnReceive:0476] debug cmd, type: 2, result: 1024, msg: success
[D] [06-04 16:45:25] [WebClient:nRVDecryption:0544] is auth server
[D] [06-04 16:45:25] [WebClient::wsOnReceive:0476] debug cmd, type: 5, result: 1024, msg: success
[D] [06-04 16:45:25] [WebClient:nRVAES:0563] get aes key iv
[I] [06-04 16:45:25] [WebClient::wsOnWriteable:0525] send success
[D] [06-04 16:45:25] [WebClient::wsOnReceive:0476] debug cmd, type: 50, result: 52, msg: auth wait
[D] [06-04 16:45:25] [WebClient:nRVLogin:0662] auth fail: 52, 52, , error: auth wait

---------------
result: 52
rand code: 100041
auth code: 3542
SerialNumber:
issuer:
type: PU
id: PU_12456
user_data: 0
result: auth wait
---------------
### trial 0

[I] [06-04 16:45:25] [WebClient::wsOnWriteable:0525] send success
[D] [06-04 16:45:25] [WebClient::wsOnReceive:0476] debug cmd, type: 54, result: 6, msg: company of meigchina un support trail

---------------
result: 6
rand code: 100041
auth code: 3542
SerialNumber:
issuer:
type: PU
id: PU_12456
user_data: 0
result: company of meigchina un support trail
reply agree Against

使用道具 report

11

主题

157

帖子

533

积分

advMem

Rank: 4

积分
533
34#
 Owner| poston 2019-6-4 16:47 | authorOnly
我想说下,我们是调试android设备,不是在windows开发。
reply agree Against

使用道具 report

0

主题

22

帖子

90

积分

member

Rank: 2

积分
90
35#
poston 2019-6-4 16:54 | authorOnly
meige post on2019-6-4 16:46
35;1m[2019/06/04 16:45:18:8337] NOTICE: libwebsockets version: 3.0.1 unknown-build-hash
0U te ...

void test_auth()
{
#if ENABLE_AUTH
    BVRAuthParam param;
    memset(&param, 0, sizeof(BVRAuthParam));
    {
        param.iSize = sizeof(BVRAuthParam);
        param.OnAuthEvent = PU_OnAuthEvent;
        strcpy(param.SerialNumber, ""); //
        {
            strcpy(param.termInfo.Type, "PU");
            strcpy(param.termInfo.ID, "PU_12456");
            strcpy(param.termInfo.ModelNumber, "ModelNumber_123");
            strcpy(param.termInfo.MAC, "MAC_14156");
            strcpy(param.termInfo.IMEI, "IMEI_235328965jkljfkl");
            strcpy(param.termInfo.HardwareProvider, "HardwareProvider_sdjgkagjnsjakdfj");
            strcpy(param.termInfo.HardwareSN, "HardwareSN_GHK6BC290E7E4AF4B59DB24B576A8ABJ");
            strcpy(param.termInfo.HardwareVersion, "HardwareVersion_akgjk");
            strcpy(param.termInfo.SoftwareProvider, "SoftwareProvider_sadkgjaskl");
            strcpy(param.termInfo.SoftwareVersion, "SoftwareVersion_sdkgj");
            strcpy(param.termInfo.OSType, "OSType_214ui");
            strcpy(param.termInfo.OSVersion, "OSVersion_sajkdg");
            strcpy(param.termInfo.OSID, "OSID_sdajgk");
            strcpy(param.termInfo.CPU, "CPU_234i");
            strcpy(param.termInfo.Desc, "Desc_ad");
        }
    }
    {
        AU_RSA* rsa = NULL;

        char* app_id = "app_xxxxxxxxxxxxx";
        char* n = "b1d6ad586dxxxxxxxxxxxxxxxxxxxx";
        char* e = "830e7aaxxxxxxxxxxxxxx";
        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));


        strcpy(param.appInfo.appId, app_id);

        // 获取需要字符串
        BVCSP_GetEncryptedData(data, &data_len);
#if 0
        au_rsa_init();
        au_rsa_key_get_hex(&rsa, n, e, NULL);

        // Base64(RSA(data))
        len = au_rsa_encrypt(rsa, data, data_len, encrypt, encrypt_len);
        if (len > 0)
        {
            base64_len = base64_encode((const unsigned char*)encrypt, len, base64);

            param.appInfo.ciph_data = base64;
            param.appInfo.ciph_len = strlen(base64);
        }

#else
        char outdata[512];
        int outdata_len = sizeof(outdata);
        BVCSP_EncryptData(n, e, data, data_len, outdata, &outdata_len);
        param.appInfo.ciph_data = outdata;
        param.appInfo.ciph_len = outdata_len;
#endif
    }
    BVCSP_Auth(&param);
#endif
}

reply agree Against

使用道具 report

0

主题

22

帖子

90

积分

member

Rank: 2

积分
90
36#
poston 2019-6-4 16:56 | authorOnly
tony258 post on2019-6-4 16:54
void test_auth()
{
#if ENABLE_AUTH

你试试直接调用这个函数, 注意更换app_id, n, e
reply agree Against

使用道具 report

11

主题

157

帖子

533

积分

advMem

Rank: 4

积分
533
37#
 Owner| poston 2019-6-4 17:23 | authorOnly
你看看是否成功了
[2019/06/04 17:23:08:0859] NOTICE: libwebsockets version: 3.1.0 unknown-build-hash
BVCSP so init success
GetEncryptedData
0
bvEncryptData
0
[D] [06-04 17:23:08] [push:1037] auth randcode: 236801
BVCSP_Auth
0
[D] [06-04 17:23:08] [connect:0217] connect 47.107.87.21 : 18866 ...
[D] [06-04 17:23:08] [callback_auth:0123] create  LWS_CALLBACK_WSI_CREATE
reply agree Against

使用道具 report

0

主题

22

帖子

90

积分

member

Rank: 2

积分
90
38#
poston 2019-6-4 17:29 | authorOnly
meige post on2019-6-4 17:23
你看看是否成功了
[2019/06/04 17:23:08:0859] NOTICE: libwebsockets version: 3.1.0 unknown-build-hash ...

在回调函数中打印
void PU_OnAuthEvent(BVRAuthParam* param, BVRAuthResult result, BVRPermission* permission, int pemsCount)
{
    printf("\n--------------- \n\
result: %d                   \n\
rand code: %d              \n\
auth code: %d              \n\
SerialNumber: %s             \n\
issuer: %s                   \n\
type: %s                     \n\
id: %s                       \n\
user_data: %d                \n\
result: %s                   \n\
---------------\n",
        result,
        param->tagInfo.RandCode,
        param->tagInfo.AuthCode,
        param->SerialNumber,
        param->certInfo.IssueUser,
        param->termInfo.Type,
        param->termInfo.ID,
        (int)param->user_data,
        param->innerInfo.errstr);
}
reply agree Against

使用道具 report

11

主题

157

帖子

533

积分

advMem

Rank: 4

积分
533
39#
 Owner| poston 2019-6-4 17:44 | authorOnly
void  PU_OnAuthEvent(struct BVRAuthParam* param, enum BVRAuthResult result, enum BVRPermission* permission, int pemsCount)

{
         printf("open OnAuthEvent start\n");
         printf("\n--------------- \n\
         result: %d                   \n\
         rand code: %d              \n\
         auth code: %d              \n\
         SerialNumber: %s             \n\
         issuer: %s                   \n\
         type: %s                     \n\
         id: %s                       \n\
         user_data: %d                \n\
         result: %s                   \n\
         ---------------\n",
                 result,
                 param->tagInfo.RandCode,
                 param->tagInfo.AuthCode,
                 param->SerialNumber,
                 param->certInfo.IssueUser,
                 param->termInfo.Type,
                 param->termInfo.ID,
                 (int)param->user_data,
                 param->innerInfo.errstr);

这个回调函数不会走。
reply agree Against

使用道具 report

0

主题

22

帖子

90

积分

member

Rank: 2

积分
90
40#
poston 2019-6-4 18:02 | authorOnly
meige post on2019-6-4 17:44
void  PU_OnAuthEvent(struct BVRAuthParam* param, enum BVRAuthResult result, enum BVRPermission* per ...

1. 打印的log信息帖下,尽量全  2. 在android上测试下47.107.87.21:18866是否通


reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-4-19 18:17 , Processed in 0.068355 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList