You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2017/04/03 16:14:19 UTC

[1/4] incubator-mynewt-core git commit: nimble/controller: Fix for directed advertising report

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 28531b959 -> d0763ab0b


nimble/controller: Fix for directed advertising report

Whenever scan filtering is 0x02 and initA is not resolved RPA,
we should send to host LE Direct Advertising Report event instead of
LE Advertising Report.
If InitA is not a RPA we should rather drop the adv packet.

With this patch we also stop to determine subevent type on own_address_type
as this is not related.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/bf72b358
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/bf72b358
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/bf72b358

Branch: refs/heads/develop
Commit: bf72b358b0d79e37bb0ab8fc3240beacdb0f7c42
Parents: 28531b9
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Mon Apr 3 15:42:06 2017 +0200
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Mon Apr 3 16:19:57 2017 +0200

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_scan.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bf72b358/net/nimble/controller/src/ble_ll_scan.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_scan.c b/net/nimble/controller/src/ble_ll_scan.c
index f5eca7f..4fa866c 100644
--- a/net/nimble/controller/src/ble_ll_scan.c
+++ b/net/nimble/controller/src/ble_ll_scan.c
@@ -404,12 +404,14 @@ ble_ll_hci_send_adv_report(uint8_t pdu_type, uint8_t txadd, uint8_t *rxbuf,
     inita = NULL;
     subev = BLE_HCI_LE_SUBEV_ADV_RPT;
     if (pdu_type == BLE_ADV_PDU_TYPE_ADV_DIRECT_IND) {
-        if (scansm->own_addr_type > BLE_HCI_ADV_OWN_ADDR_RANDOM) {
-            inita = rxbuf + BLE_LL_PDU_HDR_LEN + BLE_DEV_ADDR_LEN;
-            if ((inita[5] & 0x40) == 0x40) {
-                subev = BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT;
-            }
+        inita = rxbuf + BLE_LL_PDU_HDR_LEN + BLE_DEV_ADDR_LEN;
+        if ((inita[5] & 0x40) == 0x40) {
+            subev = BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT;
+        } else {
+            /* Let's ignore it if address is not resolvable */
+            return;
         }
+
         evtype = BLE_HCI_ADV_RPT_EVTYPE_DIR_IND;
         event_len = BLE_HCI_LE_ADV_DIRECT_RPT_LEN;
         adv_data_len = 0;


[3/4] incubator-mynewt-core git commit: nimble/controller: Fix mixed AdvAdd and InitA in the advertising report

Posted by an...@apache.org.
nimble/controller: Fix mixed AdvAdd and InitA in the advertising report

With this patch InitA is put into 'Direct address' field and AdvAdd is
put into 'Address' field of LE Direct Advertising Report event

Also RSSI has been added in the end of this report:

> HCI Event: LE Meta Event (0x3e) plen 18
      LE Direct Advertising Report (0x0b)
        Num reports: 1
        Event type: Connectable directed - ADV_DIRECT_IND (0x01)
        Address type: Random (0x01)
        Address: 7F:1B:6A:0E:32:CF (Resolvable)
        Direct address type: Random (0x01)
        Direct address: 5E:10:15:22:54:00 (Resolvable)
        RSSI: -22 dBm (0xea)


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/ce3e0378
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/ce3e0378
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/ce3e0378

Branch: refs/heads/develop
Commit: ce3e0378d3f6c8bba4158aa8f6ba7cc839dadef8
Parents: 94cfca3
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Mon Apr 3 16:01:43 2017 +0200
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Mon Apr 3 16:20:14 2017 +0200

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_scan.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ce3e0378/net/nimble/controller/src/ble_ll_scan.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_scan.c b/net/nimble/controller/src/ble_ll_scan.c
index 90869ff..7f0c40b 100644
--- a/net/nimble/controller/src/ble_ll_scan.c
+++ b/net/nimble/controller/src/ble_ll_scan.c
@@ -465,19 +465,23 @@ ble_ll_hci_send_adv_report(uint8_t pdu_type, uint8_t txadd, uint8_t *rxbuf,
 
             orig_evbuf = evbuf;
             evbuf += 5;
+
+            /* The advertisers address type and address are always in event */
+            evbuf[0] = addr_type;
+            memcpy(evbuf + 1, adv_addr, BLE_DEV_ADDR_LEN);
+            evbuf += BLE_DEV_ADDR_LEN + 1;
+
             if (inita) {
                 evbuf[0] = BLE_HCI_ADV_OWN_ADDR_RANDOM;
                 memcpy(evbuf + 1, inita, BLE_DEV_ADDR_LEN);
                 evbuf += BLE_DEV_ADDR_LEN + 1;
             } else {
-                evbuf[7] = adv_data_len;
-                memcpy(evbuf + 8, rxbuf + BLE_DEV_ADDR_LEN, adv_data_len);
-                evbuf[8 + adv_data_len] = hdr->rxinfo.rssi;
+                evbuf[0] = adv_data_len;
+                memcpy(evbuf + 1, rxbuf + BLE_DEV_ADDR_LEN, adv_data_len);
+                evbuf += adv_data_len + 1;
             }
 
-            /* The advertisers address type and address are always in event */
-            evbuf[0] = addr_type;
-            memcpy(evbuf + 1, adv_addr, BLE_DEV_ADDR_LEN);
+            evbuf[0] = hdr->rxinfo.rssi;
 
             rc = ble_ll_hci_event_send(orig_evbuf);
             if (!rc) {


[2/4] incubator-mynewt-core git commit: nimble/controller: Fix len of InitA in advertising report

Posted by an...@apache.org.
nimble/controller: Fix len of InitA in advertising report


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/94cfca32
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/94cfca32
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/94cfca32

Branch: refs/heads/develop
Commit: 94cfca3213f90310e9273836d664f3de393a5ed9
Parents: bf72b35
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Mon Apr 3 15:59:10 2017 +0200
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Mon Apr 3 16:20:06 2017 +0200

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/94cfca32/net/nimble/controller/src/ble_ll_scan.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_scan.c b/net/nimble/controller/src/ble_ll_scan.c
index 4fa866c..90869ff 100644
--- a/net/nimble/controller/src/ble_ll_scan.c
+++ b/net/nimble/controller/src/ble_ll_scan.c
@@ -467,7 +467,7 @@ ble_ll_hci_send_adv_report(uint8_t pdu_type, uint8_t txadd, uint8_t *rxbuf,
             evbuf += 5;
             if (inita) {
                 evbuf[0] = BLE_HCI_ADV_OWN_ADDR_RANDOM;
-                memcpy(evbuf + 1, inita, adv_data_len);
+                memcpy(evbuf + 1, inita, BLE_DEV_ADDR_LEN);
                 evbuf += BLE_DEV_ADDR_LEN + 1;
             } else {
                 evbuf[7] = adv_data_len;


[4/4] incubator-mynewt-core git commit: This closes #220.

Posted by an...@apache.org.
This closes #220.

Merge remote-tracking branch 'rymanluk/direct_adv_fixes' into develop


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/d0763ab0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/d0763ab0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/d0763ab0

Branch: refs/heads/develop
Commit: d0763ab0b759e6fd053d077d88e2bd0fc050f91f
Parents: 28531b9 ce3e037
Author: Andrzej Kaczmarek <an...@codecoup.pl>
Authored: Mon Apr 3 18:13:49 2017 +0200
Committer: Andrzej Kaczmarek <an...@codecoup.pl>
Committed: Mon Apr 3 18:13:49 2017 +0200

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_scan.c | 30 +++++++++++++++++-----------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------