#include "bta_dm_ci.h"
#include "bt_utils.h"
#include "btif_dm.h"
+#if (defined WEAR_LE_IO_CAP_OVERRIDE && WEAR_LE_IO_CAP_OVERRIDE == TRUE)
+#include "btif_storage.h"
+#endif
#if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE)
#include "bte_appl.h"
tBTA_LE_KEY_TYPE *p_resp_key )
{
UNUSED(bd_addr);
- /* Retrieve the properties from file system if possible */
+
+
+#if (defined WEAR_LE_IO_CAP_OVERRIDE && WEAR_LE_IO_CAP_OVERRIDE == TRUE)
+ /*
+ * Note: This is a Wear-specific feature for iOS pairing.
+ *
+ * Set WearLeIoCap config to force local IO capability to be BTM_IO_CAP_NONE
+ * (No input, no output) for the first bond creation, that indirectly
+ * triggers Just Works pairing.
+ */
+ if (btif_storage_get_num_bonded_devices() == 0)
+ bte_appl_cfg.ble_io_cap = BTM_IO_CAP_NONE;
+#endif
+
+ /* For certification testing purpose, LE IO capability can also be specified with
+ * "PTS_SmpOptions" in the BT stack configuration file (i.e. bt_stack.conf).
+ * Note that if "PTS_SmpOptions" is set, it could override IO capability set above.
+ */
tBTE_APPL_CFG nv_config;
if(btif_dm_get_smp_config(&nv_config))
bte_appl_cfg = nv_config;
*******************************************************************************/
BOOLEAN btif_storage_is_restricted_device(const bt_bdaddr_t *remote_bd_addr);
+/*******************************************************************************
+**
+** Function btif_storage_get_num_bonded_devices
+**
+** Description BTIF storage API - Gets the number of bonded devices
+**
+** Returns the number of bonded devices
+**
+*******************************************************************************/
+int btif_storage_get_num_bonded_devices(void);
#if (BLE_INCLUDED == TRUE)
bt_status_t btif_storage_add_ble_bonding_key( bt_bdaddr_t *remote_bd_addr,
char *key,
/*******************************************************************************
**
+** Function btif_storage_get_num_bonded_devices
+**
+** Description BTIF storage API - Gets the number of bonded devices
+**
+** Returns the number of bonded devices
+**
+*******************************************************************************/
+int btif_storage_get_num_bonded_devices(void) {
+ btif_bonded_devices_t bonded_devices;
+ btif_in_fetch_bonded_devices(&bonded_devices, 0);
+ return bonded_devices.num_devices;
+}
+
+/*******************************************************************************
+**
** Function btif_storage_read_hl_apps_cb
**
** Description BTIF storage API - Read HL application control block from NVRAM
#include "bt_trace.h"
+/******************************************************************************
+**
+** Wear
+**
+******************************************************************************/
+
+/* Enable/disable LE IO capability overriding to no-input-no-output on first bond */
+#ifndef WEAR_LE_IO_CAP_OVERRIDE
+#define WEAR_LE_IO_CAP_OVERRIDE FALSE
+#endif
+
#endif /* BT_TARGET_H */