fix another bug
This commit is contained in:
parent
403a78d029
commit
0078bd1d0c
@ -118,11 +118,6 @@ void AWSConnector::onConnected()
|
||||
|
||||
// OK, we're registerd already, go straight to pairing setup
|
||||
setupPairing();
|
||||
|
||||
// // TODO: remove this again. just using this for testing now
|
||||
// QStringList subscriptions;
|
||||
// subscriptions.append(QString("eu-west-1:%1/%2/#").arg("7127d36f-9644-455c-bb14-4a23bfac65fe").arg(m_clientId));
|
||||
// subscribe(subscriptions);
|
||||
}
|
||||
|
||||
void AWSConnector::registerDevice()
|
||||
@ -372,7 +367,7 @@ ResponseCode AWSConnector::onSubscriptionReceivedCallback(util::String topic_nam
|
||||
} else if (!userId.isEmpty()) {
|
||||
qCDebug(dcAWS()) << "Pairing response for id:" << userId << statusCode;
|
||||
emit connector->devicePaired(userId, statusCode, message);
|
||||
connector->subscribe({QString("eu-west-1:%1/listeningPeer/#").arg(userId)});
|
||||
connector->subscribe({QString("%1/%2/#").arg(connector->m_clientId).arg(userId)});
|
||||
} else {
|
||||
qCWarning(dcAWS()) << "Received a pairing response for a transaction we didn't start";
|
||||
}
|
||||
|
||||
@ -263,7 +263,6 @@ JsonReply *JsonRPCServer::RemoveToken(const QVariantMap ¶ms)
|
||||
|
||||
JsonReply *JsonRPCServer::SetupRemoteAccess(const QVariantMap ¶ms)
|
||||
{
|
||||
qWarning() << "SetupRemoteAccess called";
|
||||
QString idToken = params.value("idToken").toString();
|
||||
QString userId = params.value("userId").toString();
|
||||
GuhCore::instance()->cloudManager()->pairDevice(idToken, userId);
|
||||
@ -375,7 +374,6 @@ void JsonRPCServer::setup()
|
||||
void JsonRPCServer::processData(const QUuid &clientId, const QByteArray &data)
|
||||
{
|
||||
qCDebug(dcJsonRpcTraffic()) << "Incoming data:" << data;
|
||||
qWarning() << "***F*f+DSF*DA*a+FD*SF*f+ASDF*S";
|
||||
|
||||
TransportInterface *interface = qobject_cast<TransportInterface *>(sender());
|
||||
QJsonParseError error;
|
||||
|
||||
@ -225,13 +225,11 @@ void SslServer::onSocketReadyRead()
|
||||
m_receiveBuffer.append(socket->readAll());
|
||||
int splitIndex = m_receiveBuffer.indexOf("}\n{");
|
||||
while (splitIndex > -1) {
|
||||
qWarning() << "******" << "emitting dataAcailable" << splitIndex;
|
||||
emit dataAvailable(socket, m_receiveBuffer.left(splitIndex + 1));
|
||||
m_receiveBuffer = m_receiveBuffer.right(m_receiveBuffer.length() - splitIndex - 2);
|
||||
splitIndex = m_receiveBuffer.indexOf("}\n{");
|
||||
}
|
||||
if (m_receiveBuffer.endsWith("}\n")) {
|
||||
qWarning() << "*********" << "emitting dataAvailable" << m_receiveBuffer;
|
||||
emit dataAvailable(socket, m_receiveBuffer);
|
||||
m_receiveBuffer.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user