Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ All notable changes to this RDK Service will be documented in this file.

* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

## [1.8.0] - 2025-11-14
### Fixed
- Removed logging of WiFi PII information

## [1.7.0] - 2025-11-13
### Fixed
- Fixed bug MfrMgr Integration
- Subscribed to WiFi Events even when the device boots with wifi disabled
- Fixed the WiFi signal monitoring as the reporred RSSI was stale data

## [1.6.0] - 2025-10-31
### Added
- Integrated MfrMgr to persist WiFi Credential for DRI & Rollback to RDK-V Backend
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_package(WPEFramework)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(VERSION_MAJOR 1)
set(VERSION_MINOR 6)
set(VERSION_MINOR 8)
set(VERSION_PATCH 0)

add_compile_definitions(NETWORKMANAGER_MAJOR_VERSION=${VERSION_MAJOR})
Expand Down
2 changes: 1 addition & 1 deletion definition/NetworkManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"status": "production",
"description": "A Unified `NetworkManager` plugin that allows you to manage Ethernet and Wifi interfaces on the device.",
"sourcelocation": "https://github.com/rdkcentral/networkmanager/blob/main/definition/NetworkManager.json",
"version": "1.6.0"
"version": "1.8.0"
},
"definitions": {
"success": {
Expand Down
4 changes: 2 additions & 2 deletions docs/NetworkManagerPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a name="head.NetworkManager_Plugin"></a>
# NetworkManager Plugin

**Version: 1.6.0**
**Version: 1.8.0**

**Status: :black_circle::black_circle::black_circle:**

Expand All @@ -23,7 +23,7 @@ org.rdk.NetworkManager interface for Thunder framework.
<a name="head.Scope"></a>
## Scope

This document describes purpose and functionality of the org.rdk.NetworkManager interface (version 1.6.0). It includes detailed specification about its methods provided and notifications sent.
This document describes purpose and functionality of the org.rdk.NetworkManager interface (version 1.8.0). It includes detailed specification about its methods provided and notifications sent.

<a name="head.Case_Sensitivity"></a>
## Case Sensitivity
Expand Down
126 changes: 80 additions & 46 deletions plugin/NetworkManagerImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace NetworkManagerLogger;

#define CIDR_NETMASK_IP_LEN 32
#define SSID_COMMAND "wpa_cli status"
#define BSS_COMMAND "wpa_cli bss"
#define SIGNAL_POLL_COMMAND "wpa_cli signal_poll"

namespace WPEFramework
{
Expand Down Expand Up @@ -841,116 +841,152 @@ namespace WPEFramework
/* The below implementation of GetWiFiSignalQuality is a temporary mitigation. Need to be revisited */
uint32_t NetworkManagerImplementation::GetWiFiSignalQuality(string& ssid /* @out */, string& strength /* @out */, string& noise /* @out */, string& snr /* @out */, WiFiSignalQuality& quality /* @out */)
{
uint32_t rc = Core::ERROR_RPC_CALL_FAILED;
int16_t readSnr = 0;

std::string key, value;
int16_t readNoise = 0;
string bssid{};
std::string key{}, value{}, bssid{}, band{};
char buff[512] = {'\0'};

FILE *fp = NULL;

/* SSID */
/* Get BSSID and SSID from wpa_cli status */
fp = popen(SSID_COMMAND, "r");
if (!fp)
{
NMLOG_ERROR("Failed in getting output from command %s",SSID_COMMAND);
return Core::ERROR_RPC_CALL_FAILED;
NMLOG_ERROR("Failed in getting output from command %s", SSID_COMMAND);
return Core::ERROR_GENERAL;
}
while ((!feof(fp)) && (fgets(buff, sizeof (buff), fp) != NULL)) {

while ((!feof(fp)) && (fgets(buff, sizeof (buff), fp) != NULL))
{
std::istringstream mystream(buff);
if(std::getline(std::getline(mystream, key, '=') >> std::ws, value))
{
if (key == "bssid") {
if (key == "ssid") {
ssid = value;
}
else if (key == "bssid") {
bssid = value;
break;
}
if (!ssid.empty() && !bssid.empty())
break;
}
}
pclose(fp);

/* Noise n RSSI */
std::string bssCommand = std::string(BSS_COMMAND) + " " + bssid;
fp = popen(bssCommand.c_str(), "r");
/* If BSSID is empty, WiFi is disconnected */
if (bssid.empty()) {
NMLOG_WARNING("WiFi is disconnected (BSSID is empty)");
quality = WiFiSignalQuality::WIFI_SIGNAL_DISCONNECTED;
ssid = "";
strength = "0";
noise = "0";
snr = "0";
return Core::ERROR_NONE;
}

/*Get real-time signal data from wpa_cli signal_poll */
fp = popen(SIGNAL_POLL_COMMAND, "r");
if (!fp)
{
NMLOG_ERROR("Failed in getting output from command %s",BSS_COMMAND);
return Core::ERROR_RPC_CALL_FAILED;
NMLOG_ERROR("Failed in getting output from command %s", SIGNAL_POLL_COMMAND);
return Core::ERROR_GENERAL;
}

while ((!feof(fp)) && (fgets(buff, sizeof (buff), fp) != NULL))
{
std::istringstream mystream(buff);
if(std::getline(std::getline(mystream, key, '=') >> std::ws, value))
{
if (key == "level") {
if (key == "RSSI") {
strength = value;
}
else if (key == "noise") {
else if (key == "NOISE") {
noise = value;
}
else if (key == "ssid") {
ssid = value;
else if (key == "AVG_RSSI") { // if RSSI is not available
if (strength.empty())
strength = value;
}
else if (key == "snr") {
snr = value;
else if (key == "FREQUENCY")
{
if (!value.empty())
{
int freq = std::stoi(value);
if (freq >= 2400 && freq < 5000)
band = "2.4GHz";
else if (freq >= 5000 && freq < 6000)
band = "5GHz";
else if (freq >= 6000)
band = "6GHz";
else
band = "not known";
}
}
if (!strength.empty() && !noise.empty() && !ssid.empty() && !snr.empty())
break;
}
}
pclose(fp);

/* NOTE: The std::stoi() will throw exception if the string input is empty; so set to 0 */
if (noise.empty())
noise= "0";
if (snr.empty())
snr = "0";
noise = "0";
if (strength.empty())
strength = "0";

readNoise = std::stoi(noise);
readSnr = std::stoi(snr);
int16_t readRssi = std::stoi(strength);
int16_t readNoise = std::stoi(noise);

/* Check the RSSI is within range between -10 and -100 dbm*/
if (readRssi >= 0 || readRssi < -100) {
NMLOG_WARNING("Received RSSI (%d dBm) is out of valid range (-10 to -100 dBm); Resetting to default", readRssi);
if (readRssi >= 0) {
readRssi = -10;
}
else if (readRssi < -100) {
readRssi = -100;
}
}

/* Check the Noise is within range between 0 and -96 dbm*/
if((readNoise >= 0) || (readNoise < DEFAULT_NOISE))
{
NMLOG_DEBUG("Received Noise (%d) from wifi driver is not valid; so clamping it", readNoise);
if (readNoise >= 0) {
readNoise = 0;
noise = std::to_string(0);
}
else if (readNoise < DEFAULT_NOISE) {
readNoise = DEFAULT_NOISE;
noise = std::to_string(DEFAULT_NOISE);
}
}

/*Calculate SNR = RSSI - Noise */
int16_t calculatedSnr = readRssi - readNoise;
snr = std::to_string(calculatedSnr);

/* mapping rssi value when the SNR value is not proper */
if(!(readSnr > 0 && readSnr <= MAX_SNR_VALUE))
if(!(calculatedSnr > 0 && calculatedSnr <= MAX_SNR_VALUE))
{
NMLOG_WARNING("Received SNR (%d) from wifi driver is not valid; Lets map with RSSI (%s)", readSnr, strength.c_str());
readSnr = std::stoi(strength);
NMLOG_WARNING("calculated SNR (%d) is not valid; Lets map with RSSI (%s)", calculatedSnr, strength.c_str());
calculatedSnr = std::stoi(strength);
/* Take the absolute value */
readSnr = (readSnr < 0) ? -readSnr : readSnr;
calculatedSnr = (calculatedSnr < 0) ? -calculatedSnr : calculatedSnr;

snr = std::to_string(readSnr);
snr = std::to_string(calculatedSnr);
}

NMLOG_INFO("RSSI: %s dBm; Noise: %s dBm; SNR: %s dBm", strength.c_str(), noise.c_str(), snr.c_str());
NMLOG_INFO("ssid=%s, bssid=%s, band=%s, rssi=%s, noise=%s, snr=%s", ssid.c_str(), bssid.c_str(), band.c_str(), strength.c_str(), noise.c_str(), snr.c_str());

if (readSnr == 0)
if (calculatedSnr == 0)
{
quality = WiFiSignalQuality::WIFI_SIGNAL_DISCONNECTED;
strength = "0";
}
else if (readSnr > 0 && readSnr < NM_WIFI_SNR_THRESHOLD_FAIR)
else if (calculatedSnr > 0 && calculatedSnr < NM_WIFI_SNR_THRESHOLD_FAIR)
{
quality = WiFiSignalQuality::WIFI_SIGNAL_WEAK;
}
else if (readSnr > NM_WIFI_SNR_THRESHOLD_FAIR && readSnr < NM_WIFI_SNR_THRESHOLD_GOOD)
else if (calculatedSnr >= NM_WIFI_SNR_THRESHOLD_FAIR && calculatedSnr < NM_WIFI_SNR_THRESHOLD_GOOD)
{
quality = WiFiSignalQuality::WIFI_SIGNAL_FAIR;
}
else if (readSnr > NM_WIFI_SNR_THRESHOLD_GOOD && readSnr < NM_WIFI_SNR_THRESHOLD_EXCELLENT)
else if (calculatedSnr >= NM_WIFI_SNR_THRESHOLD_GOOD && calculatedSnr < NM_WIFI_SNR_THRESHOLD_EXCELLENT)
{
quality = WiFiSignalQuality::WIFI_SIGNAL_GOOD;
}
Expand All @@ -959,9 +995,7 @@ namespace WPEFramework
quality = WiFiSignalQuality::WIFI_SIGNAL_EXCELLENT;
}

rc = Core::ERROR_NONE;

return rc;
return Core::ERROR_NONE;
}

void NetworkManagerImplementation::processMonitor(uint16_t interval)
Expand Down
2 changes: 1 addition & 1 deletion plugin/gnome/NetworkManagerGnomeMfrMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ namespace WPEFramework
setParam.wifiCredentials.iSecurityMode = securityMode;

setParam.requestType = WIFI_SET_CREDENTIALS;
NMLOG_INFO(" Set Params param.requestType = %d, param.wifiCredentials.cSSID = %s, param.wifiCredentials.cPassword = %s, param.wifiCredentials.iSecurityMode = %d", setParam.requestType, setParam.wifiCredentials.cSSID, setParam.wifiCredentials.cPassword, setParam.wifiCredentials.iSecurityMode);
NMLOG_INFO(" Set Params param.requestType = %d, param.wifiCredentials.cSSID = %s, param.wifiCredentials.iSecurityMode = %d", setParam.requestType, setParam.wifiCredentials.cSSID, setParam.wifiCredentials.iSecurityMode);
// Make IARM Bus call to save credentials
ret = IARM_Bus_Call(IARM_BUS_MFRLIB_NAME, IARM_BUS_MFRLIB_API_WIFI_Credentials,
(void*)&setParam, sizeof(setParam));
Expand Down
14 changes: 7 additions & 7 deletions plugin/gnome/NetworkManagerGnomeWIFI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,6 @@ namespace WPEFramework
NMLOG_WARNING("no active access point!; wifi device state: (%d)", deviceState);

deleteClientConnection();
#ifdef ENABLE_MIGRATION_MFRMGR_SUPPORT
NetworkManagerMfrManager* mfrManager = NetworkManagerMfrManager::getInstance();
if (mfrManager != nullptr)
{
mfrManager->clearWiFiSettingsFromMfr();
}
#endif
return true;
}

Expand Down Expand Up @@ -1185,6 +1178,13 @@ namespace WPEFramework
}

deleteClientConnection();
#ifdef ENABLE_MIGRATION_MFRMGR_SUPPORT
NetworkManagerMfrManager* mfrManager = NetworkManagerMfrManager::getInstance();
if (mfrManager != nullptr)
{
mfrManager->clearWiFiSettingsFromMfr();
}
#endif
// ssid is specified and connection is not found return false
// all other case return true, even if no wificonnection is found
return((ssidSpecified && !connectionFound)? false : true);
Expand Down
Loading
Loading