mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2025-01-06 09:41:48 +00:00
!2375 fix:modify wifi lnn ble discovery report online
Merge pull request !2375 from michael4096/master
This commit is contained in:
commit
fc00b40397
@ -70,7 +70,7 @@ int32_t LnnGetLnnRelation(const char *id, IdCategory type, uint8_t *relation, ui
|
|||||||
int32_t LnnSetDLConnCapability(const char *networkId, uint64_t connCapability);
|
int32_t LnnSetDLConnCapability(const char *networkId, uint64_t connCapability);
|
||||||
int32_t LnnSetDLNodeAddr(const char *id, IdCategory type, const char *addr);
|
int32_t LnnSetDLNodeAddr(const char *id, IdCategory type, const char *addr);
|
||||||
int32_t LnnGetAllAuthSeq(const char *udid, int64_t *authSeq, uint32_t num);
|
int32_t LnnGetAllAuthSeq(const char *udid, int64_t *authSeq, uint32_t num);
|
||||||
const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash, DiscoveryType discType);
|
const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash);
|
||||||
void LnnRefreshDeviceOnlineStateAndDevIdInfo(const char *pkgName, DeviceInfo *device,
|
void LnnRefreshDeviceOnlineStateAndDevIdInfo(const char *pkgName, DeviceInfo *device,
|
||||||
const InnerDeviceInfoAddtions *addtions);
|
const InnerDeviceInfoAddtions *addtions);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1432,7 +1432,7 @@ int32_t LnnInitDistributedLedger(void)
|
|||||||
return SOFTBUS_OK;
|
return SOFTBUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash, DiscoveryType discType)
|
const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash)
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
int32_t infoNum = 0;
|
int32_t infoNum = 0;
|
||||||
@ -1452,8 +1452,8 @@ const NodeInfo *LnnGetOnlineNodeByUdidHash(const char *recvUdidHash, DiscoveryTy
|
|||||||
}
|
}
|
||||||
for (i = 0; i < infoNum; ++i) {
|
for (i = 0; i < infoNum; ++i) {
|
||||||
const NodeInfo *nodeInfo = LnnGetNodeInfoById(info[i].networkId, CATEGORY_NETWORK_ID);
|
const NodeInfo *nodeInfo = LnnGetNodeInfoById(info[i].networkId, CATEGORY_NETWORK_ID);
|
||||||
if (nodeInfo == NULL || !LnnHasDiscoveryType(nodeInfo, discType)) {
|
if (nodeInfo == NULL) {
|
||||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "node online not have discType:%d", discType);
|
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_INFO, "nodeInfo is null.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (GenerateStrHashAndConvertToHexString((const unsigned char *)nodeInfo->deviceInfo.deviceUdid,
|
if (GenerateStrHashAndConvertToHexString((const unsigned char *)nodeInfo->deviceInfo.deviceUdid,
|
||||||
@ -1476,7 +1476,7 @@ static void RefreshDeviceInfoByDevId(DeviceInfo *device, const InnerDeviceInfoAd
|
|||||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "RefreshDeviceInfoDevId parameter error");
|
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "RefreshDeviceInfoDevId parameter error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const NodeInfo *nodeInfo = LnnGetOnlineNodeByUdidHash(device->devId, DISCOVERY_TYPE_BLE);
|
const NodeInfo *nodeInfo = LnnGetOnlineNodeByUdidHash(device->devId);
|
||||||
if (nodeInfo == NULL) {
|
if (nodeInfo == NULL) {
|
||||||
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "device udidhash:%s is not online", device->devId);
|
SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "device udidhash:%s is not online", device->devId);
|
||||||
return;
|
return;
|
||||||
@ -1492,7 +1492,7 @@ static void RefreshDeviceOnlineStateInfo(DeviceInfo *device, const InnerDeviceIn
|
|||||||
device->isOnline = LnnGetOnlineStateById(device->devId, CATEGORY_UDID);
|
device->isOnline = LnnGetOnlineStateById(device->devId, CATEGORY_UDID);
|
||||||
}
|
}
|
||||||
if (addtions->medium == BLE) {
|
if (addtions->medium == BLE) {
|
||||||
device->isOnline = ((LnnGetOnlineNodeByUdidHash(device->devId, DISCOVERY_TYPE_BLE)) != NULL) ? true : false;
|
device->isOnline = ((LnnGetOnlineNodeByUdidHash(device->devId)) != NULL) ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user