Skip to content

Commit 4fcbb0e

Browse files
committed
Allocate memory for the bssid to WiFiMgr
Signed-off-by: hyunuk.tak <[email protected]>
1 parent 0c2a8ae commit 4fcbb0e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/platform/Tizen/ConnectivityManagerImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ bool ConnectivityManagerImpl::IsWiFiManagementStarted()
255255

256256
CHIP_ERROR ConnectivityManagerImpl::GetWiFiBssId(ByteSpan & value)
257257
{
258-
uint8_t bssId[kMaxHardwareAddrSize];
258+
uint8_t * bssId = nullptr;
259259
CHIP_ERROR err = Internal::WiFiMgr().GetBssId(bssId);
260260
ReturnErrorOnFailure(err);
261261

src/platform/Tizen/WiFiManager.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -904,12 +904,13 @@ CHIP_ERROR WiFiManager::GetBssId(uint8_t * bssId)
904904
return CHIP_ERROR_READ_FAILED;
905905
}
906906

907-
if (sscanf(bssIdStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &bssId[0], &bssId[1], &bssId[2], &bssId[3], &bssId[4], &bssId[5]) != 6)
907+
if (sscanf(bssIdStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mWiFiBSSID[0], &mWiFiBSSID[1], &mWiFiBSSID[2], &mWiFiBSSID[3], &mWiFiBSSID[4], &mWiFiBSSID[5]) != 6)
908908
{
909909
ChipLogError(DeviceLayer, "FAIL: parse bssid");
910910
return CHIP_ERROR_READ_FAILED;
911911
}
912912

913+
bssId = mWiFiBSSID;
913914
return CHIP_NO_ERROR;
914915
}
915916

src/platform/Tizen/WiFiManager.h

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class WiFiManager
9696
wifi_manager_module_state_e mModuleState;
9797
wifi_manager_connection_state_e mConnectionState;
9898

99+
uint8_t mWiFiBSSID[kWiFiBSSIDLength];
99100
char mWiFiSSID[kMaxWiFiSSIDLength + 1];
100101
char mWiFiKey[kMaxWiFiKeyLength + 1];
101102

0 commit comments

Comments
 (0)