Skip to content

Commit 3843407

Browse files
gjc13pull[bot]
authored andcommitted
[platform] remove legacy functions in ConnectivityManager (#9946)
* Remove unused function `HaveIPv4InternetConnectivity` and `HaveIPv6InternetConnectivity`. * Service connectivity is legacy concept and not well defined. Remove `HaveServiceConnectivity`
1 parent 87d3474 commit 3843407

37 files changed

+91
-496
lines changed

examples/lighting-app/efr32/src/AppTask.cpp

+7-15
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ QueueHandle_t sAppEventQueue;
7171
LEDWidget sStatusLED;
7272
LEDWidget sLightLED;
7373

74-
bool sIsThreadProvisioned = false;
75-
bool sIsThreadEnabled = false;
76-
bool sHaveBLEConnections = false;
77-
bool sHaveServiceConnectivity = false;
74+
bool sIsThreadProvisioned = false;
75+
bool sIsThreadEnabled = false;
76+
bool sHaveBLEConnections = false;
7877

7978
uint8_t sAppEventQueueBuffer[APP_EVENT_QUEUE_SIZE * sizeof(AppEvent)];
8079
StaticQueue_t sAppEventQueueStruct;
@@ -193,10 +192,9 @@ void AppTask::AppTaskMain(void * pvParameter)
193192
// when the CHIP task is busy (e.g. with a long crypto operation).
194193
if (PlatformMgr().TryLockChipStack())
195194
{
196-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
197-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
198-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
199-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
195+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
196+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
197+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
200198
PlatformMgr().UnlockChipStack();
201199
}
202200

@@ -214,13 +212,7 @@ void AppTask::AppTaskMain(void * pvParameter)
214212
// Otherwise, blink the LED ON for a very short time.
215213
if (sAppTask.mFunction != kFunction_FactoryReset)
216214
{
217-
// Consider the system to be "fully connected" if it has service
218-
// connectivity
219-
if (sHaveServiceConnectivity)
220-
{
221-
sStatusLED.Set(true);
222-
}
223-
else if (sIsThreadProvisioned && sIsThreadEnabled)
215+
if (sIsThreadProvisioned && sIsThreadEnabled)
224216
{
225217
sStatusLED.Blink(950, 50);
226218
}

examples/lighting-app/k32w/main/AppTask.cpp

+7-13
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ static QueueHandle_t sAppEventQueue;
5252
static LEDWidget sStatusLED;
5353
static LEDWidget sLightLED;
5454

55-
static bool sIsThreadProvisioned = false;
56-
static bool sIsThreadEnabled = false;
57-
static bool sHaveBLEConnections = false;
58-
static bool sHaveServiceConnectivity = false;
55+
static bool sIsThreadProvisioned = false;
56+
static bool sIsThreadEnabled = false;
57+
static bool sHaveBLEConnections = false;
5958

6059
static uint32_t eventMask = 0;
6160

@@ -182,10 +181,9 @@ void AppTask::AppTaskMain(void * pvParameter)
182181
#if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI
183182
K32WUartProcess();
184183
#endif
185-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
186-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
187-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
188-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
184+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
185+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
186+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
189187
PlatformMgr().UnlockChipStack();
190188
}
191189

@@ -203,11 +201,7 @@ void AppTask::AppTaskMain(void * pvParameter)
203201
// Otherwise, blink the LED ON for a very short time.
204202
if (sAppTask.mFunction != kFunction_FactoryReset)
205203
{
206-
if (sHaveServiceConnectivity)
207-
{
208-
sStatusLED.Set(true);
209-
}
210-
else if (sIsThreadProvisioned && sIsThreadEnabled)
204+
if (sIsThreadProvisioned && sIsThreadEnabled)
211205
{
212206
sStatusLED.Blink(950, 50);
213207
}

examples/lighting-app/nrfconnect/main/AppTask.cpp

+7-13
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ LEDWidget sStatusLED;
6161
LEDWidget sUnusedLED;
6262
LEDWidget sUnusedLED_1;
6363

64-
bool sIsThreadProvisioned = false;
65-
bool sIsThreadEnabled = false;
66-
bool sHaveBLEConnections = false;
67-
bool sHaveServiceConnectivity = false;
64+
bool sIsThreadProvisioned = false;
65+
bool sIsThreadEnabled = false;
66+
bool sHaveBLEConnections = false;
6867

6968
} // namespace
7069

@@ -150,10 +149,9 @@ int AppTask::StartApp()
150149

151150
if (PlatformMgr().TryLockChipStack())
152151
{
153-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
154-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
155-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
156-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
152+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
153+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
154+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
157155
PlatformMgr().UnlockChipStack();
158156
}
159157

@@ -171,11 +169,7 @@ int AppTask::StartApp()
171169
// Otherwise, blink the LED ON for a very short time.
172170
if (sAppTask.mFunction != kFunction_FactoryReset)
173171
{
174-
if (sHaveServiceConnectivity)
175-
{
176-
sStatusLED.Set(true);
177-
}
178-
else if (sIsThreadProvisioned && sIsThreadEnabled)
172+
if (sIsThreadProvisioned && sIsThreadEnabled)
179173
{
180174
sStatusLED.Blink(950, 50);
181175
}

examples/lighting-app/qpg/src/AppTask.cpp

+7-15
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ using namespace chip::DeviceLayer;
5757
static TaskHandle_t sAppTaskHandle;
5858
static QueueHandle_t sAppEventQueue;
5959

60-
static bool sIsThreadProvisioned = false;
61-
static bool sIsThreadEnabled = false;
62-
static bool sHaveBLEConnections = false;
63-
static bool sHaveServiceConnectivity = false;
60+
static bool sIsThreadProvisioned = false;
61+
static bool sIsThreadEnabled = false;
62+
static bool sHaveBLEConnections = false;
6463

6564
AppTask AppTask::sAppTask;
6665

@@ -146,10 +145,9 @@ void AppTask::AppTaskMain(void * pvParameter)
146145
// when the CHIP task is busy (e.g. with a long crypto operation).
147146
if (PlatformMgr().TryLockChipStack())
148147
{
149-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
150-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
151-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
152-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
148+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
149+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
150+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
153151
PlatformMgr().UnlockChipStack();
154152
}
155153

@@ -167,13 +165,7 @@ void AppTask::AppTaskMain(void * pvParameter)
167165
// Otherwise, blink the LED ON for a very short time.
168166
if (sAppTask.mFunction != kFunction_FactoryReset)
169167
{
170-
// Consider the system to be "fully connected" if it has service
171-
// connectivity
172-
if (sHaveServiceConnectivity)
173-
{
174-
qvCHIP_LedSet(SYSTEM_STATE_LED, true);
175-
}
176-
else if (sIsThreadProvisioned && sIsThreadEnabled)
168+
if (sIsThreadProvisioned && sIsThreadEnabled)
177169
{
178170
qvCHIP_LedBlink(SYSTEM_STATE_LED, 950, 50);
179171
}

examples/lighting-app/telink/src/AppTask.cpp

+9-15
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ Button sFactoryResetButton;
6464
Button sLightingButton;
6565
Button sThreadStartButton;
6666

67-
bool sIsThreadProvisioned = false;
68-
bool sIsThreadEnabled = false;
69-
bool sIsThreadAttached = false;
70-
bool sHaveBLEConnections = false;
71-
bool sHaveServiceConnectivity = false;
67+
bool sIsThreadProvisioned = false;
68+
bool sIsThreadEnabled = false;
69+
bool sIsThreadAttached = false;
70+
bool sHaveBLEConnections = false;
7271

7372
} // namespace
7473

@@ -146,19 +145,14 @@ CHIP_ERROR AppTask::StartApp()
146145

147146
if (PlatformMgr().TryLockChipStack())
148147
{
149-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
150-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
151-
sIsThreadAttached = ConnectivityMgr().IsThreadAttached();
152-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
153-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
148+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
149+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
150+
sIsThreadAttached = ConnectivityMgr().IsThreadAttached();
151+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
154152
PlatformMgr().UnlockChipStack();
155153
}
156154

157-
if (sHaveServiceConnectivity)
158-
{
159-
sStatusLED.Set(true);
160-
}
161-
else if (sIsThreadProvisioned && sIsThreadEnabled)
155+
if (sIsThreadProvisioned && sIsThreadEnabled)
162156
{
163157
if (sIsThreadAttached)
164158
{

examples/lock-app/efr32/src/AppTask.cpp

+7-15
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ QueueHandle_t sAppEventQueue;
6868
LEDWidget sStatusLED;
6969
LEDWidget sLockLED;
7070

71-
bool sIsThreadProvisioned = false;
72-
bool sIsThreadEnabled = false;
73-
bool sHaveBLEConnections = false;
74-
bool sHaveServiceConnectivity = false;
71+
bool sIsThreadProvisioned = false;
72+
bool sIsThreadEnabled = false;
73+
bool sHaveBLEConnections = false;
7574

7675
StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)];
7776
StaticTask_t appTaskStruct;
@@ -186,10 +185,9 @@ void AppTask::AppTaskMain(void * pvParameter)
186185
// when the CHIP task is busy (e.g. with a long crypto operation).
187186
if (PlatformMgr().TryLockChipStack())
188187
{
189-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
190-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
191-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
192-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
188+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
189+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
190+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
193191
PlatformMgr().UnlockChipStack();
194192
}
195193

@@ -207,13 +205,7 @@ void AppTask::AppTaskMain(void * pvParameter)
207205
// Otherwise, blink the LED ON for a very short time.
208206
if (sAppTask.mFunction != kFunction_FactoryReset)
209207
{
210-
// Consider the system to be "fully connected" if it has service
211-
// connectivity
212-
if (sHaveServiceConnectivity)
213-
{
214-
sStatusLED.Set(true);
215-
}
216-
else if (sIsThreadProvisioned && sIsThreadEnabled)
208+
if (sIsThreadProvisioned && sIsThreadEnabled)
217209
{
218210
sStatusLED.Blink(950, 50);
219211
}

examples/lock-app/esp32/main/AppTask.cpp

+3-11
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ Button lockButton;
5353
BaseType_t sAppTaskHandle;
5454
QueueHandle_t sAppEventQueue;
5555

56-
bool sHaveBLEConnections = false;
57-
bool sHaveServiceConnectivity = false;
56+
bool sHaveBLEConnections = false;
5857

5958
StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)];
6059
} // namespace
@@ -140,8 +139,7 @@ void AppTask::AppTaskMain(void * pvParameter)
140139
// when the CHIP task is busy (e.g. with a long crypto operation).
141140
if (PlatformMgr().TryLockChipStack())
142141
{
143-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
144-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
142+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
145143
PlatformMgr().UnlockChipStack();
146144
}
147145

