mirror of https://github.com/nymea/nymea.git
rename IPC/RPC interfaces from guhIO to nymea
parent
5826532fc9
commit
b46f6f3968
|
|
@ -28,7 +28,7 @@
|
|||
\inherits TransportInterface
|
||||
|
||||
The bluetooth server allows clients to connect to the JSON-RPC API using an RFCOMM bluetooth connection. If the server is enabled, a client
|
||||
can discover the services running on this host. The service for the JSON-RPC api is called \tt guhIO and has the uuid \tt 997936b5-d2cd-4c57-b41b-c6048320cd2b .
|
||||
can discover the services running on this host. The service for the JSON-RPC api is called \tt nymea and has the uuid \tt 997936b5-d2cd-4c57-b41b-c6048320cd2b .
|
||||
|
||||
\sa TransportInterface
|
||||
*/
|
||||
|
|
@ -174,9 +174,9 @@ bool BluetoothServer::startServer()
|
|||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId);
|
||||
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::BluetoothProfileDescriptorList,classId);
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceName, QVariant("guhIO"));
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceDescription, QVariant("The JSON-RPC interface for guhIO."));
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceProvider, QVariant("https://guh.io"));
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceName, QVariant("nymea"));
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceDescription, QVariant("The JSON-RPC interface for nymea."));
|
||||
m_serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceProvider, QVariant("https://nymea.io"));
|
||||
|
||||
// Define protocol
|
||||
QBluetoothServiceInfo::Sequence protocolDescriptorList;
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@ void CertificateGenerator::generate(const QString &certificateFilename, const QS
|
|||
X509_set_pubkey(x509, pkey);
|
||||
name = X509_get_subject_name(x509);
|
||||
q_check_ptr(name);
|
||||
X509_NAME_add_entry_by_txt(name, "E", MBSTRING_ASC, (unsigned char *)"guh.io", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"guh.io", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "E", MBSTRING_ASC, (unsigned char *)"nymea", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"nymea.io", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "OU", MBSTRING_ASC, (unsigned char *)"home", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, (unsigned char *)"guh.io", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, (unsigned char *)"guh GmbH", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "L", MBSTRING_ASC, (unsigned char *)"Vienna", -1, -1, 0);
|
||||
X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, (unsigned char *)"AT", -1, -1, 0);
|
||||
X509_set_issuer_name(x509, name);
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ void UpnpDiscoveryImplementation::respondToSearchRequest(QHostAddress host, int
|
|||
"EXT:\r\n"
|
||||
"CONTENT-LENGTH:0\r\n"
|
||||
"LOCATION: " + locationString.toUtf8() + "\r\n"
|
||||
"SERVER: guh/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
|
||||
"SERVER: nymea/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
|
||||
"ST:upnp:rootdevice\r\n"
|
||||
"USN:uuid:" + uuid + "::urn:schemas-upnp-org:device:Basic:1\r\n"
|
||||
"\r\n");
|
||||
|
|
@ -381,7 +381,7 @@ void UpnpDiscoveryImplementation::sendByeByeMessage()
|
|||
"NT:urn:schemas-upnp-org:device:Basic:1\r\n"
|
||||
"USN:uuid:" + uuid + "::urn:schemas-upnp-org:device:Basic:1\r\n"
|
||||
"NTS: ssdp:byebye\r\n"
|
||||
"SERVER: guh/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
|
||||
"SERVER: nymea/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
|
||||
"\r\n");
|
||||
|
||||
sendToMulticast(byebyeMessage);
|
||||
|
|
@ -427,7 +427,7 @@ void UpnpDiscoveryImplementation::sendAliveMessage()
|
|||
"NT:urn:schemas-upnp-org:device:Basic:1\r\n"
|
||||
"USN:uuid:" + uuid + "::urn:schemas-upnp-org:device:Basic:1\r\n"
|
||||
"NTS: ssdp:alive\r\n"
|
||||
"SERVER: guh/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
|
||||
"SERVER: nymea/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
|
||||
"\r\n");
|
||||
|
||||
sendToMulticast(aliveMessage);
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@
|
|||
|
||||
/*!
|
||||
\class nymeaserver::HttpReply
|
||||
\brief Represents a reply of the guh webserver to a \l{HttpRequest}.
|
||||
\brief Represents a reply of the nymea webserver to a \l{HttpRequest}.
|
||||
|
||||
\ingroup api
|
||||
\inmodule core
|
||||
|
||||
This class holds the header and the payload data of a network reply and represents a response
|
||||
from the guh webserver to a \l{HttpRequest}.
|
||||
from the nymea webserver to a \l{HttpRequest}.
|
||||
|
||||
\note RFC 7231 HTTP/1.1 Semantics and Content -> \l{http://tools.ietf.org/html/rfc7231}{http://tools.ietf.org/html/rfc7231}
|
||||
*/
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
\value DateHeader
|
||||
The server date header.
|
||||
\value ServerHeader
|
||||
The name of the server i.e. "Server: guh/0.6.0"
|
||||
The name of the server i.e. "Server: nymea/0.6.0"
|
||||
*/
|
||||
|
||||
/*! \enum nymeaserver::HttpReply::Type
|
||||
|
|
@ -156,7 +156,7 @@ HttpReply::HttpReply(QObject *parent) :
|
|||
|
||||
// set known headers
|
||||
setHeader(HttpReply::ContentTypeHeader, "text/plain; charset=\"utf-8\";");
|
||||
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(NYMEA_VERSION_STRING));
|
||||
setHeader(HttpHeaderType::ServerHeader, "nymea/" + QByteArray(NYMEA_VERSION_STRING));
|
||||
setHeader(HttpHeaderType::DateHeader, NymeaCore::instance()->timeManager()->currentDateTime().toString("ddd, dd MMM yyyy hh:mm:ss").toUtf8());
|
||||
setHeader(HttpHeaderType::CacheControlHeader, "no-cache");
|
||||
setHeader(HttpHeaderType::ConnectionHeader, "Keep-Alive");
|
||||
|
|
@ -179,7 +179,7 @@ HttpReply::HttpReply(const HttpReply::HttpStatusCode &statusCode, const HttpRepl
|
|||
|
||||
// set known / default headers
|
||||
setHeader(HttpReply::ContentTypeHeader, "text/plain; charset=\"utf-8\";");
|
||||
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(NYMEA_VERSION_STRING));
|
||||
setHeader(HttpHeaderType::ServerHeader, "nymea/" + QByteArray(NYMEA_VERSION_STRING));
|
||||
setHeader(HttpHeaderType::DateHeader, NymeaCore::instance()->timeManager()->currentDateTime().toString("ddd, dd MMM yyyy hh:mm:ss").toUtf8());
|
||||
setHeader(HttpHeaderType::CacheControlHeader, "no-cache");
|
||||
setHeader(HttpHeaderType::ConnectionHeader, "Keep-Alive");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
/*!
|
||||
\class nymeaserver::HttpRequest
|
||||
\brief Represents a HTTP request from a client to the guh \l{WebServer}.
|
||||
\brief Represents a HTTP request from a client to the nymea \l{WebServer}.
|
||||
|
||||
\ingroup api
|
||||
\inmodule core
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ void JanusConnector::createChannel(WebRtcSession *session)
|
|||
m_pendingRequests.insert(transactionId, session);
|
||||
attachPluginMessage.insert("transaction", transactionId);
|
||||
attachPluginMessage.insert("plugin", "janus.plugin.guhio");
|
||||
attachPluginMessage.insert("opaque_id", "guhio-" + QUuid::createUuid().toString());
|
||||
attachPluginMessage.insert("opaque_id", "nymea-" + QUuid::createUuid().toString());
|
||||
QJsonDocument jsonDoc = QJsonDocument::fromVariant(attachPluginMessage);
|
||||
qCDebug(dcJanus()) << "Establishing channel for session" << session->sessionId;
|
||||
writeToJanus(jsonDoc.toJson());
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ ConfigurationHandler::ConfigurationHandler(QObject *parent):
|
|||
setReturns("GetConfigurations", returns);
|
||||
|
||||
params.clear(); returns.clear();
|
||||
setDescription("SetServerName", "Set the name of the server. Default is guhIO.");
|
||||
setDescription("SetServerName", "Set the name of the server. Default is nymea.");
|
||||
params.insert("serverName", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||
setParams("SetServerName", params);
|
||||
returns.insert("configurationError", JsonTypes::configurationErrorRef());
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ JsonRPCServer::JsonRPCServer(const QSslConfiguration &sslConfiguration, QObject
|
|||
QVariantMap params;
|
||||
|
||||
params.clear(); returns.clear();
|
||||
setDescription("Hello", "Upon first connection, guh will automatically send a welcome message containing information about the setup. If this message is lost for whatever reason (connections with multiple hops might drop this if guh sends it too early), the exact same message can be retrieved multiple times by calling this Hello method. Note that the contents might change if the system changed its state in the meantime, e.g. initialSetupRequired might turn false if the initial setup has been performed in the meantime.");
|
||||
setDescription("Hello", "Upon first connection, nymea will automatically send a welcome message containing information about the setup. If this message is lost for whatever reason (connections with multiple hops might drop this if nymea sends it too early), the exact same message can be retrieved multiple times by calling this Hello method. Note that the contents might change if the system changed its state in the meantime, e.g. initialSetupRequired might turn false if the initial setup has been performed in the meantime.");
|
||||
setParams("Hello", params);
|
||||
returns.insert("id", JsonTypes::basicTypeToString(JsonTypes::Int));
|
||||
returns.insert("server", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||
|
|
@ -97,7 +97,7 @@ JsonRPCServer::JsonRPCServer(const QSslConfiguration &sslConfiguration, QObject
|
|||
setReturns("Introspect", returns);
|
||||
|
||||
params.clear(); returns.clear();
|
||||
setDescription("Version", "Version of this Guh/JSONRPC interface.");
|
||||
setDescription("Version", "Version of this nymea/JSONRPC interface.");
|
||||
setParams("Version", params);
|
||||
returns.insert("version", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||
returns.insert("protocol version", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||
|
|
@ -111,7 +111,7 @@ JsonRPCServer::JsonRPCServer(const QSslConfiguration &sslConfiguration, QObject
|
|||
setReturns("SetNotificationStatus", returns);
|
||||
|
||||
params.clear(); returns.clear();
|
||||
setDescription("CreateUser", "Create a new user in the API. Currently this is only allowed to be called once when a new guh instance is set up. Call Authenticate after this to obtain a device token for this user.");
|
||||
setDescription("CreateUser", "Create a new user in the API. Currently this is only allowed to be called once when a new nymea instance is set up. Call Authenticate after this to obtain a device token for this user.");
|
||||
params.insert("username", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||
params.insert("password", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||
setParams("CreateUser", params);
|
||||
|
|
@ -430,7 +430,7 @@ QVariantMap JsonRPCServer::createWelcomeMessage(TransportInterface *interface) c
|
|||
{
|
||||
QVariantMap handshake;
|
||||
handshake.insert("id", 0);
|
||||
handshake.insert("server", "guhIO");
|
||||
handshake.insert("server", "nymea");
|
||||
handshake.insert("name", NymeaCore::instance()->configuration()->serverName());
|
||||
handshake.insert("version", NYMEA_VERSION_STRING);
|
||||
handshake.insert("uuid", NymeaCore::instance()->configuration()->serverUuid().toString());
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ NetworkManager::NetworkManagerError NetworkManager::connectWifi(const QString &i
|
|||
|
||||
QVariantMap connectionSettings;
|
||||
connectionSettings.insert("autoconnect", true);
|
||||
connectionSettings.insert("id", ssid + " (guhIO)");
|
||||
connectionSettings.insert("id", ssid + " (nymea)");
|
||||
connectionSettings.insert("type", "802-11-wireless");
|
||||
|
||||
QVariantMap wirelessSettings;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ QString NymeaConfiguration::serverName() const
|
|||
{
|
||||
NymeaSettings settings(NymeaSettings::SettingsRoleGlobal);
|
||||
settings.beginGroup("nymead");
|
||||
return settings.value("name", "guhIO").toString();
|
||||
return settings.value("name", "nymea").toString();
|
||||
}
|
||||
|
||||
void NymeaConfiguration::setServerName(const QString &serverName)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
/*!
|
||||
\class nymeaserver::ServerManager
|
||||
\brief This class represents the manager of all server interfaces of the guh server.
|
||||
\brief This class represents the manager of all server interfaces of the nymea server.
|
||||
|
||||
\ingroup server
|
||||
\inmodule core
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ TcpServer::~TcpServer()
|
|||
|
||||
QUrl TcpServer::serverUrl() const
|
||||
{
|
||||
return QUrl(QString("%1://%2:%3").arg((configuration().sslEnabled ? "guhs" : "guh")).arg(configuration().address.toString()).arg(configuration().port));
|
||||
return QUrl(QString("%1://%2:%3").arg((configuration().sslEnabled ? "nymeas" : "nymea")).arg(configuration().address.toString()).arg(configuration().port));
|
||||
}
|
||||
|
||||
/*! Sending \a data to a list of \a clients.*/
|
||||
|
|
@ -138,7 +138,7 @@ void TcpServer::resetAvahiService()
|
|||
txt.insert("uuid", NymeaCore::instance()->configuration()->serverUuid().toString());
|
||||
txt.insert("name", NymeaCore::instance()->configuration()->serverName());
|
||||
txt.insert("sslEnabled", configuration().sslEnabled ? "true" : "false");
|
||||
if (!m_avahiService->registerService(QString("guhIO-tcp-%1").arg(configuration().id), configuration().port, "_jsonrpc._tcp", txt)) {
|
||||
if (!m_avahiService->registerService(QString("nymea-tcp-%1").arg(configuration().id), configuration().port, "_jsonrpc._tcp", txt)) {
|
||||
qCWarning(dcTcpServer()) << "Could not register avahi service for" << configuration();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
\inmodule core
|
||||
|
||||
The \l{WebServer} class provides a HTTP/1.1 web server. The web server
|
||||
provides access to the guh-webinterface and the path can be specified
|
||||
provides access to the nymea-webinterface and the path can be specified
|
||||
in the \tt /etc/guh/nymead.conf file and to the guh \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST API}.
|
||||
The default port for the web server is 3333, which is according to this
|
||||
\l{https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers}{list}
|
||||
|
|
@ -536,7 +536,7 @@ void WebServer::resetAvahiService()
|
|||
txt.insert("name", NymeaCore::instance()->configuration()->serverName());
|
||||
txt.insert("sslEnabled", m_configuration.sslEnabled ? "true" : "false");
|
||||
|
||||
if (!m_avahiService->registerService(QString("guhIO-http-%1").arg(m_configuration.id), m_configuration.port, "_http._tcp", txt)) {
|
||||
if (!m_avahiService->registerService(QString("nymea-http-%1").arg(m_configuration.id), m_configuration.port, "_http._tcp", txt)) {
|
||||
qCWarning(dcTcpServer()) << "Could not register avahi service for" << m_configuration;
|
||||
}
|
||||
}
|
||||
|
|
@ -653,9 +653,9 @@ QByteArray WebServer::createServerXmlDocument(QHostAddress address)
|
|||
}
|
||||
if (tcpServerFound) {
|
||||
if (tcpServerConfiguration.sslEnabled) {
|
||||
writer.writeTextElement("guhRpcURL", "guhs://" + address.toString() + ":" + QString::number(tcpServerConfiguration.port));
|
||||
writer.writeTextElement("nymeaRpcURL", "nymeas://" + address.toString() + ":" + QString::number(tcpServerConfiguration.port));
|
||||
} else {
|
||||
writer.writeTextElement("guhRpcURL", "guh://" + address.toString() + ":" + QString::number(tcpServerConfiguration.port));
|
||||
writer.writeTextElement("nymeaRpcURL", "nymea://" + address.toString() + ":" + QString::number(tcpServerConfiguration.port));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -669,7 +669,7 @@ QByteArray WebServer::createServerXmlDocument(QHostAddress address)
|
|||
writer.writeTextElement("modelDescription", "IoT server");
|
||||
writer.writeTextElement("modelName", "nymead");
|
||||
writer.writeTextElement("modelNumber", NYMEA_VERSION_STRING);
|
||||
writer.writeTextElement("modelURL", "http://guh.io"); // (optional)
|
||||
writer.writeTextElement("modelURL", "http://nymea.io"); // (optional)
|
||||
writer.writeTextElement("UDN", "uuid:" + uuid);
|
||||
|
||||
writer.writeStartElement("iconList");
|
||||
|
|
@ -769,7 +769,7 @@ QByteArray WebServer::createServerXmlDocument(QHostAddress address)
|
|||
\ingroup server
|
||||
\inmodule core
|
||||
|
||||
The \l{WebServerClient} represents a client for the guh \l{WebServer}. Each client can
|
||||
The \l{WebServerClient} represents a client for the nymea \l{WebServer}. Each client can
|
||||
have up to 50 connections and each connection will timeout after 12 seconds if the
|
||||
connection will not be used.
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ QHash<QString, QString> WebSocketServer::createTxtRecord()
|
|||
QHash<QString, QString> txt;
|
||||
txt.insert("jsonrpcVersion", JSON_PROTOCOL_VERSION);
|
||||
txt.insert("serverVersion", NYMEA_VERSION_STRING);
|
||||
txt.insert("manufacturer", "guh GmbH");
|
||||
txt.insert("manufacturer", "nymea GmbH");
|
||||
txt.insert("uuid", NymeaCore::instance()->configuration()->serverUuid().toString());
|
||||
txt.insert("name", NymeaCore::instance()->configuration()->serverName());
|
||||
txt.insert("sslEnabled", configuration().sslEnabled ? "true" : "false");
|
||||
|
|
@ -201,7 +201,7 @@ void WebSocketServer::resetAvahiService()
|
|||
return;
|
||||
|
||||
m_avahiService->resetService();
|
||||
if (!m_avahiService->registerService(QString("guhIO-ws-%1").arg(configuration().id), configuration().port, "_ws._tcp", createTxtRecord())) {
|
||||
if (!m_avahiService->registerService(QString("nymea-ws-%1").arg(configuration().id), configuration().port, "_ws._tcp", createTxtRecord())) {
|
||||
qCWarning(dcWebServer()) << "Could not register avahi service for" << configuration();
|
||||
}
|
||||
}
|
||||
|
|
@ -237,10 +237,10 @@ void WebSocketServer::setServerName(const QString &serverName)
|
|||
bool WebSocketServer::startServer()
|
||||
{
|
||||
if (configuration().sslEnabled) {
|
||||
m_server = new QWebSocketServer("guh", QWebSocketServer::SecureMode, this);
|
||||
m_server = new QWebSocketServer("nymea", QWebSocketServer::SecureMode, this);
|
||||
m_server->setSslConfiguration(m_sslConfiguration);
|
||||
} else {
|
||||
m_server = new QWebSocketServer("guh", QWebSocketServer::NonSecureMode, this);
|
||||
m_server = new QWebSocketServer("nymea", QWebSocketServer::NonSecureMode, this);
|
||||
}
|
||||
connect (m_server, &QWebSocketServer::newConnection, this, &WebSocketServer::onClientConnected);
|
||||
connect (m_server, &QWebSocketServer::acceptError, this, &WebSocketServer::onServerError);
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ bool PushButtonAgent::init(QDBusConnection::BusType busType)
|
|||
{
|
||||
QDBusConnection bus = busType == QDBusConnection::SessionBus ? QDBusConnection::sessionBus() : QDBusConnection::systemBus();
|
||||
|
||||
bool result = bus.registerObject("/guh/pushbuttonhandler", this, QDBusConnection::ExportScriptableContents);
|
||||
bool result = bus.registerObject("/nymea/pushbuttonhandler", this, QDBusConnection::ExportScriptableContents);
|
||||
if (!result) {
|
||||
qDebug() << "Error registering PushButton agent on D-Bus.";
|
||||
return false;
|
||||
}
|
||||
|
||||
QDBusMessage message = QDBusMessage::createMethodCall("io.guh.nymead", "/io/guh/nymead/UserManager", QString(), "RegisterButtonAgent");
|
||||
message << qVariantFromValue(QDBusObjectPath("/guh/pushbuttonhandler"));
|
||||
message << qVariantFromValue(QDBusObjectPath("/nymea/pushbuttonhandler"));
|
||||
QDBusMessage reply = bus.call(message);
|
||||
if (!reply.errorName().isEmpty()) {
|
||||
qDebug() << "Error registering PushButton agent:" << reply.errorMessage();
|
||||
|
|
|
|||
Loading…
Reference in New Issue