开发环境:openharmony 3.1 release  sdk 3.1.7.7 full

问题描述:想通过hap界面进行设备认证,使用样例提供的deviceManager  调用@ohos.distributedHardware.deviceManager' 进行设备认证,对端设备返回报文长度不对,导致认证失败。

 

使用navtive hichain_main_OH 认证可以成功

 

09-05 16:25:25.425   333   333 I 015c0/dsoftbus_standard: [AUTH]auth start post eth data, authId is 11543362142214, moduleId is 8, len is 347
09-05 16:25:25.425   370  1567 I 015c0/dsoftbus_standard: [TRAN]OpenAuthSession ok: sessionId=1, channelId=1, channelType = 3
09-05 16:25:25.425   370  1567 E 04100/: [devicemanagerservice][IpcCmdProcessAUTHENTICATE_DEVICE]:AuthenticateDevice
09-05 16:25:25.425   370  1567 E 04100/: [devicemanagerservice][IpcCmdProcessAUTHENTICATE_DEVICE]:AuthenticateDevice 0
09-05 16:25:25.429   333  1933 I 015c0/dsoftbus_standard: [AUTH]auth recv eth data, head len is 51, module = 8, flag = 1, seq = 0
09-05 16:25:25.430   333  1933 I 015c0/dsoftbus_standard: [AUTH]auth ip data module is 8
09-05 16:25:25.430   333  1933 E 015c0/dsoftbus_standard: [TRAN]invalid param.
09-05 16:25:25.430   333  1933 E 015c0/dsoftbus_standard: [TRAN]unpackReply failed

查看发送报文,字段都有也没超长度

发送报文和接收报文如下

 

对端设备打印
[AUTH]auth recv eth data, head len is 347, module = 8, flag = 0, seq = 0
[AUTH]auth ip data module is 8
[TRAN]invalid param.
[COMM]Cannot find or invalid [ERR_CODE]
[TRAN]TransGetUidAndPid err: sessionName=ohos.distributedhardware.devicemanager.resident
[TRAN]TransGetUidAndPid failed
[TRAN]CreateAuthChannelInfo failed
[TRAN]unpackRequest failed
[AUTH]auth start post eth data, authId is 19, moduleId is 8, len is 51
[AUTH]auth handle leave LNN, authId is 19
[AUTH]auth clear session key by seq, no session key in memory
从这个打印看,是不是对端也必须使用deviceManager  调用@ohos.distributedHardware.deviceManager' 才行,目前对端是用的 devicegroupmanage 认证的

 

 

 

 

相关文件下载
devicemanager打印.txt
28.32 KB
下载
Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