@@ -158,13 +156,7 @@ void AppTask::AppTaskMain(void * pvParameter)
158156
// Otherwise, blink the LED ON for a very short time.
159157
if (sAppTask.mFunction != kFunction_FactoryReset)
160158
{
161-
// Consider the system to be "fully connected" if it has service
162-
// connectivity
163-
if (sHaveServiceConnectivity)
164-
{
165-
sStatusLED.Set(true);
166-
}
167-
else if (sHaveBLEConnections)
159+
if (sHaveBLEConnections)
168160
{
169161
sStatusLED.Blink(100, 100);
170162
}

examples/lock-app/k32w/main/AppTask.cpp

+7-13
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ static LEDWidget sStatusLED;
5252
static LEDWidget sLockLED;
5353
#endif
5454

55-
static bool sIsThreadProvisioned = false;
56-
static bool sIsThreadEnabled = false;
57-
static bool sHaveBLEConnections = false;
58-
static bool sHaveServiceConnectivity = false;
55+
static bool sIsThreadProvisioned = false;
56+
static bool sIsThreadEnabled = false;
57+
static bool sHaveBLEConnections = false;
5958

6059
static uint32_t eventMask = 0;
6160

@@ -195,10 +194,9 @@ void AppTask::AppTaskMain(void * pvParameter)
195194
K32WUartProcess();
196195
#endif
197196

198-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
199-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
200-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
201-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
197+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
198+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
199+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
202200
PlatformMgr().UnlockChipStack();
203201
}
204202

