[Bluetooth] Added getServiceAllUuids() call from JS.
authorTomasz Marciniak <t.marciniak@samsung.com>
Mon, 8 Feb 2016 14:30:28 +0000 (15:30 +0100)
committerTomasz Marciniak <t.marciniak@samsung.com>
Thu, 3 Mar 2016 07:52:31 +0000 (08:52 +0100)
[Verification] Code compiles. Unable to test.

Change-Id: I5eae738d4446047e749a60836594b4b90dc6444e
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
src/bluetooth/bluetooth_api.js
src/bluetooth/bluetooth_gatt_service.cc
src/bluetooth/bluetooth_gatt_service.h
src/bluetooth/bluetooth_instance.cc
src/bluetooth/bluetooth_le_device.cc
src/bluetooth/bluetooth_le_device.h

index 5628a8bb04dd1e7fc6cf1a8acedefffc80ff6422..d1eaee4a8851b08c00c65b70f57002e8675a58db 100755 (executable)
@@ -691,6 +691,22 @@ BluetoothLEDevice.prototype.getService = function() {
     }
 };
 
+BluetoothLEDevice.prototype.getServiceAllUuids = function() {
+  console.log('Entered BluetoothLEDevice.getServiceAllUuids()');
+
+  var callArgs = {
+    address : this.address
+  };
+
+  var result = native.callSync('BluetoothLEDevice_getServiceAllUuids', callArgs);
+  if (native.isFailure(result)) {
+    throw native.getErrorObject(result);
+  } else {
+    var uuids = native.getResultObject(result);
+    return uuids;
+  }
+};
+
 BluetoothLEDevice.prototype.addConnectStateChangeListener = function() {
     console.log('Entered BluetoothLEDevice.addConnectStateChangeListener()');
     var args = AV.validateMethod(arguments, [
index 421d5aa092d96bb1a0b203ed57a81184e647c765..fce5b5662817cf4f1234ee6add522ff3291cee94 100755 (executable)
@@ -535,7 +535,7 @@ void BluetoothGATTService::RemoveValueChangeListener(
   }
 }
 
-common::PlatformResult BluetoothGATTService::GetServiceUuids(
+common::PlatformResult BluetoothGATTService::GetServiceAllUuids(
     const std::string& address, picojson::array* array) {
   LoggerD("Entered");
 
index 7fc8f2d2c186940f4224f62b3fd4f4dd1c3b3614..e6936a61a3a114a1f6ed3f3384578556a878c1e4 100755 (executable)
@@ -48,8 +48,8 @@ class BluetoothGATTService {
   void RemoveValueChangeListener(const picojson::value& args,
                                  picojson::object& out);
 
-  common::PlatformResult GetServiceUuids(const std::string& address,
-                                         picojson::array* array);
+  common::PlatformResult GetServiceAllUuids(const std::string& address,
+                                            picojson::array* array);
 
  private:
   bool IsStillConnected(const std::string& address);
index a0c5de9218a0b284654751b831301886d6b5eac0..16a2f5aaf4b6896de20f32480027e1c88c334b7e 100755 (executable)
@@ -143,8 +143,8 @@ BluetoothInstance::BluetoothInstance() :
       std::bind(&BluetoothLEDevice::RemoveConnectStateChangeListener,
                 &bluetooth_le_device_, _1, _2));
   REGISTER_SYNC(
-        "BluetoothLEDevice_getServiceUuids",
-        std::bind(&BluetoothLEDevice::GetServiceUuids,
+        "BluetoothLEDevice_getServiceAllUuids",
+        std::bind(&BluetoothLEDevice::GetServiceAllUuids,
                   &bluetooth_le_device_, _1, _2));
 
   // BluetoothGATTService
index 24037505fe7965e69d6de320637be59d46c21949..78047a08bd51f0877cb9177440060f0b586487b0 100755 (executable)
@@ -439,7 +439,7 @@ void BluetoothLEDevice::RemoveConnectStateChangeListener(
   ReportSuccess(out);
 }
 
-void BluetoothLEDevice::GetServiceUuids(const picojson::value& data,
+void BluetoothLEDevice::GetServiceAllUuids(const picojson::value& data,
                                         picojson::object& out) {
   LoggerD("Entered");
 
@@ -449,7 +449,7 @@ void BluetoothLEDevice::GetServiceUuids(const picojson::value& data,
   picojson::value response = picojson::value(picojson::array());
   picojson::array *data_obj = &response.get<picojson::array>();
 
-  PlatformResult result = service_.GetServiceUuids(address, data_obj);
+  PlatformResult result = service_.GetServiceAllUuids(address, data_obj);
 
   if (result) {
     ReportSuccess(response, out);
index f95cab041bf6e468baaf5e61a9fe23c60b05920b..ed122f143894821fb78c74d83d99f2db97bdfce1 100755 (executable)
@@ -47,7 +47,7 @@ class BluetoothLEDevice {
   void RemoveConnectStateChangeListener(const picojson::value& data,
                                         picojson::object& out);
 
-  void GetServiceUuids(const picojson::value& data, picojson::object& out);
+  void GetServiceAllUuids(const picojson::value& data, picojson::object& out);
 
   static common::PlatformResult ToJson(
       bt_adapter_le_device_scan_result_info_s* info,