2 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <QJsonDocument>
22 #include <QtCore/QJsonObject>
23 #include <libsoundmanager/libsoundmanager.hpp>
28 class LibSMWrapper : public QObject
32 explicit LibSMWrapper(QObject *parent = nullptr);
33 LibSMWrapper(const int port, const QString& token, QObject *parent = nullptr);
36 void wrapper_registerCallback(
37 void (*event_func)(const std::string& event, struct json_object* event_contents),
38 void (*reply_func)(struct json_object* reply_contents)
40 void subscribe(const QString event_name);
41 void unsubscribe(const QString event_name);
44 void emit_event(const QString &event, const QJsonObject &msg);
45 void emit_reply(const QJsonObject &msg);
47 int call(const QString &verb, const QString &arg);
48 void print(const QString &str);
50 void smEvent(const QVariant &event, const QVariant &msg);
51 void smReply(const QVariant &msg);
54 LibSoundmanager* libsm;