OSDN Git Service

[bluedroid] Fix slave latency and conn timeout defaults in BLE
authorSteve Paik <spaik@google.com>
Thu, 19 Jun 2014 22:50:46 +0000 (15:50 -0700)
committerSteve Paik <spaik@google.com>
Thu, 26 Jun 2014 17:08:14 +0000 (10:08 -0700)
The default connection parameters were not being applied properly in BLE.
Also fixed a typo in btm_ble.c.

Change-Id: I6cfb0f2a400740578910dcf4c7192ea16406aa1b
Signed-off-by: Steve Paik <spaik@google.com>
stack/btm/btm_ble.c
stack/include/btm_ble_api.h
stack/l2cap/l2c_ble.c

index 82e6fe0..86d1260 100644 (file)
@@ -564,7 +564,7 @@ void BTM_BleSetPrefConnParams (BD_ADDR bd_addr,
                 if (supervision_tout != BTM_BLE_CONN_PARAM_UNDEF)
                     p_dev_rec->conn_params.supervision_tout = supervision_tout;
                 else
-                    p_dev_rec->conn_params.slave_latency = BTM_BLE_CONN_TIMEOUT_DEF;
+                    p_dev_rec->conn_params.supervision_tout = BTM_BLE_CONN_TIMEOUT_DEF;
 
             }
 
index 7b06f9a..d38c417 100644 (file)
@@ -99,7 +99,6 @@ typedef UINT8   tBTM_BLE_SFP;
 #define BTM_BLE_CONN_SUP_TOUT_MIN       0x000A
 #define BTM_BLE_CONN_SUP_TOUT_MAX       0x0C80
 #define BTM_BLE_CONN_PARAM_UNDEF        0xffff      /* use this value when a specific value not to be overwritten */
-#define BTM_BLE_CONN_SUP_TOUT_DEF       700
 
 /* default connection parameters if not configured, use GAP recommend value for auto/selective connection */
 /* default scan interval */
index 2d7d9e0..7a20250 100644 (file)
@@ -663,9 +663,9 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
         (UINT16) ((p_dev_rec->conn_params.max_conn_int != BTM_BLE_CONN_PARAM_UNDEF) ?
         p_dev_rec->conn_params.max_conn_int : BTM_BLE_CONN_INT_MAX_DEF),  /* conn_int_max  */
         (UINT16) ((p_dev_rec->conn_params.slave_latency != BTM_BLE_CONN_PARAM_UNDEF) ?
-        p_dev_rec->conn_params.slave_latency : 0), /* UINT16 conn_latency  */
+        p_dev_rec->conn_params.slave_latency : BTM_BLE_CONN_SLAVE_LATENCY_DEF), /* UINT16 conn_latency  */
         (UINT16) ((p_dev_rec->conn_params.supervision_tout != BTM_BLE_CONN_PARAM_UNDEF) ?
-        p_dev_rec->conn_params.supervision_tout : BTM_BLE_CONN_SUP_TOUT_DEF), /* conn_timeout */
+        p_dev_rec->conn_params.supervision_tout : BTM_BLE_CONN_TIMEOUT_DEF), /* conn_timeout */
                                         0,                       /* UINT16 min_len       */
                                         0))                      /* UINT16 max_len       */
     {