From 5a25c241bbeb6df51cc268cc2e3f064d58c224e2 Mon Sep 17 00:00:00 2001 From: Dawid Juszczak Date: Wed, 22 Jul 2020 18:11:06 +0200 Subject: [PATCH] [Bluetooth] Rename BluetoothGATTService to BluetoothGATTClientService [Verification] Each method implemented by BluetoothGATTClientService was called in Chrome Dev Tools. All auto Bluetooth and manual BLE tests pass. Change-Id: I530e94aa40b294d43525aed50c9a19dde3c2a1c4 Signed-off-by: Dawid Juszczak Signed-off-by: Pawel Wasowski --- src/bluetooth/bluetooth.gyp | 4 +- src/bluetooth/bluetooth_api.js | 16 +++---- ...ce.cc => bluetooth_gatt_client_service.cc} | 46 +++++++++---------- ...vice.h => bluetooth_gatt_client_service.h} | 14 +++--- src/bluetooth/bluetooth_instance.cc | 40 ++++++++-------- src/bluetooth/bluetooth_instance.h | 16 +++---- src/bluetooth/bluetooth_le_device.cc | 4 +- src/bluetooth/bluetooth_le_device.h | 6 +-- src/bluetooth/uuid.h | 2 +- 9 files changed, 74 insertions(+), 74 deletions(-) rename src/bluetooth/{bluetooth_gatt_service.cc => bluetooth_gatt_client_service.cc} (92%) rename src/bluetooth/{bluetooth_gatt_service.h => bluetooth_gatt_client_service.h} (86%) diff --git a/src/bluetooth/bluetooth.gyp b/src/bluetooth/bluetooth.gyp index 73df5d3f..f99eb6b7 100644 --- a/src/bluetooth/bluetooth.gyp +++ b/src/bluetooth/bluetooth.gyp @@ -33,8 +33,8 @@ 'bluetooth_le_adapter.h', 'bluetooth_service_handler.cc', 'bluetooth_service_handler.h', - 'bluetooth_gatt_service.cc', - 'bluetooth_gatt_service.h', + 'bluetooth_gatt_client_service.cc', + 'bluetooth_gatt_client_service.h', 'bluetooth_socket.cc', 'bluetooth_socket.h', 'bluetooth_util.cc', diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 37799e00..df42559a 100755 --- a/src/bluetooth/bluetooth_api.js +++ b/src/bluetooth/bluetooth_api.js @@ -1621,7 +1621,7 @@ var BluetoothGATTService = function(data, address) { var address_ = address || data.address; function servicesGetter() { var services = []; - var result = native.callSync('BluetoothGATTServiceGetServices', { + var result = native.callSync('BluetoothGATTClientServiceGetServices', { handle: handle_, address: address_ }); @@ -1635,7 +1635,7 @@ var BluetoothGATTService = function(data, address) { } function characteristicsGetter() { var characteristics = []; - var result = native.callSync('BluetoothGATTServiceGetCharacteristics', { + var result = native.callSync('BluetoothGATTClientServiceGetCharacteristics', { handle: handle_, uuid: serviceUuid_, address: address_ @@ -1790,7 +1790,7 @@ var BluetoothGATTCharacteristic = function(data, address) { var callArgs = { handle: handle_, address: address_ }; - var result = native.call('BluetoothGATTServiceReadValue', callArgs, callback); + var result = native.call('BluetoothGATTClientServiceReadValue', callArgs, callback); if (native.isFailure(result)) { throw native.getErrorObject(result); @@ -1828,7 +1828,7 @@ var BluetoothGATTCharacteristic = function(data, address) { address: address_ }; - var result = native.call('BluetoothGATTServiceWriteValue', callArgs, callback); + var result = native.call('BluetoothGATTClientServiceWriteValue', callArgs, callback); if (native.isFailure(result)) { throw native.getErrorObject(result); @@ -1985,8 +1985,8 @@ var _bluetoothGATTCharacteristicListener = _multipleListenerBuilder( function(listener, event) { listener(event); }, - 'BluetoothGATTServiceAddValueChangeListener', - 'BluetoothGATTServiceRemoveValueChangeListener', + 'BluetoothGATTClientServiceAddValueChangeListener', + 'BluetoothGATTClientServiceRemoveValueChangeListener', true ); @@ -2032,7 +2032,7 @@ var BluetoothGATTDescriptor = function(data, address) { var callArgs = { handle: handle_, address: address_ }; - var result = native.call('BluetoothGATTServiceReadValue', callArgs, callback); + var result = native.call('BluetoothGATTClientServiceReadValue', callArgs, callback); if (native.isFailure(result)) { throw native.getErrorObject(result); @@ -2070,7 +2070,7 @@ var BluetoothGATTDescriptor = function(data, address) { address: address_ }; - var result = native.call('BluetoothGATTServiceWriteValue', callArgs, callback); + var result = native.call('BluetoothGATTClientServiceWriteValue', callArgs, callback); if (native.isFailure(result)) { throw native.getErrorObject(result); diff --git a/src/bluetooth/bluetooth_gatt_service.cc b/src/bluetooth/bluetooth_gatt_client_service.cc similarity index 92% rename from src/bluetooth/bluetooth_gatt_service.cc rename to src/bluetooth/bluetooth_gatt_client_service.cc index ca74a240..1be096c8 100644 --- a/src/bluetooth/bluetooth_gatt_service.cc +++ b/src/bluetooth/bluetooth_gatt_client_service.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "bluetooth/bluetooth_gatt_service.h" +#include "bluetooth/bluetooth_gatt_client_service.h" #include @@ -59,11 +59,11 @@ bool IsProperty(int propertyBits, bt_gatt_property_e property) { } } -BluetoothGATTService::BluetoothGATTService(BluetoothInstance& instance) : instance_(instance) { +BluetoothGATTClientService::BluetoothGATTClientService(BluetoothInstance& instance) : instance_(instance) { ScopeLogger(); } -BluetoothGATTService::~BluetoothGATTService() { +BluetoothGATTClientService::~BluetoothGATTClientService() { ScopeLogger(); for (auto it : gatt_characteristic_) { @@ -77,12 +77,12 @@ BluetoothGATTService::~BluetoothGATTService() { } } -bool BluetoothGATTService::IsStillConnected(const std::string& address) { +bool BluetoothGATTClientService::IsStillConnected(const std::string& address) { auto it = gatt_clients_.find(address); return gatt_clients_.end() != it; } -bt_gatt_client_h BluetoothGATTService::GetGattClient(const std::string& address) { +bt_gatt_client_h BluetoothGATTClientService::GetGattClient(const std::string& address) { ScopeLogger(); bt_gatt_client_h client = nullptr; @@ -105,7 +105,7 @@ bt_gatt_client_h BluetoothGATTService::GetGattClient(const std::string& address) } // this method should be used to inform this object that some device was disconnected -void BluetoothGATTService::TryDestroyClient(const std::string& address) { +void BluetoothGATTClientService::TryDestroyClient(const std::string& address) { ScopeLogger(); auto it = gatt_clients_.find(address); if (gatt_clients_.end() != it) { @@ -117,7 +117,7 @@ void BluetoothGATTService::TryDestroyClient(const std::string& address) { } } -PlatformResult BluetoothGATTService::GetSpecifiedGATTService(const std::string& address, +PlatformResult BluetoothGATTClientService::GetSpecifiedGATTClient(const std::string& address, const UUID& uuid, picojson::object* result) { ScopeLogger(); @@ -153,7 +153,7 @@ PlatformResult BluetoothGATTService::GetSpecifiedGATTService(const std::string& /* * BACKWARD COMPATIBILITY * - * BluetoothGATTService::uuid has always been set to source format in this + * BluetoothGATTClientService::uuid has always been set to source format in this * function. */ result->insert(std::make_pair(kUuid, picojson::value(uuid.uuid_in_source_format))); @@ -165,7 +165,7 @@ PlatformResult BluetoothGATTService::GetSpecifiedGATTService(const std::string& return PlatformResult(ErrorCode::NO_ERROR); } -void BluetoothGATTService::GetServices(const picojson::value& args, picojson::object& out) { +void BluetoothGATTClientService::GetServices(const picojson::value& args, picojson::object& out) { ScopeLogger(); bt_gatt_h handle = (bt_gatt_h) static_cast(args.get("handle").get()); @@ -180,7 +180,7 @@ void BluetoothGATTService::GetServices(const picojson::value& args, picojson::ob } } -PlatformResult BluetoothGATTService::GetServicesHelper(bt_gatt_h handle, const std::string& address, +PlatformResult BluetoothGATTClientService::GetServicesHelper(bt_gatt_h handle, const std::string& address, picojson::array* array) { ScopeLogger(); @@ -227,7 +227,7 @@ PlatformResult BluetoothGATTService::GetServicesHelper(bt_gatt_h handle, const s return PlatformResult(ErrorCode::NO_ERROR); } -void BluetoothGATTService::GetCharacteristics(const picojson::value& args, picojson::object& out) { +void BluetoothGATTClientService::GetCharacteristics(const picojson::value& args, picojson::object& out) { ScopeLogger(); bt_gatt_h handle = (bt_gatt_h) static_cast(args.get("handle").get()); @@ -243,7 +243,7 @@ void BluetoothGATTService::GetCharacteristics(const picojson::value& args, picoj } } -PlatformResult BluetoothGATTService::GetCharacteristicsHelper(bt_gatt_h handle, +PlatformResult BluetoothGATTClientService::GetCharacteristicsHelper(bt_gatt_h handle, const std::string& address, picojson::array* array) { ScopeLogger(); @@ -361,7 +361,7 @@ PlatformResult BluetoothGATTService::GetCharacteristicsHelper(bt_gatt_h handle, return PlatformResult(ErrorCode::NO_ERROR); } -void BluetoothGATTService::ReadValue(const picojson::value& args, picojson::object& out) { +void BluetoothGATTClientService::ReadValue(const picojson::value& args, picojson::object& out) { ScopeLogger(); CHECK_BACKWARD_COMPABILITY_PRIVILEGE_ACCESS(Privilege::kBluetooth, Privilege::kBluetoothAdmin, &out); @@ -376,7 +376,7 @@ void BluetoothGATTService::ReadValue(const picojson::value& args, picojson::obje const double callback_handle = util::GetAsyncCallbackHandle(args); struct Data { double callback_handle; - BluetoothGATTService* service; + BluetoothGATTClientService* service; }; Data* user_data = new Data{callback_handle, this}; @@ -386,7 +386,7 @@ void BluetoothGATTService::ReadValue(const picojson::value& args, picojson::obje ScopeLogger("Entered into asynchronous function, read_value"); Data* data = static_cast(user_data); double callback_handle = data->callback_handle; - BluetoothGATTService* service = data->service; + BluetoothGATTClientService* service = data->service; delete data; PlatformResult plarform_res = PlatformResult(ErrorCode::NO_ERROR); @@ -435,7 +435,7 @@ void BluetoothGATTService::ReadValue(const picojson::value& args, picojson::obje ReportSuccess(out); } -void BluetoothGATTService::WriteValue(const picojson::value& args, picojson::object& out) { +void BluetoothGATTClientService::WriteValue(const picojson::value& args, picojson::object& out) { ScopeLogger(); CHECK_BACKWARD_COMPABILITY_PRIVILEGE_ACCESS(Privilege::kBluetooth, Privilege::kBluetoothAdmin, &out); @@ -458,7 +458,7 @@ void BluetoothGATTService::WriteValue(const picojson::value& args, picojson::obj struct Data { double callback_handle; - BluetoothGATTService* service; + BluetoothGATTClientService* service; }; bt_gatt_h handle = (bt_gatt_h) static_cast(args.get("handle").get()); @@ -467,7 +467,7 @@ void BluetoothGATTService::WriteValue(const picojson::value& args, picojson::obj ScopeLogger("Entered into asynchronous function, write_value"); Data* data = static_cast(user_data); double callback_handle = data->callback_handle; - BluetoothGATTService* service = data->service; + BluetoothGATTClientService* service = data->service; delete data; PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR); @@ -513,7 +513,7 @@ void BluetoothGATTService::WriteValue(const picojson::value& args, picojson::obj ReportSuccess(out); } -void BluetoothGATTService::AddValueChangeListener(const picojson::value& args, +void BluetoothGATTClientService::AddValueChangeListener(const picojson::value& args, picojson::object& out) { ScopeLogger(); const auto& address = args.get("address").get(); @@ -537,7 +537,7 @@ void BluetoothGATTService::AddValueChangeListener(const picojson::value& args, } } -void BluetoothGATTService::RemoveValueChangeListener(const picojson::value& args, +void BluetoothGATTClientService::RemoveValueChangeListener(const picojson::value& args, picojson::object& out) { ScopeLogger(); const auto& address = args.get("address").get(); @@ -560,7 +560,7 @@ void BluetoothGATTService::RemoveValueChangeListener(const picojson::value& args ReportSuccess(out); } -common::PlatformResult BluetoothGATTService::GetServiceAllUuids(const std::string& address, +common::PlatformResult BluetoothGATTClientService::GetServiceAllUuids(const std::string& address, picojson::array* array) { ScopeLogger(); @@ -605,12 +605,12 @@ common::PlatformResult BluetoothGATTService::GetServiceAllUuids(const std::strin } } -void BluetoothGATTService::OnCharacteristicValueChanged(bt_gatt_h characteristic, char* value, +void BluetoothGATTClientService::OnCharacteristicValueChanged(bt_gatt_h characteristic, char* value, int length, void* user_data) { ScopeLogger("characteristic: [%p], len: [%d], user_data: [%p]", characteristic, length, user_data); - auto service = static_cast(user_data); + auto service = static_cast(user_data); if (!service) { LoggerE("user_data is NULL"); diff --git a/src/bluetooth/bluetooth_gatt_service.h b/src/bluetooth/bluetooth_gatt_client_service.h similarity index 86% rename from src/bluetooth/bluetooth_gatt_service.h rename to src/bluetooth/bluetooth_gatt_client_service.h index d4e5446f..72328686 100644 --- a/src/bluetooth/bluetooth_gatt_service.h +++ b/src/bluetooth/bluetooth_gatt_client_service.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ -#define BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ +#ifndef BLUETOOTH_BLUETOOTH_GATT_CLIENT_SERVICE_H_ +#define BLUETOOTH_BLUETOOTH_GATT_CLIENT_SERVICE_H_ #include @@ -30,12 +30,12 @@ namespace bluetooth { class BluetoothInstance; -class BluetoothGATTService { +class BluetoothGATTClientService { public: - BluetoothGATTService(BluetoothInstance& instance); - ~BluetoothGATTService(); + BluetoothGATTClientService(BluetoothInstance& instance); + ~BluetoothGATTClientService(); - common::PlatformResult GetSpecifiedGATTService(const std::string& address, const UUID& uuid, + common::PlatformResult GetSpecifiedGATTClient(const std::string& address, const UUID& uuid, picojson::object* result); void TryDestroyClient(const std::string& address); @@ -70,4 +70,4 @@ class BluetoothGATTService { } // namespace bluetooth } // namespace extension -#endif // BLUETOOTH_BLUETOOTH_GATT_SERVICE_H_ +#endif // BLUETOOTH_BLUETOOTH_GATT_CLIENT_SERVICE_H_ diff --git a/src/bluetooth/bluetooth_instance.cc b/src/bluetooth/bluetooth_instance.cc index 2ff079ea..91fb4885 100644 --- a/src/bluetooth/bluetooth_instance.cc +++ b/src/bluetooth/bluetooth_instance.cc @@ -35,8 +35,8 @@ BluetoothInstance::BluetoothInstance() bluetooth_service_handler_(bluetooth_adapter_), bluetooth_socket_(bluetooth_adapter_), bluetooth_le_adapter_(*this), - bluetooth_gatt_service_(*this), - bluetooth_le_device_(*this, bluetooth_gatt_service_), + bluetooth_gatt_client_service_(*this), + bluetooth_le_device_(*this, bluetooth_gatt_client_service_), worker(), bluetooth_gatt_server_(*this) { ScopeLogger(); @@ -93,12 +93,12 @@ BluetoothInstance::BluetoothInstance() REGISTER_METHOD(BluetoothLEDeviceRemoveConnectStateChangeListener); REGISTER_METHOD(BluetoothLEDeviceGetServiceAllUuids); - REGISTER_METHOD(BluetoothGATTServiceGetServices); - REGISTER_METHOD(BluetoothGATTServiceGetCharacteristics); - REGISTER_METHOD(BluetoothGATTServiceReadValue); - REGISTER_METHOD(BluetoothGATTServiceWriteValue); - REGISTER_METHOD(BluetoothGATTServiceAddValueChangeListener); - REGISTER_METHOD(BluetoothGATTServiceRemoveValueChangeListener); + REGISTER_METHOD(BluetoothGATTClientServiceGetServices); + REGISTER_METHOD(BluetoothGATTClientServiceGetCharacteristics); + REGISTER_METHOD(BluetoothGATTClientServiceReadValue); + REGISTER_METHOD(BluetoothGATTClientServiceWriteValue); + REGISTER_METHOD(BluetoothGATTClientServiceAddValueChangeListener); + REGISTER_METHOD(BluetoothGATTClientServiceRemoveValueChangeListener); REGISTER_METHOD(BluetoothGATTServerStart); REGISTER_METHOD(BluetoothGATTServerStop); @@ -406,40 +406,40 @@ void BluetoothInstance::BluetoothLEDeviceGetServiceAllUuids(const picojson::valu bluetooth_le_device_.GetServiceAllUuids(args, out); } -void BluetoothInstance::BluetoothGATTServiceGetServices(const picojson::value& args, +void BluetoothInstance::BluetoothGATTClientServiceGetServices(const picojson::value& args, picojson::object& out) { ScopeLogger(); - bluetooth_gatt_service_.GetServices(args, out); + bluetooth_gatt_client_service_.GetServices(args, out); } -void BluetoothInstance::BluetoothGATTServiceGetCharacteristics(const picojson::value& args, +void BluetoothInstance::BluetoothGATTClientServiceGetCharacteristics(const picojson::value& args, picojson::object& out) { ScopeLogger(); - bluetooth_gatt_service_.GetCharacteristics(args, out); + bluetooth_gatt_client_service_.GetCharacteristics(args, out); } -void BluetoothInstance::BluetoothGATTServiceReadValue(const picojson::value& args, +void BluetoothInstance::BluetoothGATTClientServiceReadValue(const picojson::value& args, picojson::object& out) { ScopeLogger(); - bluetooth_gatt_service_.ReadValue(args, out); + bluetooth_gatt_client_service_.ReadValue(args, out); } -void BluetoothInstance::BluetoothGATTServiceWriteValue(const picojson::value& args, +void BluetoothInstance::BluetoothGATTClientServiceWriteValue(const picojson::value& args, picojson::object& out) { ScopeLogger(); - bluetooth_gatt_service_.WriteValue(args, out); + bluetooth_gatt_client_service_.WriteValue(args, out); } -void BluetoothInstance::BluetoothGATTServiceAddValueChangeListener(const picojson::value& args, +void BluetoothInstance::BluetoothGATTClientServiceAddValueChangeListener(const picojson::value& args, picojson::object& out) { ScopeLogger(); - bluetooth_gatt_service_.AddValueChangeListener(args, out); + bluetooth_gatt_client_service_.AddValueChangeListener(args, out); } -void BluetoothInstance::BluetoothGATTServiceRemoveValueChangeListener(const picojson::value& args, +void BluetoothInstance::BluetoothGATTClientServiceRemoveValueChangeListener(const picojson::value& args, picojson::object& out) { ScopeLogger(); - bluetooth_gatt_service_.RemoveValueChangeListener(args, out); + bluetooth_gatt_client_service_.RemoveValueChangeListener(args, out); } void BluetoothInstance::BluetoothGATTServerStart(const picojson::value& args, diff --git a/src/bluetooth/bluetooth_instance.h b/src/bluetooth/bluetooth_instance.h index 0ee235df..48ac8d0a 100644 --- a/src/bluetooth/bluetooth_instance.h +++ b/src/bluetooth/bluetooth_instance.h @@ -22,7 +22,7 @@ #include "bluetooth/bluetooth_adapter.h" #include "bluetooth/bluetooth_device.h" #include "bluetooth/bluetooth_gatt_server.h" -#include "bluetooth/bluetooth_gatt_service.h" +#include "bluetooth/bluetooth_gatt_client_service.h" #include "bluetooth/bluetooth_health_application.h" #include "bluetooth/bluetooth_health_channel.h" #include "bluetooth/bluetooth_health_profile_handler.h" @@ -100,13 +100,13 @@ class BluetoothInstance : public common::ParsedInstance { picojson::object& out); void BluetoothLEDeviceGetServiceAllUuids(const picojson::value& args, picojson::object& out); - void BluetoothGATTServiceGetServices(const picojson::value& args, picojson::object& out); - void BluetoothGATTServiceGetCharacteristics(const picojson::value& args, picojson::object& out); - void BluetoothGATTServiceReadValue(const picojson::value& args, picojson::object& out); - void BluetoothGATTServiceWriteValue(const picojson::value& args, picojson::object& out); - void BluetoothGATTServiceAddValueChangeListener(const picojson::value& args, + void BluetoothGATTClientServiceGetServices(const picojson::value& args, picojson::object& out); + void BluetoothGATTClientServiceGetCharacteristics(const picojson::value& args, picojson::object& out); + void BluetoothGATTClientServiceReadValue(const picojson::value& args, picojson::object& out); + void BluetoothGATTClientServiceWriteValue(const picojson::value& args, picojson::object& out); + void BluetoothGATTClientServiceAddValueChangeListener(const picojson::value& args, picojson::object& out); - void BluetoothGATTServiceRemoveValueChangeListener(const picojson::value& args, + void BluetoothGATTClientServiceRemoveValueChangeListener(const picojson::value& args, picojson::object& out); void BluetoothGATTServerStart(const picojson::value& args, picojson::object& out); void BluetoothGATTServerStop(const picojson::value& args, picojson::object& out); @@ -119,7 +119,7 @@ class BluetoothInstance : public common::ParsedInstance { BluetoothServiceHandler bluetooth_service_handler_; BluetoothSocket bluetooth_socket_; BluetoothLEAdapter bluetooth_le_adapter_; - BluetoothGATTService bluetooth_gatt_service_; + BluetoothGATTClientService bluetooth_gatt_client_service_; BluetoothLEDevice bluetooth_le_device_; common::Worker worker; // If all operations on bluetooth_gatt_server_ will be done by the worker, diff --git a/src/bluetooth/bluetooth_le_device.cc b/src/bluetooth/bluetooth_le_device.cc index 413a3059..bbcf715f 100644 --- a/src/bluetooth/bluetooth_le_device.cc +++ b/src/bluetooth/bluetooth_le_device.cc @@ -55,7 +55,7 @@ const std::string kOnDisconnected = "ondisconnected"; const std::string kConnectChangeEvent = "BluetoothLEConnectChangeCallback"; } -BluetoothLEDevice::BluetoothLEDevice(BluetoothInstance& instance, BluetoothGATTService& service) +BluetoothLEDevice::BluetoothLEDevice(BluetoothInstance& instance, BluetoothGATTClientService& service) : instance_(instance), service_(service), is_listener_set_(false) { ScopeLogger(); int ret = bt_gatt_set_connection_state_changed_cb(GattConnectionState, this); @@ -393,7 +393,7 @@ void BluetoothLEDevice::GetService(const picojson::value& data, picojson::object picojson::value response = picojson::value(picojson::object()); picojson::object* data_obj = &response.get(); - PlatformResult result = service_.GetSpecifiedGATTService(address, *uuid, data_obj); + PlatformResult result = service_.GetSpecifiedGATTClient(address, *uuid, data_obj); if (result.IsError()) { LogAndReportError(result, &out); diff --git a/src/bluetooth/bluetooth_le_device.h b/src/bluetooth/bluetooth_le_device.h index 25d0f5fc..99f42aae 100644 --- a/src/bluetooth/bluetooth_le_device.h +++ b/src/bluetooth/bluetooth_le_device.h @@ -22,7 +22,7 @@ #include #include -#include "bluetooth/bluetooth_gatt_service.h" +#include "bluetooth/bluetooth_gatt_client_service.h" #include "bluetooth/uuid.h" #include "common/picojson.h" @@ -35,7 +35,7 @@ class BluetoothInstance; class BluetoothLEDevice { public: - explicit BluetoothLEDevice(BluetoothInstance& instance, BluetoothGATTService& service); + explicit BluetoothLEDevice(BluetoothInstance& instance, BluetoothGATTClientService& service); ~BluetoothLEDevice(); void Connect(const picojson::value& data, picojson::object& out); @@ -60,7 +60,7 @@ class BluetoothLEDevice { void CleanClientInfo(const char* remote_address); void TriggerConnectStateChangeListener(const char* remote_address, bool connected); BluetoothInstance& instance_; - BluetoothGATTService& service_; + BluetoothGATTClientService& service_; std::unordered_map connecting_; bool is_listener_set_; std::set is_connected_; diff --git a/src/bluetooth/uuid.h b/src/bluetooth/uuid.h index ac08c153..35f30d9b 100644 --- a/src/bluetooth/uuid.h +++ b/src/bluetooth/uuid.h @@ -90,7 +90,7 @@ struct UUID { * work in the following manner: * 1. the user passes them a UUID, in any acceptable format, e.g.: "aBcD" * 2. the function performs requested operations using the passed UUID - * 3. the function creates an object, e.g. BlueoothGATTService, with the UUID + * 3. the function creates an object, e.g. BluetoothGATTClientService, with the UUID * passed by the user. * * As user may expect an identical UUID in the created object, identical to -- 2.34.1