From cb7ca8c7b884e875182d5509a51baf91eaf042db Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 31 Dec 2010 15:58:03 +0000 Subject: [PATCH] add mac to hwinfo git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@985 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb70beffa4463f71ee84725e298f2646979046c7 Author: Jacek Jendrzej Date: 2010-12-31 (Fri, 31 Dec 2010) Origin message was: ------------------ -add mac to hwinfo git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@985 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 16 +++++++++++++--- .../tuxboxapi/coolstream/neutrinoyparser.cpp | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index bddeed8ec..e346d8545 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include // yhttpd @@ -583,11 +584,20 @@ void CControlAPI::HWInfoCGI(CyhookHandler *hh) { unsigned int system_rev = cs_get_revision(); std::string boxname; - boxname = "Coolstream "; + static CNetAdapter netadapter; + std::string eth_id = netadapter.getMacAddr(); + std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); + + if("00:c5:5c" == eth_id.substr(0, 8) ) + boxname = "Coolstream "; + else if("ba:dd:ad" == eth_id.substr(0, 8) ) + boxname = "Armas "; + switch(system_rev) { case 1: - boxname = "TripleDragon"; + if( boxname == "Armas ") + boxname += "TripleDragon"; break; case 6: boxname += "HD1"; @@ -612,7 +622,7 @@ void CControlAPI::HWInfoCGI(CyhookHandler *hh) break; } boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; - hh->printf("%s\n", boxname.c_str()); + hh->printf("%s\nMAC:%s\n", boxname.c_str(),eth_id.c_str()); } diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 946791a79..663d54784 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -29,6 +29,7 @@ #include #include #include +#include extern tallchans allchans; extern CBouquetManager *g_bouquetManager; @@ -655,11 +656,20 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { unsigned int system_rev = cs_get_revision(); std::string boxname; - boxname = "Coolstream "; + static CNetAdapter netadapter; + std::string eth_id = netadapter.getMacAddr(); + std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); + + if("00:c5:5c" == eth_id.substr(0, 8) ) + boxname = "Coolstream "; + else if("ba:dd:ad" == eth_id.substr(0, 8) ) + boxname = "Armas "; + switch(system_rev) { case 1: - boxname = "TripleDragon"; + if( boxname == "Armas ") + boxname += "TripleDragon"; break; case 6: boxname += "HD1"; @@ -683,6 +693,7 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) } break; } + boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; return boxname; }