Skip to content

Commit 035f5cc

Browse files
committed
removing the unused code
1 parent 3f6e0d3 commit 035f5cc

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <stdio.h>
2323
#include <stdlib.h>
2424
#include <string.h>
25-
#include "silabs_utils.h"
2625
#if (SL_MATTER_GN_BUILD == 0)
2726
#include "sl_matter_wifi_config.h"
2827
#endif // SL_MATTER_GN_BUILD
@@ -543,37 +542,25 @@ sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result)
543542
for (int idx = 0; idx < (int) scan_result->scan_count; idx++)
544543
{
545544
memset(&cur_scan_result, 0, sizeof(cur_scan_result));
546-
547-
// cur_scan_result.ssid_length = strnlen((char *) scan_result->scan_info[idx].ssid,
548-
// chip::min<size_t>(sizeof(scan_result->scan_info[idx].ssid) + 1, WFX_MAX_SSID_LENGTH));
549545
cur_scan_result.ssid_length = chip::min<size_t>(strnlen((char *) scan_result->scan_info[idx].ssid, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength) + 1, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); // +1 for null termination
550546
chip::Platform::CopyString(cur_scan_result.ssid, cur_scan_result.ssid_length, (char *) scan_result->scan_info[idx].ssid);
551-
552-
SILABS_LOG("ssid : %s", cur_scan_result.ssid);
553-
SILABS_LOG("scan ssid : %s", wfx_rsi.scan_ssid);
554547
// if user has provided ssid, then check if the current scan result ssid matches the user provided ssid
555548
if (wfx_rsi.scan_ssid != NULL &&
556549
(strncmp(wfx_rsi.scan_ssid, cur_scan_result.ssid, MIN(strlen(wfx_rsi.scan_ssid), strlen(cur_scan_result.ssid))) !=
557550
CMP_SUCCESS))
558551
{
559-
SILABS_LOG("%d",__LINE__);
560552
continue;
561553
}
562554
cur_scan_result.security = static_cast<wfx_sec_t>(scan_result->scan_info[idx].security_mode);
563555
cur_scan_result.rssi = (-1) * scan_result->scan_info[idx].rssi_val;
564556
memcpy(cur_scan_result.bssid, scan_result->scan_info[idx].bssid, BSSID_LEN);
565557
wfx_rsi.scan_cb(&cur_scan_result);
566-
SILABS_LOG("%d",__LINE__);
567558

568559
// if user has not provided the ssid, then call the callback for each scan result
569560
if (wfx_rsi.scan_ssid == NULL)
570561
{
571-
SILABS_LOG("%d",__LINE__);
572-
573562
continue;
574563
}
575-
SILABS_LOG("%d",__LINE__);
576-
577564
break;
578565
}
579566

examples/platform/silabs/efr32/rs911x/rsi_if.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ extern "C" {
5858
#include <lib/support/CHIPMemString.h>
5959
#include <lib/support/CodeUtils.h>
6060
#include <lib/support/logging/CHIPLogging.h>
61+
#include <platform/CHIPDeviceLayer.h>
6162

6263
#define WFX_QUEUE_SIZE 10
6364

@@ -755,9 +756,7 @@ void ProcessEvent(WfxEvent_t inEvent)
755756
scan = &scan_rsp.scan_info[x];
756757
// clear structure and calculate size of SSID
757758
memset(&ap, 0, sizeof(ap));
758-
// ap.ssid_length =
759-
// strnlen(reinterpret_cast<char *>(scan->ssid), chip::min<size_t>(sizeof(scan->ssid) + 1, WFX_MAX_SSID_LENGTH));
760-
ap.ssid_length = chip::min<size_t>(strnlen(ap.ssid) + 1, WFX_MAX_SSID_LENGTH); // +1 for null termination
759+
ap.ssid_length = chip::min<size_t>(strnlen(ap.ssid, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength) + 1, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); // +1 for null termination
761760
chip::Platform::CopyString(ap.ssid, ap.ssid_length, reinterpret_cast<char *>(scan->ssid));
762761

763762
// check if the scanned ssid is the one we are looking for

examples/platform/silabs/efr32/wf200/host_if.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *))
11851185
VerifyOrReturnError(scan_cb != nullptr, false);
11861186
if (ssid)
11871187
{
1188-
scan_ssid_length = chip::min<size_t>(strnlen(ssid) + 1, WFX_MAX_SSID_LENGTH); // +1 for null termination
1188+
scan_ssid_length = chip::min<size_t>(strnlen(ssid, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength) + 1, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); // +1 for null termination
11891189
scan_ssid = reinterpret_cast<char *>(chip::Platform::MemoryAlloc(scan_ssid_length));
11901190
VerifyOrReturnError(scan_ssid != nullptr, false);
11911191
Platform::CopyString(scan_ssid, scan_ssid_length, ssid);

examples/platform/silabs/wifi/wfx_rsi_host.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -361,20 +361,17 @@ int32_t wfx_reset_counts(void)
361361
* @return returns ture if successful,
362362
* false otherwise
363363
*******************************************************************************/
364-
#include "silabs_utils.h"
365364
bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *))
366365
{
367366
// check if already in progress
368367
VerifyOrReturnError(wfx_rsi.scan_cb == nullptr, false);
369368
wfx_rsi.scan_cb = callback;
370369
// if SSID is provided to scan only that SSID
371370
if(ssid) {
372-
// wfx_rsi.scan_ssid_length = strnlen(ssid, chip::min<size_t>((strlen(ssid) + 1), WFX_MA X_SSID_LENGTH));
373-
wfx_rsi.scan_ssid_length = chip::min<size_t>(strnlen(ssid, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength) + 1, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength);
371+
wfx_rsi.scan_ssid_length = chip::min<size_t>(strnlen(ssid, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength) + 1, chip::DeviceLayer::Internal::kMaxWiFiSSIDLength); // +1 for null termination
374372
wfx_rsi.scan_ssid = reinterpret_cast<char *>(chip::Platform::MemoryAlloc(wfx_rsi.scan_ssid_length));
375373
VerifyOrReturnError(wfx_rsi.scan_ssid != nullptr, false);
376374
chip::Platform::CopyString(wfx_rsi.scan_ssid, wfx_rsi.scan_ssid_length, ssid);
377-
SILABS_LOG("%s hhhh %s %d %d", wfx_rsi.scan_ssid, ssid, wfx_rsi.scan_ssid_length, strlen(ssid));
378375
}
379376
WfxEvent_t event;
380377
event.eventType = WFX_EVT_SCAN;

0 commit comments

Comments
 (0)