[Bluetooth] Resolved TODOs
authorPiotr Kosko <p.kosko@samsung.com>
Wed, 7 Oct 2015 09:12:36 +0000 (11:12 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Wed, 7 Oct 2015 09:12:40 +0000 (11:12 +0200)
[Verification] TCT passrate 100%.

Change-Id: I83a24ddb2d5b018f8c5b26cd0413b0e28256530a
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
src/bluetooth/bluetooth_adapter.cc
src/bluetooth/bluetooth_api.js
src/bluetooth/bluetooth_le_adapter.cc

index de2679fbf37e77ed58fcba84b49b14973e004403..e9a3b6627329d729ca116a62fe000cb69546925c 100755 (executable)
@@ -300,7 +300,6 @@ void BluetoothAdapter::DiscoveryStateChangedCB(
 
           data_obj->insert(std::make_pair(kData, picojson::value(adapter->discovered_devices_)));
 
-          //TODO Consider if all events during scanning shouldn't be called asynchronously
           adapter->user_request_list_[DISCOVER_DEVICES] = false;
           adapter->instance_.FireEvent(kAdapterDiscoverSuccessEvent, value);
         }
index 4ed275c4a1f608a40a8b666a424d302c22fb3f40..36e8fbec6c3cac3d6c393530afad91944b2eb927 100755 (executable)
@@ -633,7 +633,7 @@ BluetoothLEDevice.prototype.connect = function() {
             native.callIfPossible(args.successCallback);
         }
     };
-
+    // Errors are handled by error callback
     native.call('BluetoothLEDevice_connect', {address : this.address}, callback);
 };
 
@@ -930,7 +930,7 @@ BluetoothServiceHandler.prototype.unregister = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothServiceHandler_unregister', callArgs, callback);
 
     _bluetoothServiceListeners.removeListener(this.uuid);
@@ -1025,7 +1025,7 @@ BluetoothHealthApplication.prototype.unregister = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothHealthApplication_unregister', callArgs, callback);
 
     _bluetoothHealthApplicationListeners.removeListener(this._id);
@@ -1092,7 +1092,7 @@ BluetoothHealthProfileHandler.prototype.registerSinkApplication = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothHealthProfileHandler_registerSinkApp', callArgs, callback);
 };
 
@@ -1140,7 +1140,7 @@ BluetoothHealthProfileHandler.prototype.connectToSource = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothHealthProfileHandler_connectToSource', callArgs, callback);
 };
 
@@ -1477,12 +1477,10 @@ BluetoothLEAdapter.prototype.stopAdvertise = function() {
 
   xwalk.utils.checkPrivilegeAccess4Ver("2.4", Privilege.BLUETOOTH, Privilege.BLUETOOTH_ADMIN);
 
-  // TODO: when should we call _bleAdvertiseListener.removeListener()?
-
+  _bleAdvertiseListener.removeListener();
   var result = native.callSync('BluetoothLEAdapter_stopAdvertise', {});
 
   if (native.isFailure(result)) {
-    _bleAdvertiseListener.removeListener();
     throw native.getErrorObject(result);
   }
 };
@@ -2031,7 +2029,7 @@ BluetoothAdapter.prototype.setName = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_setName', callArgs, callback);
 };
 
@@ -2071,7 +2069,7 @@ BluetoothAdapter.prototype.setPowered = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_setPowered', callArgs, callback);
 };
 
@@ -2127,7 +2125,7 @@ BluetoothAdapter.prototype.setVisible = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_setVisible', callArgs, callback);
 };
 
@@ -2300,7 +2298,7 @@ BluetoothAdapter.prototype.stopDiscovery = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_stopDiscovery', {}, callback);
 };
 
@@ -2335,7 +2333,7 @@ BluetoothAdapter.prototype.getKnownDevices = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_getKnownDevices', {}, callback);
 };
 
@@ -2369,7 +2367,7 @@ BluetoothAdapter.prototype.getDevice = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_getDevice', {address : args.address}, callback);
 };
 
@@ -2409,7 +2407,7 @@ BluetoothAdapter.prototype.createBonding = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_createBonding', callArgs, callback);
 };
 
@@ -2449,7 +2447,7 @@ BluetoothAdapter.prototype.destroyBonding = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_destroyBonding', callArgs, callback);
 };
 
@@ -2494,7 +2492,7 @@ BluetoothAdapter.prototype.registerRFCOMMServiceByUUID = function() {
     };
 
     // native.call does not inform if call results in failure
-    // TODO: what to do in this case?
+    // Errors are handled by error callback
     native.call('BluetoothAdapter_registerRFCOMMServiceByUUID', callArgs, callback);
 };
 
index 2ee99ac5cbb229935c4db208e59a48344ed4dade..f2c232d1fe1726b94f78ec1b4f202785f2a4750a 100755 (executable)
@@ -704,7 +704,7 @@ void BluetoothLEAdapter::OnScanResult(
     ReportError(util::GetBluetoothError(result, "Error during scanning"), data_obj);
     data_obj->insert(std::make_pair(kAction, picojson::value(kOnScanError)));
   } else {
-    // TODO: this is probably capi-network-bluetooth error: when scan is stopped info has 0x1 value
+    // this is probably capi-network-bluetooth error: when scan is stopped info has 0x1 value
     if (nullptr != info && reinterpret_cast<void*>(0x1) != info) {
       // device found
       LoggerD("Device found");