Skip to content

RDKBACCL-1343: Utilizing rfcmgr for BPI#23

Open
pganna856 wants to merge 1 commit intordkcentral:developfrom
pganna856:rdkbaccl_1343
Open

RDKBACCL-1343: Utilizing rfcmgr for BPI#23
pganna856 wants to merge 1 commit intordkcentral:developfrom
pganna856:rdkbaccl_1343

Conversation

@pganna856
Copy link

Reason for change:
Adding required changes to support rfcMgr for BPI
Test Procedure:
Verify RFC feature is working or not. Feature should work and generate dcmrfc logs.
Risks: None

Reason for change:
     Adding required changes to support rfcMgr for BPI
Test Procedure:
     Verify RFC feature is working or not. Feature should work and generate dcmrfc logs.
Risks: None

Signed-off-by: Prabhudas Gannavarapu <prabhudas_gannavarapu@comcast.com>
}

RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s] Recevied eRouterMac(eSTBMac): %s\n", __FUNCTION__,erouterMac.c_str());
return erouterMac;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to return local object in CPP?


RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s] Recevied eRouterMac(eSTBMac): %s\n", __FUNCTION__,erouterMac.c_str());
return erouterMac;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Please remove this extra line.

// FEATURE_RDKB_WAN_MANAGER Get WANINTERFACE (
std::string wanInterfaceName = getWanInterfaceName();

std::string cmd = std::string("cat /sys/class/net/") + wanInterfaceName + "/address | tr '[a-f]' '[A-F]'";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you read it from HAL rather than using popen.

std::string wanInterface = getWanInterfaceName();
std::string cmd;

cmd = std::string("cat /sys/class/net/") + wanInterface + "/address | tr '[a-f]' '[A-F]'";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls read it from hal


// If empty, fallback to sysevent get eth_wan_mac
if (erouterMac.empty()) {
pipe = popen("sysevent get eth_wan_mac | tr '[a-f]' '[A-F]'", "r");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use standard api's .for example sysevent_get.

for example
sysevent_get(sysevent_fd, sysevent_token, cmd, ipv6_addr, sizeof(ipv6_addr));

std::string interfaceName;

// Execute sysevent get current_wan_ifname
FILE* pipe = popen("sysevent get current_wan_ifname", "r");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use standard apis
sysevent_get(sysevent_fd, sysevent_token, cmd, ipv6_addr, sizeof(ipv6_addr));


// Check if sysevent failed (non-zero exit status) or returned empty string
if (exitStatus != 0 || interfaceName.empty()) {
interfaceName = "erouter0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls dont hardcode interface name

}
} else {
// If popen failed, default to erouter0
interfaceName = "erouter0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants