Skip to content

Commit

Permalink
To test working scenario with log
Browse files Browse the repository at this point in the history
  • Loading branch information
Gururaaja E S R authored and Gururaaja E S R committed Apr 5, 2024
1 parent 87c498d commit 0603b42
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
30 changes: 29 additions & 1 deletion Network/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
IARM_BUS_NetSrvMgr_InterfaceList_t list;
bool result = false;

LOGINFOMETHOD();
if(m_isPluginInited)
{
if (IARM_RESULT_SUCCESS == IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_NETSRVMGR_API_getInterfaceList, (void*)&list, sizeof(list)))
Expand Down Expand Up @@ -413,6 +414,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
string interface;
string gateway;

LOGINFOMETHOD();
bool result = false;
if(m_isPluginInited)
{
Expand Down Expand Up @@ -441,6 +443,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
{
bool result = false;

LOGINFOMETHOD();
if(m_isPluginInited)
{
if ((parameters.HasLabel("interface")) && (parameters.HasLabel("persist")))
Expand Down Expand Up @@ -482,6 +485,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
IARM_BUS_NetSrvMgr_Iface_EventData_t param;
memset(&param, 0, sizeof(param));

LOGINFOMETHOD();
bool result = false;

if(m_isPluginInited)
Expand Down Expand Up @@ -518,6 +522,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
{
bool result = false;

LOGINFOMETHOD();
if(m_isPluginInited)
{
if (parameters.HasLabel("family"))
Expand Down Expand Up @@ -558,6 +563,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::isInterfaceEnabled (const JsonObject& parameters, JsonObject& response)
{
bool result = false;
LOGINFOMETHOD();

if(m_isPluginInited)
{
Expand Down Expand Up @@ -597,7 +603,8 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::setInterfaceEnabled (const JsonObject& parameters, JsonObject& response)
{
bool result = false;


LOGINFOMETHOD();
if(m_isPluginInited)
{
if ((parameters.HasLabel("interface")) && (parameters.HasLabel("enabled")) && (parameters.HasLabel("persist")))
Expand Down Expand Up @@ -640,6 +647,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::getNamedEndpoints(const JsonObject& parameters, JsonObject& response)
{
JsonArray namedEndpoints;
LOGINFOMETHOD();
namedEndpoints.Add("CMTS");

response["endpoints"] = namedEndpoints;
Expand All @@ -649,6 +657,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::trace(const JsonObject& parameters, JsonObject& response)
{
bool result = false;
LOGINFOMETHOD();

if(m_isPluginInited)
{
Expand Down Expand Up @@ -680,6 +689,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::traceNamedEndpoint(const JsonObject& parameters, JsonObject& response)
{
bool result = false;
LOGINFOMETHOD();

if(m_isPluginInited)
{
Expand Down Expand Up @@ -711,6 +721,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::ping (const JsonObject& parameters, JsonObject& response)
{
string guid;
LOGINFOMETHOD();
getStringParameter("guid", guid)

uint32_t packets;
Expand Down Expand Up @@ -742,6 +753,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::pingNamedEndpoint (const JsonObject& parameters, JsonObject& response)
{
string guid;
LOGINFOMETHOD();
getStringParameter("guid", guid)

uint32_t packets;
Expand Down Expand Up @@ -775,6 +787,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::setIPSettings(const JsonObject& parameters, JsonObject& response)
{
bool result = false;
LOGINFOMETHOD();
if(m_isPluginInited)
return setIPSettingsInternal(parameters, response);
else
Expand All @@ -796,6 +809,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
bool autoconfig = true;
bool result = false;

LOGINFOMETHOD();
if(m_isPluginInited)
{
getDefaultStringParameter("interface", interface, "");
Expand Down Expand Up @@ -829,6 +843,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
bool result = false;
struct in_addr ip_address, gateway_address, mask;
struct in_addr broadcast_addr1, broadcast_addr2;
LOGINFOMETHOD();

if ((parameters.HasLabel("interface")) && (parameters.HasLabel("ipversion")) && (parameters.HasLabel("autoconfig")) &&
(parameters.HasLabel("ipaddr")) && (parameters.HasLabel("netmask")) && (parameters.HasLabel("gateway")) &&
Expand Down Expand Up @@ -949,6 +964,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
bool result = false;
string interface = "";
string ipversion = "";
LOGINFOMETHOD();
if(m_isPluginInited)
{
getDefaultStringParameter("interface", interface,"");
Expand Down Expand Up @@ -988,6 +1004,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
bool result = false;
string interface = "";
string ipversion = "";
LOGINFOMETHOD();
if(m_isPluginInited)
{
getDefaultStringParameter("interface", interface, "");
Expand Down Expand Up @@ -1053,6 +1070,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
string ipversion = "";
bool result = false;

LOGINFOMETHOD();
getStringParameter("interface", interface);
getStringParameter("ipversion", ipversion);
if (interface.empty())
Expand Down Expand Up @@ -1157,6 +1175,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
std::string ipversionStr;
nsm_ipversion ipversion = NSM_IPRESOLVE_WHATEVER;

LOGINFOMETHOD();
if(m_isPluginInited)
{
getDefaultStringParameter("ipversion", ipversionStr, "");
Expand Down Expand Up @@ -1190,6 +1209,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
{
bool result = false;

LOGINFOMETHOD();
if(m_isPluginInited)
{
JsonArray endpointsJsonArray = parameters["endpoints"].Array();
Expand Down Expand Up @@ -1230,6 +1250,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
bool result = false;
std::string ipversionStr;
nsm_internetState internetState = NO_INTERNET;
LOGINFOMETHOD();

if(m_isPluginInited)
{
Expand Down Expand Up @@ -1269,6 +1290,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::getCaptivePortalURI(const JsonObject& parameters, JsonObject& response)
{
bool result = true;
LOGINFOMETHOD();

if(m_isPluginInited)
{
Expand All @@ -1285,6 +1307,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::startConnectivityMonitoring(const JsonObject& parameters, JsonObject& response)
{
bool result = false;
LOGINFOMETHOD();
if (parameters.HasLabel("interval"))
{
result = connectivityMonitor.doContinuousConnectivityMonitoring(parameters["interval"].Number());
Expand All @@ -1299,6 +1322,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {

uint32_t Network::stopConnectivityMonitoring(const JsonObject& parameters, JsonObject& response)
{
LOGINFOMETHOD();
bool result = connectivityMonitor.stopContinuousConnectivityMonitoring();
returnResponse(result);
}
Expand All @@ -1312,6 +1336,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
internal ["cache_timeout"] = m_stunCacheTimeout;
internal ["sync"] = m_stunSync;

LOGINFOMETHOD();
if (parameters.HasLabel("iface"))
internal ["iface"] = parameters["iface"];

Expand All @@ -1323,6 +1348,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {

uint32_t Network::setStunEndPoint(const JsonObject& parameters, JsonObject& response)
{
LOGINFOMETHOD();
getDefaultStringParameter("server", m_stunEndPoint, "stun.l.google.com");
getDefaultNumberParameter("port", m_stunPort, 19302);
getDefaultBoolParameter("sync", m_stunSync, true);
Expand All @@ -1336,6 +1362,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
{
bool result = false;
IARM_BUS_NetSrvMgr_configurePNI_t pniConfig = {0};
LOGINFOMETHOD();
if(m_isPluginInited)
{
bool disableConnTest = true;
Expand All @@ -1361,6 +1388,7 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t {
uint32_t Network::getPublicIPInternal(const JsonObject& parameters, JsonObject& response)
{
bool result = false;
LOGINFOMETHOD();

IARM_BUS_NetSrvMgr_Iface_StunRequest_t iarmData = { 0 };
string server, iface;
Expand Down
1 change: 1 addition & 0 deletions WifiManager/impl/WifiManagerState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ uint32_t WifiManagerState::getConnectedSSID(const JsonObject &parameters, JsonOb
IARM_Result_t retVal = IARM_RESULT_SUCCESS;
IARM_Bus_WiFiSrvMgr_Param_t param;

LOGINFOMETHOD();
memset(&param, 0, sizeof(param));

retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getConnectedSSID, (void *)&param, sizeof(param));
Expand Down

0 comments on commit 0603b42

Please sign in to comment.