controlapi.cpp: add possibility to get boxinfo

Origin commit data
------------------
Branch: ni/coolstream
Commit: 5fbe77afa5
Author: GetAway <get-away@t-online.de>
Date: 2023-05-29 (Mon, 29 May 2023)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
GetAway
2023-05-29 22:32:56 +02:00
committed by vanhofen
parent 991db1cce5
commit a0a463730e
3 changed files with 57 additions and 0 deletions

View File

@@ -223,6 +223,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
{"getdate", &CControlAPI::GetDateCGI, "text/plain"},
{"gettime", &CControlAPI::GetTimeCGI, "text/plain"},
{"info", &CControlAPI::InfoCGI, "text/plain"},
{"boxinfo", &CControlAPI::BoxInfoCGI, "text/plain"},
{"version", &CControlAPI::VersionCGI, ""},
{"reloadsetup", &CControlAPI::ReloadNeutrinoSetupCGI, ""},
{"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""},
@@ -877,6 +878,38 @@ void CControlAPI::InfoCGI(CyhookHandler *hh)
}
}
void CControlAPI::BoxInfoCGI(CyhookHandler *hh)
{
std::string boxinfo(g_info.hw_caps->boxvendor);
/*
I don't know the current legal situation.
So better let's change the vendor's name to CST.
After change this, you'll have to align code in Y_Blocks.txt
*/
if (boxinfo.compare("Coolstream") == 0) {
boxinfo = "CST";
}
std::string boxname(g_info.hw_caps->boxname);
if (strcmp(boxname.c_str(), "Neo") == 0)
{
// detecting Neo Twin by counting frontends
if (CFEManager::getInstance()->getFrontendCount() > 1)
boxname = "Neo Twin";
}
boxinfo = "vendor=" + boxinfo;
boxinfo += "\n";
boxinfo += "boxname=";
boxinfo += boxname;
boxinfo += "\n";
boxinfo += "boxarch=";
boxinfo += g_info.hw_caps->boxarch;
hh->printf("%s\n", boxinfo.c_str());
}
void CControlAPI::HWInfoCGI(CyhookHandler *hh)
{
static CNetAdapter netadapter;