Merge branch 'tizen_5.0' into tizen_5.5 69/244469/2
authorPiotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Fri, 18 Sep 2020 12:55:00 +0000 (14:55 +0200)
committerPiotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Fri, 18 Sep 2020 13:36:36 +0000 (15:36 +0200)
Change-Id: Id032af991b0670d09d5ff35aa4c142669cd26959

1  2 
packaging/webapi-plugins.spec
src/bluetooth/bluetooth_gatt_service.cc
src/common/tools.cc
src/common/tools.h

@@@ -6,11 -6,9 +6,11 @@@
  %define crosswalk_extensions tizen-extensions-crosswalk
  
  %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
 +%define tizen_ut_build 0
 +
  
  Name:       webapi-plugins
- Version:    2.65
 -Version:    2.50
++Version:    2.66
  Release:    0
  License:    Apache-2.0 and BSD-3-Clause and MIT
  Group:      Development/Libraries
@@@ -513,24 -514,29 +514,25 @@@ void BluetoothGATTService::RemoveValueC
    ScopeLogger();
    const auto& address = args.get("address").get<std::string>();
    if (!IsStillConnected(address)) {
 -    LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR, "Device is not connected"), &out,
 -                      ("Device with address %s is no longer connected", address.c_str()));
 -    return;
 -  }
 -
 -  bt_gatt_h handle = (bt_gatt_h) static_cast<long>(args.get(kHandle).get<double>());
 +    LoggerW("Device with address %s is no longer connected", address.c_str());
 +  } else {
 +    bt_gatt_h handle = (bt_gatt_h) static_cast<long>(args.get(kHandle).get<double>());
  
 -  int ret = bt_gatt_client_unset_characteristic_value_changed_cb(handle);
 +    int ret = bt_gatt_client_unset_characteristic_value_changed_cb(handle);
  
 -  if (BT_ERROR_NONE != ret) {
 -    LogAndReportError(
 -        util::GetBluetoothError(ret, "Failed to unregister listener"), &out,
 -        ("bt_gatt_client_unset_characteristic_value_changed_cb() failed with: %d (%s)", ret,
 -         get_error_message(ret)));
 -  } else {
 -    gatt_characteristic_.erase(
 -        std::remove(gatt_characteristic_.begin(), gatt_characteristic_.end(), handle),
 -        gatt_characteristic_.end());
 -    ReportSuccess(out);
 +    if (BT_ERROR_NONE != ret) {
 +      LoggerW("bt_gatt_client_unset_characteristic_value_changed_cb() failed with: %d (%s)", ret,
 +              get_error_message(ret));
 +    } else {
 +      gatt_characteristic_.erase(
 +          std::remove(gatt_characteristic_.begin(), gatt_characteristic_.end(), handle),
 +          gatt_characteristic_.end());
 +    }
    }
 +  ReportSuccess(out);
  }
  
+ /// copied from 6.0
  common::PlatformResult BluetoothGATTService::GetServiceAllUuids(const std::string& address,
                                                                  picojson::array* array) {
    ScopeLogger();
@@@ -579,16 -579,11 +579,22 @@@ PlatformResult CheckFileAvailability(co
    return CheckFileStatus(path);
  }
  
 +void PrintDeprecationWarningFor(const char* className, const char* replacement) {
 +  if (nullptr == replacement) {
 +    LoggerW("DEPRECATION WARNING: %s is deprecated and using it is not recommended.", className);
 +  } else {
 +    LoggerW(
 +        "DEPRECATION WARNING: %s is deprecated and using it is not recommended. Try using %s "
 +        "instead",
 +        className, replacement);
 +  }
 +}
 +
+ std::string ConvertToLowerCase(const std::string& input_string) {
+   std::string output_string = input_string;
+   std::transform(output_string.begin(), output_string.end(), output_string.begin(), ::tolower);
+   return output_string;
+ }
  }  // namespace tools
  }  // namespace common
@@@ -117,7 -117,7 +117,8 @@@ PlatformResult CheckFileStatus(const st
  
  PlatformResult CheckFileAvailability(const std::string& path);
  
 +void PrintDeprecationWarningFor(const char* className, const char* replacement = nullptr);
+ std::string ConvertToLowerCase(const std::string& input_string);
  
  }  // namespace tools
  }  // namespace common