mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-27 10:50:41 +00:00
!7971 fix:add check basicinfo when prosessbleonline
Merge pull request !7971 from 李志坚/master
This commit is contained in:
commit
b0d5600b06
@ -102,6 +102,7 @@ int32_t LnnSendDisconnectMsgToConnFsm(LnnConnectionFsm *connFsm);
|
||||
int32_t LnnSendLeaveRequestToConnFsm(LnnConnectionFsm *connFsm);
|
||||
int32_t LnnSendSyncOfflineFinishToConnFsm(LnnConnectionFsm *connFsm);
|
||||
int32_t LnnSendNewNetworkOnlineToConnFsm(LnnConnectionFsm *connFsm);
|
||||
bool CheckRemoteBasicInfoChanged(const NodeInfo *newNodeInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
@ -1169,7 +1169,7 @@ static bool IsSupportBrDupBle(uint32_t feature, AuthCapability capaBit)
|
||||
return ((feature & (1 << (uint32_t)capaBit)) != 0);
|
||||
}
|
||||
|
||||
static bool CheckBasicInfoChange(const NodeInfo *newNodeInfo)
|
||||
bool CheckRemoteBasicInfoChanged(const NodeInfo *newNodeInfo)
|
||||
{
|
||||
if (newNodeInfo == NULL) {
|
||||
return false;
|
||||
@ -1195,7 +1195,7 @@ static void ProcessBleOnline(const LnnConntionInfo *connInfo)
|
||||
}
|
||||
if (LnnGetRemoteNodeInfoById(connInfo->nodeInfo->deviceInfo.deviceUdid, CATEGORY_UDID,
|
||||
&remoteInfo) == SOFTBUS_OK && LnnHasDiscoveryType(&remoteInfo, DISCOVERY_TYPE_BLE) &&
|
||||
!CheckBasicInfoChange(connInfo->nodeInfo)) {
|
||||
!CheckRemoteBasicInfoChanged(connInfo->nodeInfo)) {
|
||||
LNN_LOGI(LNN_BUILDER, "ble has online, no need to go online");
|
||||
return;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ int32_t TrySendJoinLNNRequest(const JoinLnnMsgPara *para, bool needReportFailure
|
||||
DfxRecordLnnServerjoinStart(¶->addr, para->pkgName, needReportFailure);
|
||||
isShort = para->isNeedConnect ? false : true;
|
||||
LnnConnectionFsm *connFsm = FindConnectionFsmByAddr(¶->addr, isShort);
|
||||
if (connFsm == NULL || connFsm->isDead) {
|
||||
if (connFsm == NULL || connFsm->isDead || CheckRemoteBasicInfoChanged(para->dupInfo)) {
|
||||
if (TryPendingJoinRequest(para, needReportFailure)) {
|
||||
LNN_LOGI(LNN_BUILDER, "join request is pending, peerAddr=%{public}s", LnnPrintConnectionAddr(¶->addr));
|
||||
FreeJoinLnnMsgPara(para);
|
||||
|
@ -166,7 +166,7 @@ int32_t PostJoinRequestToConnFsm(LnnConnectionFsm *connFsm, const JoinLnnMsgPara
|
||||
if (connFsm == NULL) {
|
||||
connFsm = FindConnectionFsmByAddr(¶->addr, false);
|
||||
}
|
||||
if (connFsm == NULL || connFsm->isDead) {
|
||||
if (connFsm == NULL || connFsm->isDead || CheckRemoteBasicInfoChanged(para->dupInfo)) {
|
||||
connFsm = StartNewConnectionFsm(¶->addr, para->pkgName, para->isNeedConnect);
|
||||
if (connFsm != NULL) {
|
||||
connFsm->connInfo.dupInfo = (para->dupInfo == NULL) ? NULL : DupNodeInfo(para->dupInfo);
|
||||
|
@ -199,6 +199,7 @@ public:
|
||||
virtual bool IsSupportFeatureByCapaBit(uint32_t feature, AuthCapability capaBit) = 0;
|
||||
virtual int32_t LnnGetRemoteNodeInfoByKey(const char *key, NodeInfo *info) = 0;
|
||||
virtual void RegisterOOBEMonitor(void *p);
|
||||
virtual bool CheckRemoteBasicInfoChanged(const NodeInfo *newNodeInfo);
|
||||
virtual int32_t CheckAuthChannelIsExit(ConnectOption *connInfo);
|
||||
};
|
||||
class NetBuilderDepsInterfaceMock : public NetBuilderDepsInterface {
|
||||
@ -341,6 +342,7 @@ public:
|
||||
MOCK_METHOD1(CheckAuthChannelIsExit, int32_t (ConnectOption *connInfo));
|
||||
static int32_t ActionOfLnnGetSettingDeviceName(char *deviceName, uint32_t len);
|
||||
static int32_t ActionOfLnnGetAllOnlineNodeInfo(NodeBasicInfo **info, int32_t *infoNum);
|
||||
MOCK_METHOD1(CheckRemoteBasicInfoChanged, bool (const NodeInfo *));
|
||||
};
|
||||
} // namespace OHOS
|
||||
#endif // LNN_NET_BUILDER_DEPS_MOCK_H
|
||||
|
@ -722,6 +722,11 @@ void RegisterOOBEMonitor(void *p)
|
||||
return GetNetBuilderDepsInterface()->RegisterOOBEMonitor(p);
|
||||
}
|
||||
|
||||
bool CheckRemoteBasicInfoChanged(const NodeInfo *newNodeInfo)
|
||||
{
|
||||
return GetNetBuilderDepsInterface()->CheckRemoteBasicInfoChanged(newNodeInfo);
|
||||
}
|
||||
|
||||
int32_t CheckAuthChannelIsExit(ConnectOption *connInfo)
|
||||
{
|
||||
return GetNetBuilderDepsInterface()->CheckAuthChannelIsExit(connInfo);
|
||||
|
Loading…
Reference in New Issue
Block a user