-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update protobuf definitions * Add property messages to flipperproto0 and interface * Add ProtobufVersion messages to flipperproto0 and interface * Add ProtobufVersionOperation to backend rpc * Add ProtobufVersion to MainResponse * Improve protobuf version checking, make it unsigned * Add device info via new PropertyGet API
- Loading branch information
Showing
34 changed files
with
629 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "propertygetoperation.h" | ||
|
||
#include "protobufplugininterface.h" | ||
#include "mainresponseinterface.h" | ||
#include "propertyresponseinterface.h" | ||
|
||
using namespace Flipper; | ||
using namespace Zero; | ||
|
||
PropertyGetOperation::PropertyGetOperation(uint32_t id, const QByteArray &key, QObject *parent): | ||
AbstractProtobufOperation(id, parent), | ||
m_key(key) | ||
{} | ||
|
||
const QString PropertyGetOperation::description() const | ||
{ | ||
return QStringLiteral("Property Get"); | ||
} | ||
|
||
const QByteArray PropertyGetOperation::value(const QByteArray &key) const | ||
{ | ||
return m_data.value(key); | ||
} | ||
|
||
const QByteArray PropertyGetOperation::encodeRequest(ProtobufPluginInterface *encoder) | ||
{ | ||
return encoder->propertyGet(id(), m_key); | ||
} | ||
|
||
bool PropertyGetOperation::processResponse(QObject *response) | ||
{ | ||
const auto *msg = qobject_cast<PropertyGetResponseInterface*>(response); | ||
|
||
if(msg) { | ||
m_data.insert(msg->key(), msg->value()); | ||
return true; | ||
} | ||
|
||
return qobject_cast<EmptyResponseInterface*>(response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include "abstractprotobufoperation.h" | ||
|
||
#include <QHash> | ||
#include <QByteArray> | ||
|
||
namespace Flipper { | ||
namespace Zero { | ||
|
||
class PropertyGetOperation : public AbstractProtobufOperation | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
PropertyGetOperation(uint32_t id, const QByteArray &key, QObject *parent = nullptr); | ||
const QString description() const override; | ||
const QByteArray value(const QByteArray &key) const; | ||
|
||
const QByteArray encodeRequest(ProtobufPluginInterface *encoder) override; | ||
|
||
private: | ||
bool processResponse(QObject *response) override; | ||
|
||
QByteArray m_key; | ||
QHash<QByteArray, QByteArray> m_data; | ||
}; | ||
|
||
} | ||
} | ||
|
Oops, something went wrong.