OSDN Git Service

Include flags in all connectable packets
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 30 Mar 2017 18:52:53 +0000 (11:52 -0700)
committerJakub Pawlowski <jpawlowski@google.com>
Sat, 1 Apr 2017 05:30:07 +0000 (22:30 -0700)
According to Bluetooth CSSv7, the flags field shall be included in all
connectable packets, not only legacy packets.

Test: manal
Bug: 30622771
Change-Id: I006f9bd6d31ca0673d78405f320b18623e6e5b16
(cherry picked from commit 9389b64629776238e6ee69b1f37bdec97187e75e)

stack/btm/btm_ble_multi_adv.cc

index f659025..51b00a5 100644 (file)
@@ -78,9 +78,8 @@ namespace {
 void DoNothing(uint8_t) {}
 void DoNothing2(uint8_t, uint8_t) {}
 
-bool is_legacy_connectable(uint16_t advertising_event_properties) {
-  if (((advertising_event_properties & 0x10) != 0) &&
-      ((advertising_event_properties & 0x01) != 0)) {
+bool is_connectable(uint16_t advertising_event_properties) {
+  if ((advertising_event_properties & 0x01) != 0) {
     return true;
   }
   return false;
@@ -566,8 +565,7 @@ class BleAdvertisingManagerImpl
     AdvertisingInstance* p_inst = &adv_inst[inst_id];
     VLOG(1) << "is_scan_rsp = " << is_scan_rsp;
 
-    if (!is_scan_rsp &&
-        is_legacy_connectable(p_inst->advertising_event_properties)) {
+    if (!is_scan_rsp && is_connectable(p_inst->advertising_event_properties)) {
       uint8_t flags_val = BTM_GENERAL_DISCOVERABLE;
 
       if (p_inst->timeout_s) flags_val = BTM_LIMITED_DISCOVERABLE;