-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'm getting sick of having SHV3 clients ping all the time, and it working even though all the pings result in an error.
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "appnode.h" | ||
|
||
#include <shv/broker/brokerapp.h> | ||
|
||
namespace shv::broker { | ||
AppNode::AppNode(shv::iotqt::node::ShvNode *parent) | ||
: Super("", &m_metaMethods, parent) | ||
, m_metaMethods { | ||
shv::chainpack::methods::DIR, | ||
shv::chainpack::methods::LS, | ||
{shv::chainpack::Rpc::METH_PING, shv::chainpack::MetaMethod::Flag::None, "Null", "Null", shv::chainpack::AccessLevel::Browse, {}, "https://silicon-heaven.github.io/shv-doc/rpcmethods/app.html#appping"}, | ||
} | ||
{ | ||
} | ||
|
||
shv::chainpack::RpcValue AppNode::callMethod(const StringViewList& shv_path, const std::string& method, const shv::chainpack::RpcValue& params, const chainpack::RpcValue& user_id) | ||
{ | ||
if (shv_path.empty()) { | ||
if (method == shv::chainpack::Rpc::METH_PING) { | ||
return chainpack::RpcValue(nullptr); | ||
} | ||
} | ||
return Super::callMethod(shv_path, method, params, user_id); | ||
} | ||
} |
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,20 @@ | ||
#pragma once | ||
|
||
#include <shv/iotqt/node/shvnode.h> | ||
#include <shv/chainpack/rpcvalue.h> | ||
|
||
namespace shv::broker { | ||
|
||
class AppNode : public shv::iotqt::node::MethodsTableNode | ||
{ | ||
Q_OBJECT | ||
|
||
using Super = shv::iotqt::node::MethodsTableNode; | ||
public: | ||
AppNode(shv::iotqt::node::ShvNode *parent = nullptr); | ||
|
||
shv::chainpack::RpcValue callMethod(const StringViewList &shv_path, const std::string &method, const shv::chainpack::RpcValue ¶ms, const shv::chainpack::RpcValue &user_id) override; | ||
private: | ||
std::vector<shv::chainpack::MetaMethod> m_metaMethods; | ||
}; | ||
} |
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