You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/05/15 07:11:08 UTC

[GitHub] andrzej-kaczmarek closed pull request #93: nimble/host: Enable auth payload tmo event only for >=4.1

andrzej-kaczmarek closed pull request #93: nimble/host: Enable auth payload tmo event only for >=4.1
URL: https://github.com/apache/mynewt-nimble/pull/93
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/nimble/host/src/ble_hs_startup.c b/nimble/host/src/ble_hs_startup.c
index 63428a0f..00a0f86e 100644
--- a/nimble/host/src/ble_hs_startup.c
+++ b/nimble/host/src/ble_hs_startup.c
@@ -279,8 +279,11 @@ static int
 ble_hs_startup_set_evmask_tx(void)
 {
     uint8_t buf[BLE_HCI_SET_EVENT_MASK_LEN];
+    uint8_t version;
     int rc;
 
+    version = ble_hs_hci_get_hci_version();
+
     /**
      * Enable the following events:
      *     0x0000000000000010 Disconnection Complete Event
@@ -298,16 +301,18 @@ ble_hs_startup_set_evmask_tx(void)
         return rc;
     }
 
-    /**
-     * Enable the following events:
-     *     0x0000000000800000 Authenticated Payload Timeout Event
-     */
-    ble_hs_hci_cmd_build_set_event_mask2(0x0000000000800000, buf, sizeof buf);
-    rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
-                                                BLE_HCI_OCF_CB_SET_EVENT_MASK2),
-                                     buf, sizeof(buf));
-    if (rc != 0) {
-        return rc;
+    if (version >= BLE_HCI_VER_BCS_4_1) {
+        /**
+         * Enable the following events:
+         *     0x0000000000800000 Authenticated Payload Timeout Event
+         */
+        ble_hs_hci_cmd_build_set_event_mask2(0x0000000000800000, buf, sizeof buf);
+        rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
+                                                    BLE_HCI_OCF_CB_SET_EVENT_MASK2),
+                                         buf, sizeof(buf));
+        if (rc != 0) {
+            return rc;
+        }
     }
 
     return 0;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services