Skip to content

Commit

Permalink
SERXIONE-5867: Rogers - Event Logs added
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuhammedrafi committed Aug 26, 2024
1 parent 6459012 commit 6d3347d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion NetworkManager/LegacyPlugin_NetworkAPIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {
}
else if((state == "INTERFACE_LINK_UP") || (state == "INTERFACE_LINK_DOWN"))
{
NMLOG_INFO("Posting onConnectionStatusChanged");
Notify("onConnectionStatusChanged", legacyParams);
}

Expand All @@ -879,6 +880,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {
legacyParams["newInterfaceName"] = getInterfaceMapping(parameters["newInterfaceName"].String());

m_defaultInterface = parameters["newInterfaceName"].String();
NMLOG_INFO("Posting onDefaultInterfaceChanged");
Notify("onDefaultInterfaceChanged", legacyParams);
return;
}
Expand All @@ -901,7 +903,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {
}

legacyParams["status"] = parameters["status"];

NMLOG_INFO("Posting onIPAddressStatusChanged");
Notify("onIPAddressStatusChanged", legacyParams);

if ("ACQUIRED" == parameters["status"].String())
Expand All @@ -912,6 +914,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {

void Network::ReportonInternetStatusChange(const JsonObject& parameters)
{
NMLOG_INFO("Posting onInternetStatusChange");
Notify("onInternetStatusChange", parameters);
return;
}
Expand Down
3 changes: 2 additions & 1 deletion NetworkManager/LegacyPlugin_WiFiManagerAPIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ namespace WPEFramework
else
{
NMLOG_INFO("onWiFiStateChange with state as: %u", state);
NMLOG_INFO("Posting onWIFIStateChanged");
_gWiFiInstance->Notify("onWIFIStateChanged", legacyResult);
}
}
Expand All @@ -611,7 +612,7 @@ namespace WPEFramework
JsonObject legacyParams;
legacyParams["signalStrength"] = parameters["signalQuality"];
legacyParams["strength"] = parameters["signalLevel"];

NMLOG_INFO("Posting onWifiSignalThresholdChanged");
if (_gWiFiInstance)
_gWiFiInstance->Notify("onWifiSignalThresholdChanged", legacyParams);

Expand Down
8 changes: 7 additions & 1 deletion NetworkManager/NetworkManagerImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ namespace WPEFramework
void NetworkManagerImplementation::ReportInterfaceStateChangedEvent(INetworkManager::InterfaceState state, string interface)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting onInterfaceStateChange %s", interface.c_str());
_notificationLock.Lock();
for (const auto callback : _notificationCallbacks) {
callback->onInterfaceStateChange(state, interface);
Expand All @@ -498,6 +499,7 @@ namespace WPEFramework
void NetworkManagerImplementation::ReportIPAddressChangedEvent(const string& interface, bool isAcquired, bool isIPv6, const string& ipAddress)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting onIPAddressChange %s", ipAddress.c_str());
_notificationLock.Lock();
for (const auto callback : _notificationCallbacks) {
callback->onIPAddressChange(interface, isAcquired, isIPv6, ipAddress);
Expand All @@ -508,6 +510,7 @@ namespace WPEFramework
void NetworkManagerImplementation::ReportActiveInterfaceChangedEvent(const string prevActiveInterface, const string currentActiveinterface)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting onActiveInterfaceChange %s", currentActiveinterface.c_str());
_notificationLock.Lock();
for (const auto callback : _notificationCallbacks) {
callback->onActiveInterfaceChange(prevActiveInterface, currentActiveinterface);
Expand All @@ -518,6 +521,7 @@ namespace WPEFramework
void NetworkManagerImplementation::ReportInternetStatusChangedEvent(const InternetStatus oldState, const InternetStatus newstate)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting onInternetStatusChange");
_notificationLock.Lock();
for (const auto callback : _notificationCallbacks) {
callback->onInternetStatusChange(oldState, newstate);
Expand All @@ -529,7 +533,7 @@ namespace WPEFramework
{
LOG_ENTRY_FUNCTION();
_notificationLock.Lock();
NMLOG_INFO("scan result is, %s", jsonOfWiFiScanResults.c_str());
NMLOG_INFO("Posting onAvailableSSIDs result is, %s", jsonOfWiFiScanResults.c_str());
for (const auto callback : _notificationCallbacks) {
callback->onAvailableSSIDs(jsonOfWiFiScanResults);
}
Expand All @@ -539,6 +543,7 @@ namespace WPEFramework
void NetworkManagerImplementation::ReportWiFiStateChangedEvent(const INetworkManager::WiFiState state)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting onWiFiStateChange");
_notificationLock.Lock();
for (const auto callback : _notificationCallbacks) {
callback->onWiFiStateChange(state);
Expand All @@ -549,6 +554,7 @@ namespace WPEFramework
void NetworkManagerImplementation::ReportWiFiSignalStrengthChangedEvent(const string ssid, const string signalLevel, const WiFiSignalQuality signalQuality)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting onWiFiSignalStrengthChange");
_notificationLock.Lock();
for (const auto callback : _notificationCallbacks) {
callback->onWiFiSignalStrengthChange(ssid, signalLevel, signalQuality);
Expand Down

0 comments on commit 6d3347d

Please sign in to comment.