summaryrefslogtreecommitdiffstats
path: root/bluetooth/bluetoothmessage.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-09-24 16:21:12 +0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-09-25 08:11:46 +0800
commitdaadd6ca0e572fe55d307ff034d8cd3342c1c7c1 (patch)
tree44e1afd05e8d5accb179a8c0373eda6239ead393 /bluetooth/bluetoothmessage.cpp
parent04a093de6b41821211aa16bb031ca37ac9745bc1 (diff)
libqtappfw: bluetooth: add initial API versioning to BluetoothMessage
Future rewrite of the Bluetooth binding will have different schema for accessible verbs. Allow clients and middleware to explictly request a version. Bug-AGL: SPEC-1736 Change-Id: I488836a7422aac85b19815d837dabb5230ee47f8 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'bluetooth/bluetoothmessage.cpp')
-rw-r--r--bluetooth/bluetoothmessage.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/bluetooth/bluetoothmessage.cpp b/bluetooth/bluetoothmessage.cpp
index 52ecbed..d31705c 100644
--- a/bluetooth/bluetoothmessage.cpp
+++ b/bluetooth/bluetoothmessage.cpp
@@ -23,8 +23,11 @@
bool BluetoothMessage::createRequest(QString verb, QJsonObject parameter)
{
- if (!verbs.contains(verb))
- return false;
+ if (m_api_version != "1.0")
+ return false;
- return Message::createRequest("Bluetooth-Manager", verb, parameter);
+ if (!verbs_v1.contains(verb))
+ return false;
+
+ return Message::createRequest("Bluetooth-Manager", verb, parameter);
}