diff --git a/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_utils.c b/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_utils.c index 4d9e61deb..7112a807e 100644 --- a/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_utils.c +++ b/adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_utils.c @@ -351,6 +351,12 @@ int GetBtScanMode(uint16_t scanInterval, uint16_t scanWindow) if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P25 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P25) { return OHOS_BLE_SCAN_MODE_OP_P25_60_240; } + if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P50 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P50) { + return OHOS_BLE_SCAN_MODE_OP_P50_30_60; + } + if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P75 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P75) { + return OHOS_BLE_SCAN_MODE_OP_P75_30_40; + } if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P100 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P100) { return OHOS_BLE_SCAN_MODE_OP_P100_1000_1000; } diff --git a/adapter/common/net/bluetooth/broadcast/interface/softbus_broadcast_type.h b/adapter/common/net/bluetooth/broadcast/interface/softbus_broadcast_type.h index 34bb79d4e..4b5537e46 100644 --- a/adapter/common/net/bluetooth/broadcast/interface/softbus_broadcast_type.h +++ b/adapter/common/net/bluetooth/broadcast/interface/softbus_broadcast_type.h @@ -44,11 +44,15 @@ extern "C"{ #define SOFTBUS_BC_SCAN_INTERVAL_P2_FAST 1500 #define SOFTBUS_BC_SCAN_INTERVAL_P10 300 #define SOFTBUS_BC_SCAN_INTERVAL_P25 240 +#define SOFTBUS_BC_SCAN_INTERVAL_P50 60 +#define SOFTBUS_BC_SCAN_INTERVAL_P75 40 #define SOFTBUS_BC_SCAN_INTERVAL_P100 1000 #define SOFTBUS_BC_SCAN_WINDOW_P2 60 #define SOFTBUS_BC_SCAN_WINDOW_P2_FAST 30 #define SOFTBUS_BC_SCAN_WINDOW_P10 30 #define SOFTBUS_BC_SCAN_WINDOW_P25 60 +#define SOFTBUS_BC_SCAN_WINDOW_P50 30 +#define SOFTBUS_BC_SCAN_WINDOW_P75 30 #define SOFTBUS_BC_SCAN_WINDOW_P100 1000 /** diff --git a/adapter/common/net/bluetooth/broadcast/manager/src/softbus_broadcast_mgr.c b/adapter/common/net/bluetooth/broadcast/manager/src/softbus_broadcast_mgr.c index d3f4f9114..4fce000bd 100644 --- a/adapter/common/net/bluetooth/broadcast/manager/src/softbus_broadcast_mgr.c +++ b/adapter/common/net/bluetooth/broadcast/manager/src/softbus_broadcast_mgr.c @@ -64,6 +64,8 @@ typedef enum { SCAN_FREQ_P2_30_1500, SCAN_FREQ_P10_30_300, SCAN_FREQ_P25_60_240, + SCAN_FREQ_P50_30_60, + SCAN_FREQ_P75_30_40, SCAN_FREQ_P100_1000_1000, SCAN_FREQ_BUTT, } ScanFreq; @@ -1058,6 +1060,14 @@ static void GetScanIntervalAndWindow(int32_t freq, SoftBusBcScanParams *adapterP adapterParam->scanInterval = SOFTBUS_BC_SCAN_INTERVAL_P25; adapterParam->scanWindow = SOFTBUS_BC_SCAN_WINDOW_P25; } + if (freq == SCAN_FREQ_P50_30_60) { + adapterParam->scanInterval = SOFTBUS_BC_SCAN_INTERVAL_P50; + adapterParam->scanWindow = SOFTBUS_BC_SCAN_WINDOW_P50; + } + if (freq == SCAN_FREQ_P75_30_40) { + adapterParam->scanInterval = SOFTBUS_BC_SCAN_INTERVAL_P75; + adapterParam->scanWindow = SOFTBUS_BC_SCAN_WINDOW_P75; + } if (freq == SCAN_FREQ_P100_1000_1000) { adapterParam->scanInterval = SOFTBUS_BC_SCAN_INTERVAL_P100; adapterParam->scanWindow = SOFTBUS_BC_SCAN_WINDOW_P100; @@ -1497,6 +1507,12 @@ static int32_t GetScanFreq(uint16_t scanInterval, uint16_t scanWindow) if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P25 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P25) { return SCAN_FREQ_P25_60_240; } + if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P50 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P50) { + return SCAN_FREQ_P50_30_60; + } + if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P75 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P75) { + return SCAN_FREQ_P75_30_40; + } if (scanInterval == SOFTBUS_BC_SCAN_INTERVAL_P100 && scanWindow == SOFTBUS_BC_SCAN_WINDOW_P100) { return SCAN_FREQ_P100_1000_1000; } diff --git a/core/common/softbus_property/softbus_feature_config.c b/core/common/softbus_property/softbus_feature_config.c index a6e5b1883..6bd25c26d 100644 --- a/core/common/softbus_property/softbus_feature_config.c +++ b/core/common/softbus_property/softbus_feature_config.c @@ -61,6 +61,7 @@ #define DEFAULT_DISC_FREQ_MID ((5 << 16) | 24) #define DEFAULT_DISC_FREQ_HIGH ((5 << 16) | 36) #define DEFAULT_DISC_FREQ_SUPER_HIGH ((10 << 16) | 48) +#define DEFAULT_DISC_FREQ_EXTREME_HIGH ((10 << 16) | 48) #define DEFAULT_DISC_COAP_MAX_DEVICE_NUM 20 #ifdef SOFTBUS_LINUX @@ -179,6 +180,7 @@ static DiscConfigItem g_discConfig = { DEFAULT_DISC_FREQ_MID, DEFAULT_DISC_FREQ_HIGH, DEFAULT_DISC_FREQ_SUPER_HIGH, + DEFAULT_DISC_FREQ_EXTREME_HIGH, }, .discCoapMaxDeviceNum = DEFAULT_DISC_COAP_MAX_DEVICE_NUM }; diff --git a/core/discovery/ble/softbus_ble/src/disc_ble.c b/core/discovery/ble/softbus_ble/src/disc_ble.c index 135c6fed4..94e8ee0d8 100644 --- a/core/discovery/ble/softbus_ble/src/disc_ble.c +++ b/core/discovery/ble/softbus_ble/src/disc_ble.c @@ -158,6 +158,7 @@ static ScanSetting g_scanTable[FREQ_BUTT] = { {SOFTBUS_BC_SCAN_WINDOW_P2, SOFTBUS_BC_SCAN_INTERVAL_P2}, {SOFTBUS_BC_SCAN_WINDOW_P10, SOFTBUS_BC_SCAN_INTERVAL_P10}, {SOFTBUS_BC_SCAN_WINDOW_P25, SOFTBUS_BC_SCAN_INTERVAL_P25}, + {SOFTBUS_BC_SCAN_WINDOW_P75, SOFTBUS_BC_SCAN_INTERVAL_P75}, {SOFTBUS_BC_SCAN_WINDOW_P100, SOFTBUS_BC_SCAN_INTERVAL_P100} }; diff --git a/core/discovery/manager/src/disc_manager.c b/core/discovery/manager/src/disc_manager.c index 66794a9f1..e9dbb04a9 100644 --- a/core/discovery/manager/src/disc_manager.c +++ b/core/discovery/manager/src/disc_manager.c @@ -398,7 +398,7 @@ static int32_t CheckPublishInfo(const PublishInfo *info) SOFTBUS_INVALID_PARAM, DISC_CONTROL, "mode is invalid"); DISC_CHECK_AND_RETURN_RET_LOGW(info->medium >= AUTO && info->medium <= COAP, SOFTBUS_DISCOVER_MANAGER_INVALID_MEDIUM, DISC_CONTROL, "mode is invalid"); - DISC_CHECK_AND_RETURN_RET_LOGW(info->freq >= LOW && info->freq <= SUPER_HIGH, + DISC_CHECK_AND_RETURN_RET_LOGW(info->freq >= LOW && info->freq < FREQ_BUTT, SOFTBUS_INVALID_PARAM, DISC_CONTROL, "freq is invalid"); if (info->capabilityData == NULL) { @@ -438,7 +438,7 @@ static int32_t CheckSubscribeInfo(const SubscribeInfo *info) SOFTBUS_INVALID_PARAM, DISC_CONTROL, "mode is invalid"); DISC_CHECK_AND_RETURN_RET_LOGW(info->medium >= AUTO && info->medium <= COAP, SOFTBUS_DISCOVER_MANAGER_INVALID_MEDIUM, DISC_CONTROL, "mode is invalid"); - DISC_CHECK_AND_RETURN_RET_LOGW(info->freq >= LOW && info->freq <= SUPER_HIGH, + DISC_CHECK_AND_RETURN_RET_LOGW(info->freq >= LOW && info->freq < FREQ_BUTT, SOFTBUS_INVALID_PARAM, DISC_CONTROL, "freq is invalid"); if (info->capabilityData == NULL) { diff --git a/interfaces/kits/common/softbus_common.h b/interfaces/kits/common/softbus_common.h index 37e204533..5797065eb 100644 --- a/interfaces/kits/common/softbus_common.h +++ b/interfaces/kits/common/softbus_common.h @@ -340,6 +340,8 @@ typedef enum { HIGH = 2, /** Super-high */ SUPER_HIGH = 3, + /** Extreme-high */ + EXTREME_HIGH = 4, FREQ_BUTT } ExchangeFreq; diff --git a/sdk/bus_center/service/src/client_bus_center.c b/sdk/bus_center/service/src/client_bus_center.c index 7635e61a4..cdb319736 100644 --- a/sdk/bus_center/service/src/client_bus_center.c +++ b/sdk/bus_center/service/src/client_bus_center.c @@ -82,7 +82,7 @@ static int32_t PublishInfoCheck(const PublishInfo *info) LNN_LOGE(LNN_STATE, "medium is invalid"); return SOFTBUS_INVALID_PARAM; } - if ((info->freq < LOW) || (info->freq > SUPER_HIGH)) { + if ((info->freq < LOW) || (info->freq >= FREQ_BUTT)) { LNN_LOGE(LNN_STATE, "freq is invalid"); return SOFTBUS_INVALID_PARAM; } @@ -116,7 +116,7 @@ static int32_t SubscribeInfoCheck(const SubscribeInfo *info) LNN_LOGE(LNN_STATE, "medium is invalid"); return SOFTBUS_INVALID_PARAM; } - if ((info->freq < LOW) || (info->freq > SUPER_HIGH)) { + if ((info->freq < LOW) || (info->freq >= FREQ_BUTT)) { LNN_LOGE(LNN_STATE, "freq is invalid"); return SOFTBUS_INVALID_PARAM; } diff --git a/sdk/discovery/service/src/client_disc_service.c b/sdk/discovery/service/src/client_disc_service.c index 2c8c59481..499ea9646 100644 --- a/sdk/discovery/service/src/client_disc_service.c +++ b/sdk/discovery/service/src/client_disc_service.c @@ -40,7 +40,7 @@ static int32_t PublishInfoCheck(const PublishInfo *info) return SOFTBUS_INVALID_PARAM; } - if ((info->freq < LOW) || (info->freq > SUPER_HIGH)) { + if ((info->freq < LOW) || (info->freq >= FREQ_BUTT)) { DISC_LOGE(DISC_SDK, "freq is invalid"); return SOFTBUS_INVALID_PARAM; } @@ -74,7 +74,7 @@ static int32_t SubscribeInfoCheck(const SubscribeInfo *info) return SOFTBUS_INVALID_PARAM; } - if ((info->freq < LOW) || (info->freq > SUPER_HIGH)) { + if ((info->freq < LOW) || (info->freq >= FREQ_BUTT)) { DISC_LOGE(DISC_SDK, "freq is invalid"); return SOFTBUS_INVALID_PARAM; } diff --git a/tests/core/discovery/coap/unittest/disc_coap_test.cpp b/tests/core/discovery/coap/unittest/disc_coap_test.cpp index fe8bae0ea..0dd4e8412 100644 --- a/tests/core/discovery/coap/unittest/disc_coap_test.cpp +++ b/tests/core/discovery/coap/unittest/disc_coap_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/tests/core/discovery/coap/unittest/disc_nstackx_adapter_test.cpp b/tests/core/discovery/coap/unittest/disc_nstackx_adapter_test.cpp index 0273df2cc..6c7bab89c 100644 --- a/tests/core/discovery/coap/unittest/disc_nstackx_adapter_test.cpp +++ b/tests/core/discovery/coap/unittest/disc_nstackx_adapter_test.cpp @@ -292,6 +292,12 @@ HWTEST_F(DiscNstackxAdapterTest, TestDiscCoapAdapterStartDisc002, TestSize.Level ret = DiscCoapStopDiscovery(); EXPECT_EQ(ret, SOFTBUS_OK); + testOption.freq = EXTREME_HIGH; + ret = DiscCoapStartDiscovery(&testOption); + EXPECT_EQ(ret, SOFTBUS_NETWORK_NOT_FOUND); + ret = DiscCoapStopDiscovery(); + EXPECT_EQ(ret, SOFTBUS_OK); + testOption.freq = LOW - 1; ret = DiscCoapStartDiscovery(&testOption); EXPECT_NE(ret, SOFTBUS_OK); diff --git a/tests/core/discovery/manager/unittest/disc_manager_test.cpp b/tests/core/discovery/manager/unittest/disc_manager_test.cpp index 5294f71b9..d03b04291 100644 --- a/tests/core/discovery/manager/unittest/disc_manager_test.cpp +++ b/tests/core/discovery/manager/unittest/disc_manager_test.cpp @@ -329,7 +329,7 @@ HWTEST_F(DiscManagerTest, DiscPublishTest002, TestSize.Level1) TEST_ASSERT_TRUE(ret != 0); testInfo.medium = COAP; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = DiscPublish(MODULE_LNN, &testInfo); TEST_ASSERT_TRUE(ret != 0); testInfo.freq = LOW; @@ -441,6 +441,11 @@ void DiscPublishTestAbstract001(DiscModule module, PublishInfo *info) TEST_ASSERT_TRUE(ret == 0); DiscUnpublish(module, info->publishId); + info->freq = EXTREME_HIGH; + ret = DiscPublish(module, info); + TEST_ASSERT_TRUE(ret == 0); + DiscUnpublish(module, info->publishId); + info->freq = LOW; DiscMgrDeinit(); } @@ -561,7 +566,7 @@ HWTEST_F(DiscManagerTest, DiscStartScanTest002, TestSize.Level1) TEST_ASSERT_TRUE(ret != 0); testInfo.medium = COAP; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = DiscStartScan(MODULE_LNN, &testInfo); TEST_ASSERT_TRUE(ret != 0); testInfo.freq = LOW; @@ -728,7 +733,7 @@ HWTEST_F(DiscManagerTest, DiscStartAdvertiseTest002, TestSize.Level1) TEST_ASSERT_TRUE(ret != 0); testInfo.medium = COAP; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = DiscStartAdvertise(MODULE_LNN, &testInfo); TEST_ASSERT_TRUE(ret != 0); testInfo.freq = LOW; @@ -874,6 +879,11 @@ void DiscStartAdvertiseTestAbstract002(DiscModule module, SubscribeInfo *info) TEST_ASSERT_TRUE(ret == 0); DiscStopAdvertise(MODULE_LNN, info->subscribeId); + info->freq = EXTREME_HIGH; + ret = DiscStartAdvertise(MODULE_LNN, info); + TEST_ASSERT_TRUE(ret == 0); + DiscStopAdvertise(MODULE_LNN, info->subscribeId); + info->freq = LOW; DiscMgrDeinit(); } @@ -943,7 +953,7 @@ HWTEST_F(DiscManagerTest, DiscSubscribeTest002, TestSize.Level1) TEST_ASSERT_TRUE(ret != 0); testInfo.medium = COAP; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = DiscSubscribe(MODULE_LNN, &testInfo); TEST_ASSERT_TRUE(ret != 0); testInfo.freq = LOW; @@ -1197,6 +1207,11 @@ void DiscUnpublishTestAbstract001(DiscModule module, PublishInfo *info) ret = DiscUnpublish(module, info->publishId); TEST_ASSERT_TRUE(ret == 0); + info->freq = EXTREME_HIGH; + DiscPublish(module, info); + ret = DiscUnpublish(module, info->publishId); + TEST_ASSERT_TRUE(ret == 0); + info->freq = LOW; DiscMgrDeinit(); } @@ -1358,6 +1373,11 @@ void DiscStopAdvertiseTestAbstract001(DiscModule module, SubscribeInfo *info) ret = DiscStopAdvertise(module, info->subscribeId); TEST_ASSERT_TRUE(ret == 0); + info->freq = EXTREME_HIGH; + DiscStartAdvertise(module, info); + ret = DiscStopAdvertise(module, info->subscribeId); + TEST_ASSERT_TRUE(ret == 0); + info->freq = LOW; DiscMgrDeinit(); } @@ -1441,7 +1461,7 @@ HWTEST_F(DiscManagerTest, PublishServiceTest002, TestSize.Level1) TEST_ASSERT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = DiscPublishService("pkgname1", &testInfo); TEST_ASSERT_TRUE(ret != 0); testInfo.freq = LOW; @@ -1631,6 +1651,11 @@ void PublishServiceTestAbstract001(PublishInfo *info) TEST_ASSERT_TRUE(ret == 0); DiscUnPublishService("pkgname1", info->publishId); + info->freq = EXTREME_HIGH; + ret = DiscPublishService("pkgname1", info); + TEST_ASSERT_TRUE(ret == 0); + DiscUnPublishService("pkgname1", info->publishId); + info->freq = LOW; DiscMgrDeinit(); } @@ -1724,7 +1749,7 @@ HWTEST_F(DiscManagerTest, StartDiscoveryTest002, TestSize.Level1) TEST_ASSERT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = DiscStartDiscovery("pkgname1", &testInfo, &g_subscribeCb); TEST_ASSERT_TRUE(ret != 0); testInfo.freq = LOW; @@ -1867,6 +1892,11 @@ void StartDiscoveryTestAbstract001(SubscribeInfo *info) TEST_ASSERT_TRUE(ret == 0); DiscStopDiscovery("pkgname1", info->subscribeId); + info->freq = EXTREME_HIGH; + ret = DiscStartDiscovery("pkgname1", info, &g_subscribeCb); + TEST_ASSERT_TRUE(ret == 0); + DiscStopDiscovery("pkgname1", info->subscribeId); + DiscMgrDeinit(); } @@ -2005,6 +2035,11 @@ void UnPublishServiceTestAbstract001(PublishInfo *info) ret = DiscUnPublishService("pkgname1", info->publishId); TEST_ASSERT_TRUE(ret == 0); + info->freq = EXTREME_HIGH; + DiscPublishService("pkgname1", info); + ret = DiscUnPublishService("pkgname1", info->publishId); + TEST_ASSERT_TRUE(ret == 0); + DiscMgrDeinit(); } @@ -2155,6 +2190,11 @@ void StopDiscoveryTestAbstract001(SubscribeInfo *info) ret = DiscStopDiscovery("pkgname1", info->subscribeId); TEST_ASSERT_TRUE(ret == 0); + info->freq = EXTREME_HIGH; + DiscStartDiscovery("pkgname1", info, &g_subscribeCb); + ret = DiscStopDiscovery("pkgname1", info->subscribeId); + TEST_ASSERT_TRUE(ret == 0); + DiscMgrDeinit(); } diff --git a/tests/sdk/bus_center/unittest/bus_center_sdk_publish_test.cpp b/tests/sdk/bus_center/unittest/bus_center_sdk_publish_test.cpp index 38accfc6c..a9149a066 100644 --- a/tests/sdk/bus_center/unittest/bus_center_sdk_publish_test.cpp +++ b/tests/sdk/bus_center/unittest/bus_center_sdk_publish_test.cpp @@ -181,7 +181,7 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest002, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM); @@ -386,6 +386,12 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest006, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, testInfo.publishId); EXPECT_EQ(ret, SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, testInfo.publishId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -432,6 +438,12 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest007, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, testInfo.publishId); EXPECT_EQ(ret, SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, testInfo.publishId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -478,6 +490,12 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest008, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, testInfo.publishId); EXPECT_EQ(ret, SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, testInfo.publishId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -524,6 +542,12 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest009, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, testInfo.publishId); EXPECT_EQ(ret, SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, testInfo.publishId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -706,6 +730,11 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest014, TestSize.Level1) ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, testInfo.publishId); + + testInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, testInfo.publishId); } /** @@ -748,6 +777,11 @@ HWTEST_F(BusCenterSdkPublish, PublishLNNTest015, TestSize.Level1) ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, testInfo.publishId); + + testInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, testInfo.publishId); } /** diff --git a/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_small_test.cpp b/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_small_test.cpp index f4b058ea5..36c5f076f 100644 --- a/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_small_test.cpp +++ b/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_small_test.cpp @@ -156,7 +156,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest001, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(TEST_PKG_NAME, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -213,7 +213,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest002, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(TEST_PKG_NAME, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -270,7 +270,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest003, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(PKG_NAME1, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -327,7 +327,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest004, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(PKG_NAME1, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -384,7 +384,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest005, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(PKG_NAME1, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -441,7 +441,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest006, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(PKG_NAME1, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -498,7 +498,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest007, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(PKG_NAME1, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -555,7 +555,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest008, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(PKG_NAME1, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; diff --git a/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_test.cpp b/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_test.cpp index a669c2558..00f3ab51f 100644 --- a/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_test.cpp +++ b/tests/sdk/bus_center/unittest/bus_center_sdk_refresh_test.cpp @@ -182,6 +182,12 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest002, TestSize.Level1) EXPECT_TRUE(ret == 0); ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); EXPECT_TRUE(ret == 0); + + testInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); + EXPECT_TRUE(ret == 0); + ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); + EXPECT_TRUE(ret == 0); } /** @@ -229,6 +235,12 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest003, TestSize.Level1) EXPECT_TRUE(ret == 0); ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); EXPECT_TRUE(ret == 0); + + testInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); + EXPECT_TRUE(ret == 0); + ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); + EXPECT_TRUE(ret == 0); } /** @@ -360,6 +372,12 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest007, TestSize.Level1) EXPECT_TRUE(ret == 0); ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); EXPECT_TRUE(ret == 0); + + testInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); + EXPECT_TRUE(ret == 0); + ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); + EXPECT_TRUE(ret == 0); } /** @@ -407,6 +425,12 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest008, TestSize.Level1) EXPECT_TRUE(ret == 0); ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); EXPECT_TRUE(ret == 0); + + testInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); + EXPECT_TRUE(ret == 0); + ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); + EXPECT_TRUE(ret == 0); } /** @@ -451,7 +475,7 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest009, TestSize.Level1) EXPECT_TRUE(ret != 0); testInfo.mode = DISCOVER_MODE_ACTIVE; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret != 0); testInfo.freq = LOW; @@ -743,6 +767,11 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest018, TestSize.Level1) ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret == 0); ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); + + testInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); + EXPECT_TRUE(ret == 0); + ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); } /** @@ -786,6 +815,11 @@ HWTEST_F(BusCenterSdkRefresh, RefreshLNNTest019, TestSize.Level1) ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); EXPECT_TRUE(ret == 0); ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); + + testInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb1); + EXPECT_TRUE(ret == 0); + ret = StopRefreshLNN(g_pkgName, testInfo.subscribeId); } /** diff --git a/tests/sdk/bus_center/unittest/bus_center_sdk_test.cpp b/tests/sdk/bus_center/unittest/bus_center_sdk_test.cpp index 782a2deb1..230b28852 100644 --- a/tests/sdk/bus_center/unittest/bus_center_sdk_test.cpp +++ b/tests/sdk/bus_center/unittest/bus_center_sdk_test.cpp @@ -394,7 +394,7 @@ HWTEST_F(BusCenterSdkTest, PublishLNNTest001, TestSize.Level0) EXPECT_TRUE(ret != 0); g_pInfo.mode = DISCOVER_MODE_ACTIVE; - g_pInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + g_pInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = PublishLNN(TEST_PKG_NAME, &g_pInfo, &g_publishCb); EXPECT_TRUE(ret != 0); g_pInfo.freq = LOW; @@ -480,7 +480,7 @@ HWTEST_F(BusCenterSdkTest, RefreshLNNTest001, TestSize.Level0) EXPECT_TRUE(ret != 0); g_sInfo.mode = DISCOVER_MODE_ACTIVE; - g_sInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + g_sInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(TEST_PKG_NAME, &g_sInfo, &g_refreshCb); EXPECT_TRUE(ret != 0); g_sInfo.freq = LOW; diff --git a/tests/sdk/discovery/fuzztest/discoveryservice_fuzzer/discoveryservice_fuzzer.cpp b/tests/sdk/discovery/fuzztest/discoveryservice_fuzzer/discoveryservice_fuzzer.cpp index 440588811..4e4902dbe 100644 --- a/tests/sdk/discovery/fuzztest/discoveryservice_fuzzer/discoveryservice_fuzzer.cpp +++ b/tests/sdk/discovery/fuzztest/discoveryservice_fuzzer/discoveryservice_fuzzer.cpp @@ -19,6 +19,10 @@ #include #include "discovery_service.h" +#define MID_THRESHOLD (UINT8_MAX / FREQ_BUTT * 2) +#define HIGH_THRESHOLD (UINT8_MAX / FREQ_BUTT * 3) +#define SUPER_HIGH_THRESHOLD (UINT8_MAX / FREQ_BUTT * 4) + namespace OHOS { static std::string TEST_PACKAGE_NAME = "TestPackageName"; @@ -69,13 +73,16 @@ static ExchangeFreq GenerateFreq(uint8_t data) if (data < UINT8_MAX / FREQ_BUTT) { return LOW; } - if (data < UINT8_MAX / FREQ_BUTT * 2) { + if (data < MID_THRESHOLD) { return MID; } - if (data < UINT8_MAX / FREQ_BUTT * 3) { + if (data < HIGH_THRESHOLD) { return HIGH; } - return SUPER_HIGH; + if (data < SUPER_HIGH_THRESHOLD) { + return SUPER_HIGH; + } + return EXTREME_HIGH; } static PublishInfo *GeneratePublishInfo(const uint8_t *data, size_t size) diff --git a/tests/sdk/discovery/unittest/disc_sdk_auto_test.cpp b/tests/sdk/discovery/unittest/disc_sdk_auto_test.cpp index bf1446e03..6c77c9962 100644 --- a/tests/sdk/discovery/unittest/disc_sdk_auto_test.cpp +++ b/tests/sdk/discovery/unittest/disc_sdk_auto_test.cpp @@ -190,6 +190,12 @@ HWTEST_F(DiscSdkAutoTest, PublishServiceTest001, TestSize.Level1) EXPECT_TRUE(ret == SOFTBUS_OK); ret = UnPublishService(g_pkgName, testInfo.publishId); EXPECT_TRUE(ret == SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = PublishService(g_pkgName, &testInfo, &g_publishCb); + EXPECT_TRUE(ret == SOFTBUS_OK); + ret = UnPublishService(g_pkgName, testInfo.publishId); + EXPECT_TRUE(ret == SOFTBUS_OK); } /** @@ -237,6 +243,12 @@ HWTEST_F(DiscSdkAutoTest, PublishServiceTest002, TestSize.Level1) EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); ret = UnPublishService(g_pkgName, testInfo.publishId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + testInfo.freq = EXTREME_HIGH; + ret = PublishService(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + ret = UnPublishService(g_pkgName, testInfo.publishId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -332,6 +344,12 @@ HWTEST_F(DiscSdkAutoTest, PublishServiceTest005, TestSize.Level1) EXPECT_TRUE(ret == SOFTBUS_OK); ret = UnPublishService(g_pkgName, testInfo.publishId); EXPECT_TRUE(ret == SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = PublishService(g_pkgName, &testInfo, &g_publishCb); + EXPECT_TRUE(ret == SOFTBUS_OK); + ret = UnPublishService(g_pkgName, testInfo.publishId); + EXPECT_TRUE(ret == SOFTBUS_OK); } /** @@ -379,6 +397,12 @@ HWTEST_F(DiscSdkAutoTest, PublishServiceTest006, TestSize.Level1) EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); ret = UnPublishService(g_pkgName, testInfo.publishId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + testInfo.freq = EXTREME_HIGH; + ret = PublishService(g_pkgName, &testInfo, &g_publishCb); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + ret = UnPublishService(g_pkgName, testInfo.publishId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -540,6 +564,12 @@ HWTEST_F(DiscSdkAutoTest, StartDiscoveryTest001, TestSize.Level1) EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); ret = StopDiscovery(g_pkgName, testInfo.subscribeId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + testInfo.freq = EXTREME_HIGH; + ret = StartDiscovery(g_pkgName, &testInfo, &g_subscribeCb); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + ret = StopDiscovery(g_pkgName, testInfo.subscribeId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -620,6 +650,12 @@ HWTEST_F(DiscSdkAutoTest, StartDiscoveryTest003, TestSize.Level1) EXPECT_TRUE(ret == SOFTBUS_OK); ret = StopDiscovery(g_pkgName, testInfo.subscribeId); EXPECT_TRUE(ret == SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + ret = StartDiscovery(g_pkgName, &testInfo, &g_subscribeCb); + EXPECT_TRUE(ret == SOFTBUS_OK); + ret = StopDiscovery(g_pkgName, testInfo.subscribeId); + EXPECT_TRUE(ret == SOFTBUS_OK); } /** @@ -804,6 +840,11 @@ HWTEST_F(DiscSdkAutoTest, UnPublishServiceTest004, TestSize.Level1) PublishService(g_pkgName, &testInfo, &g_publishCb); ret = UnPublishService(g_pkgName, testInfo.publishId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + testInfo.freq = EXTREME_HIGH; + PublishService(g_pkgName, &testInfo, &g_publishCb); + ret = UnPublishService(g_pkgName, testInfo.publishId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -845,6 +886,11 @@ HWTEST_F(DiscSdkAutoTest, UnPublishServiceTest005, TestSize.Level1) PublishService(g_pkgName, &testInfo, &g_publishCb); ret = UnPublishService(g_pkgName, testInfo.publishId); EXPECT_TRUE(ret == SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + PublishService(g_pkgName, &testInfo, &g_publishCb); + ret = UnPublishService(g_pkgName, testInfo.publishId); + EXPECT_TRUE(ret == SOFTBUS_OK); } /** @@ -1027,6 +1073,11 @@ HWTEST_F(DiscSdkAutoTest, StopDiscoveryTest004, TestSize.Level1) StartDiscovery(g_pkgName, &testInfo, &g_subscribeCb); ret = StopDiscovery(g_pkgName, testInfo.subscribeId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + testInfo.freq = EXTREME_HIGH; + StartDiscovery(g_pkgName, &testInfo, &g_subscribeCb); + ret = StopDiscovery(g_pkgName, testInfo.subscribeId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -1069,6 +1120,11 @@ HWTEST_F(DiscSdkAutoTest, StopDiscoveryTest005, TestSize.Level1) StartDiscovery(g_pkgName, &testInfo, &g_subscribeCb); ret = StopDiscovery(g_pkgName, testInfo.subscribeId); EXPECT_TRUE(ret == SOFTBUS_OK); + + testInfo.freq = EXTREME_HIGH; + StartDiscovery(g_pkgName, &testInfo, &g_subscribeCb); + ret = StopDiscovery(g_pkgName, testInfo.subscribeId); + EXPECT_TRUE(ret == SOFTBUS_OK); } /** diff --git a/tests/sdk/discovery/unittest/disc_sdk_test.cpp b/tests/sdk/discovery/unittest/disc_sdk_test.cpp index f90e0a630..100fa490a 100644 --- a/tests/sdk/discovery/unittest/disc_sdk_test.cpp +++ b/tests/sdk/discovery/unittest/disc_sdk_test.cpp @@ -232,7 +232,7 @@ HWTEST_F(DiscSdkTest, PublishLNNTest003, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM); testInfo.medium = COAP; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = PublishLNN(g_pkgName, &testInfo, &g_publishCb); EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM); testInfo.freq = (ExchangeFreq)(LOW - 1); @@ -308,6 +308,12 @@ HWTEST_F(DiscSdkTest, PublishLNNTest005, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_OK); ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); EXPECT_EQ(ret, SOFTBUS_OK); + + g_publishInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &g_publishInfo, &g_publishCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -347,6 +353,12 @@ HWTEST_F(DiscSdkTest, PublishLNNTest006, TestSize.Level1) EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + g_publishInfo.freq = EXTREME_HIGH; + ret = PublishLNN(g_pkgName, &g_publishInfo, &g_publishCb); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -507,7 +519,7 @@ HWTEST_F(DiscSdkTest, RefreshLNNTest003, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM); testInfo.medium = COAP; - testInfo.freq = (ExchangeFreq)(SUPER_HIGH + 1); + testInfo.freq = (ExchangeFreq)(FREQ_BUTT); ret = RefreshLNN(g_pkgName, &testInfo, &g_refreshCb); EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM); testInfo.freq = (ExchangeFreq)(LOW - 1); @@ -583,6 +595,12 @@ HWTEST_F(DiscSdkTest, RefreshLNNTest005, TestSize.Level1) EXPECT_EQ(ret, SOFTBUS_OK); ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); EXPECT_EQ(ret, SOFTBUS_OK); + + g_subscribeInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &g_subscribeInfo, &g_refreshCb); + EXPECT_EQ(ret, SOFTBUS_OK); + ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -622,6 +640,12 @@ HWTEST_F(DiscSdkTest, RefreshLNNTest006, TestSize.Level1) EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + g_subscribeInfo.freq = EXTREME_HIGH; + ret = RefreshLNN(g_pkgName, &g_subscribeInfo, &g_refreshCb); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -794,6 +818,11 @@ HWTEST_F(DiscSdkTest, StopPublishLNNTest004, TestSize.Level1) PublishLNN(g_pkgName, &g_publishInfo, &g_publishCb); ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); EXPECT_EQ(ret, SOFTBUS_OK); + + g_publishInfo.freq = EXTREME_HIGH; + PublishLNN(g_pkgName, &g_publishInfo, &g_publishCb); + ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -829,6 +858,11 @@ HWTEST_F(DiscSdkTest, StopPublishLNNTest005, TestSize.Level1) PublishLNN(g_pkgName, &g_publishInfo, &g_publishCb); ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + g_publishInfo.freq = EXTREME_HIGH; + PublishLNN(g_pkgName, &g_publishInfo, &g_publishCb); + ret = StopPublishLNN(g_pkgName, g_publishInfo.publishId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /** @@ -917,6 +951,11 @@ HWTEST_F(DiscSdkTest, StopRefreshLNNTest004, TestSize.Level1) RefreshLNN(g_pkgName, &g_subscribeInfo, &g_refreshCb); ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); EXPECT_EQ(ret, SOFTBUS_OK); + + g_subscribeInfo.freq = EXTREME_HIGH; + RefreshLNN(g_pkgName, &g_subscribeInfo, &g_refreshCb); + ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); + EXPECT_EQ(ret, SOFTBUS_OK); } /** @@ -952,6 +991,11 @@ HWTEST_F(DiscSdkTest, StopRefreshLNNTest005, TestSize.Level1) RefreshLNN(g_pkgName, &g_subscribeInfo, &g_refreshCb); ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); + + g_subscribeInfo.freq = EXTREME_HIGH; + RefreshLNN(g_pkgName, &g_subscribeInfo, &g_refreshCb); + ret = StopRefreshLNN(g_pkgName, g_subscribeInfo.subscribeId); + EXPECT_EQ(isBtOn, (ret == SOFTBUS_OK)); } /**