@@ -218,11 +216,7 @@ void AppTask::AppTaskMain(void * pvParameter)
218216
#if !cPWR_UsePowerDownMode
219217
if (sAppTask.mFunction != kFunction_FactoryReset)
220218
{
221-
if (sHaveServiceConnectivity)
222-
{
223-
sStatusLED.Set(true);
224-
}
225-
else if (sIsThreadProvisioned && sIsThreadEnabled)
219+
if (sIsThreadProvisioned && sIsThreadEnabled)
226220
{
227221
sStatusLED.Blink(950, 50);
228222
}

examples/lock-app/nrfconnect/main/AppTask.cpp

+7-13
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ static LEDWidget sLockLED;
5252
static LEDWidget sUnusedLED;
5353
static LEDWidget sUnusedLED_1;
5454

55-
static bool sIsThreadProvisioned = false;
56-
static bool sIsThreadEnabled = false;
57-
static bool sHaveBLEConnections = false;
58-
static bool sHaveServiceConnectivity = false;
55+
static bool sIsThreadProvisioned = false;
56+
static bool sIsThreadEnabled = false;
57+
static bool sHaveBLEConnections = false;
5958

6059
static k_timer sFunctionTimer;
6160

@@ -140,10 +139,9 @@ int AppTask::StartApp()
140139

141140
if (PlatformMgr().TryLockChipStack())
142141
{
143-
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
144-
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
145-
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
146-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
142+
sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned();
143+
sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled();
144+
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
147145
PlatformMgr().UnlockChipStack();
148146
}
149147

@@ -161,11 +159,7 @@ int AppTask::StartApp()
161159
// Otherwise, blink the LED ON for a very short time.
162160
if (sAppTask.mFunction != kFunction_FactoryReset)
163161
{
164-
if (sHaveServiceConnectivity)
165-
{
166-
sStatusLED.Set(true);
167-
}
168-
else if (sIsThreadProvisioned && sIsThreadEnabled)
162+
if (sIsThreadProvisioned && sIsThreadEnabled)
169163
{
170164
sStatusLED.Blink(950, 50);
171165
}

examples/lock-app/p6/src/AppTask.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ bool sIsWiFiStationProvisioned = false;
5757
bool sIsWiFiStationEnabled = false;
5858
bool sIsWiFiStationConnected = false;
5959
bool sHaveBLEConnections = false;
60-
bool sHaveServiceConnectivity = false;
6160

6261
StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)];
6362
StaticTask_t appTaskStruct;
@@ -179,7 +178,6 @@ void AppTask::AppTaskMain(void * pvParameter)
179178
sIsWiFiStationConnected = ConnectivityMgr().IsWiFiStationConnected();
180179
sIsWiFiStationProvisioned = ConnectivityMgr().IsWiFiStationProvisioned();
181180
sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0);
182-
sHaveServiceConnectivity = ConnectivityMgr().HaveServiceConnectivity();
183181
PlatformMgr().UnlockChipStack();
184182
}
185183

@@ -197,13 +195,7 @@ void AppTask::AppTaskMain(void * pvParameter)
197195
// Otherwise, blink the LED ON for a very short time.
198196
if (sAppTask.mFunction != Function::kFactoryReset)
199197
{
200-
// Consider the system to be "fully connected" if it has service
201-
// connectivity
202-
if (sHaveServiceConnectivity)
203-
{
204-
sStatusLED.Set(true);
205-
}
206-
else if (sIsWiFiStationEnabled && sIsWiFiStationProvisioned && (!sIsWiFiStationConnected || !sHaveServiceConnectivity))
198+
if (sIsWiFiStationEnabled && sIsWiFiStationProvisioned && !sIsWiFiStationConnected)
207199
{
208200
sStatusLED.Blink(950, 50);
209201
}

0 commit comments

Comments
 (0)