17#include "libmythbase/mythversion.h"
25 "urn:schemas-mythtv-org:service:MythTV:1",
36 if (pParams ==
nullptr)
45 list.insert(
"Pin", sPin );
48 "GetConnectionInfo", list, nErrCode, sErrDesc);
54 QDomNode oNode = xmlResults.namedItem(
"ConnectionInfo" );
58 QDomNode dbNode = oNode.namedItem(
"Database" );
67 QDomNode wolNode = oNode.namedItem(
"WOL" );
74 QDomNode verNode = oNode.namedItem(
"Version" );
86 LOG(VB_GENERAL, LOG_ERR,
87 QString(
"MythXMLClient::GetConnectionInfo Failed - "
88 "Version Mismatch (%1,%2) != (%3,%4)")
92 MYTH_DATABASE_VERSION));
93 sMsg = QObject::tr(
"Version Mismatch",
"UPNP Errors");
102 LOG(VB_GENERAL, LOG_ERR,
103 QString(
"MythXMLClient::GetConnectionInfo Failed - (%1) %2")
104 .arg(nErrCode) .arg(sErrDesc));
109 ( nErrCode == 501 ) )
113 sMsg = QObject::tr(
"Not Authorized",
"UPNP Errors");
117 sMsg = QObject::tr(
"Unknown Error",
"UPNP Errors");
Structure containing the basic Database parameters.
QString m_verBranch
git branch
QString m_dbName
database name
QString m_dbPassword
DB password.
std::chrono::seconds m_wolReconnect
seconds to wait for reconnect
QString m_verBinary
binary library version
QString m_dbUserName
DB user name.
QString m_verSchema
core schema version
QString m_dbType
database type (MySQL, Postgres, etc.)
QString m_verVersion
git version string
QString m_wolCommand
command to use for wake-on-lan
bool m_wolEnabled
true if wake-on-lan params are used
int m_dbPort
database port
int m_wolRetry
times to retry to reconnect
QString m_dbHostName
database server
QString m_verProtocol
backend protocol
UPnPResultCode GetConnectionInfo(const QString &sPin, DatabaseParams *pParams, QString &sMsg)
MythXMLClient(const QUrl &url)
Subclass SOAPClient to perform actions using the command URL.
int GetNodeValue(const QDomNode &node, const QString &sName, int nDefault) const
Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found...
QDomDocument SendSOAPRequest(const QString &sMethod, QStringMap &list, int &nErrCode, QString &sErrDesc)
Actually sends the sMethod action to the command URL specified in the constructor (url+[/]+sControlPa...
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
@ UPnPResult_HumanInterventionRequired
@ UPnPResult_MythTV_XmlParseError
@ UPnPResult_ActionFailed
@ UPnPResult_ActionNotAuthorized
QMap< QString, QString > QStringMap