diff options
-rw-r--r-- | bluetooth/bluetoothmessage.cpp | 13 | ||||
-rw-r--r-- | bluetooth/bluetoothmessage.h | 19 |
2 files changed, 4 insertions, 28 deletions
diff --git a/bluetooth/bluetoothmessage.cpp b/bluetooth/bluetoothmessage.cpp index 9eef02f..52ecbed 100644 --- a/bluetooth/bluetoothmessage.cpp +++ b/bluetooth/bluetoothmessage.cpp @@ -23,15 +23,8 @@ bool BluetoothMessage::createRequest(QString verb, QJsonObject parameter) { - if (m_api_version == "1.0") { - if (!verbs_v1.contains(verb)) - return false; - } + if (!verbs.contains(verb)) + return false; - if (m_api_version == "2.0") { - if (!verbs_v2.contains(verb)) - return false; - } - - return Message::createRequest("Bluetooth-Manager", verb, parameter); + return Message::createRequest("Bluetooth-Manager", verb, parameter); } diff --git a/bluetooth/bluetoothmessage.h b/bluetooth/bluetoothmessage.h index 0a26322..89aef1a 100644 --- a/bluetooth/bluetoothmessage.h +++ b/bluetooth/bluetoothmessage.h @@ -23,23 +23,15 @@ class BluetoothMessage : public Message { Q_OBJECT public: - explicit BluetoothMessage(QString api_version = "1.0", QObject *parent = 0) { m_api_version = api_version; }; - - // Bluetooth API Schema 1.0 bool isConnectionEvent() { return (this->eventName() == "connection"); }; bool isRequestConfirmationEvent() { return (this->eventName() == "request_confirmation"); }; bool isDeviceAddedEvent() { return (this->eventName() == "device_added"); }; bool isDeviceRemovedEvent() { return (this->eventName() == "device_removed"); }; bool isDeviceUpdatedEvent() { return (this->eventName() == "device_updated"); }; - - // Bluetooth API Schema 2.0 - bool isDeviceChangesEvent() { return (this->eventName() == "device_changes"); }; - bool isAgentEvent() { return (this->eventName() == "agent"); }; - bool createRequest(QString verb, QJsonObject parameter); private: - QStringList verbs_v1 { + QStringList verbs { "start_discovery" , "stop_discovery", "power", "remove_device", "pair", "cancel_pair", "connect", "disconnect", "device_priorities", @@ -47,15 +39,6 @@ class BluetoothMessage : public Message "set_avrcp_controls", "send_confirmation", "version", "subscribe", "unsubscribe", }; - - QStringList verbs_v2 { - "connect", "disconnect", "managed_objects", - "adapter_state", "pair", "cancel_pairing", - "confirm_pairing", "remove_device", "version", - "subscribe", "unsubscribe", - }; - - QString m_api_version; }; #endif // BLUETOOTH_MESSAGE_H |