Bug 1161939 - Correct bitwise checking on GATT characteristic write properties. r=jocelyn
authorBruce Sun <brsun@mozilla.com>
Wed, 06 May 2015 18:15:30 +0800
changeset 242545 fe169f6b08ad1402047e14fc9c626acc968d38cd
parent 242544 bdd9a31287d7bad35bc42e93c9ed51ff8b69825b
child 242546 79432e5c931a15f9a8c13e4621142dcff481459e
push id28699
push userryanvm@gmail.com
push dateWed, 06 May 2015 20:01:37 +0000
treeherdermozilla-central@b2a742938d64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjocelyn
bugs1161939
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1161939 - Correct bitwise checking on GATT characteristic write properties. r=jocelyn
dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp
--- a/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp
@@ -295,18 +295,18 @@ BluetoothGattCharacteristic::WriteValue(
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<Promise> promise = Promise::Create(global, aRv);
   NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
 
   BT_ENSURE_TRUE_REJECT(mProperties &
-                          (GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE ||
-                           GATT_CHAR_PROP_BIT_WRITE ||
+                          (GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE |
+                           GATT_CHAR_PROP_BIT_WRITE |
                            GATT_CHAR_PROP_BIT_SIGNED_WRITE),
                         promise,
                         NS_ERROR_NOT_AVAILABLE);
 
   aValue.ComputeLengthAndData();
 
   nsTArray<uint8_t> value;
   value.AppendElements(aValue.Data(), aValue.Length());