add iot framework
This commit is contained in:
1 parent
43b1046df5
commit
d31901e9e5
27 files changed
+686
-76
No files matched your search
@@ -57,3 +57,14 @@ void Protocol::SendStopListening() {
|
||||
std::string message = "{\"session_id\":\"" + session_id_ + "\",\"type\":\"listen\",\"state\":\"stop\"}";
|
||||
SendText(message);
|
||||
}
|
||||
|
||||
void Protocol::SendIotDescriptors(const std::string& descriptors) {
|
||||
std::string message = "{\"session_id\":\"" + session_id_ + "\",\"type\":\"iot\",\"descriptors\":" + descriptors + "}";
|
||||
SendText(message);
|
||||
}
|
||||
|
||||
void Protocol::SendIotStates(const std::string& states) {
|
||||
std::string message = "{\"session_id\":\"" + session_id_ + "\",\"type\":\"iot\",\"states\":" + states + "}";
|
||||
SendText(message);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
virtual void SendStartListening(ListeningMode mode);
|
||||
virtual void SendStopListening();
|
||||
virtual void SendAbortSpeaking(AbortReason reason);
|
||||
virtual void SendIotDescriptors(const std::string& descriptors);
|
||||
virtual void SendIotStates(const std::string& states);
|
||||
|
||||
protected:
|
||||
std::function<void(const cJSON* root)> on_incoming_json_;
|
||||
|
||||
Reference in new issue
Block a user