Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1b5fa54 authored by Zhihai Xu's avatar Zhihai Xu
Browse files

support peripheral mode feature to connect iphone to android device.

enable BLE_PERIPHERAL_MODE_SUPPORT flag and fix the bug
the discoverability flag is not set in advertisement packet,
which cause the central device(iphone) can not find android device
during scan.
use displayOnly IO cap for dory, so dory can display the pin,
and the iphone(central device) will input the pin.
bug:12797572

Change-Id: Ie15ea9e340e3692df846399b9a85aa6d2a97eba7
parent 68ec126d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -819,7 +819,7 @@ static void btgattc_handle_event(uint16_t event, char* p_param)
            break;

        case BTIF_GATTC_LISTEN:
#ifdef BLE_PERIPHERAL_MODE_SUPPORT
#if (defined(BLE_PERIPHERAL_MODE_SUPPORT) && (BLE_PERIPHERAL_MODE_SUPPORT == TRUE))
            BTA_GATTC_Listen(p_cb->client_if, p_cb->start, NULL);
#else
            BTA_DmBleBroadcast(p_cb->start);
@@ -1087,6 +1087,10 @@ static bt_status_t btif_gattc_set_adv_data(int client_if, bool set_scan_rsp, boo
        }
    }

#if (defined(BLE_PERIPHERAL_ADV_NAME) && (BLE_PERIPHERAL_ADV_NAME == TRUE))
    btif_cb.adv_data.mask |= BTM_BLE_AD_BIT_DEV_NAME;
#endif

    return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_SET_ADV_DATA,
                                 (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL);
}
+12 −0
Original line number Diff line number Diff line
@@ -1432,6 +1432,18 @@ and USER_HW_DISABLE_API macros */
#define GATT_CLIENT_ENABLED          TRUE
#endif

#ifndef BLE_PERIPHERAL_MODE_SUPPORT
#define BLE_PERIPHERAL_MODE_SUPPORT  FALSE
#endif

#ifndef BLE_PERIPHERAL_DISPLAYONLY
#define BLE_PERIPHERAL_DISPLAYONLY   FALSE
#endif

#ifndef BLE_PERIPHERAL_ADV_NAME
#define BLE_PERIPHERAL_ADV_NAME      FALSE
#endif

#ifndef GATT_MAX_SR_PROFILES
#define GATT_MAX_SR_PROFILES        32 /* max is 32 */
#endif
+1 −1
Original line number Diff line number Diff line
@@ -1295,7 +1295,7 @@ void GATT_Deregister (tGATT_IF gatt_if)

    gatt_deregister_bgdev_list(gatt_if);
    /* update the listen mode */
#ifdef BLE_PERIPHERAL_MODE_SUPPORT
#if (defined(BLE_PERIPHERAL_MODE_SUPPORT) && (BLE_PERIPHERAL_MODE_SUPPORT == TRUE))
    GATT_Listen(gatt_if, FALSE, NULL);
#endif

+1 −1
Original line number Diff line number Diff line
@@ -276,8 +276,8 @@ typedef struct
    tBTM_BLE_MANU           manu;			/* manufactuer data */
    tBTM_BLE_INT_RANGE      int_range;      /* slave prefered conn interval range */
    tBTM_BLE_SERVICE        services;       /* services */
    UINT8                   flag;
    UINT16                  appearance;
    UINT8                   flag;
    tBTM_BLE_PROPRIETARY    *p_proprietary;
}tBTM_BLE_ADV_DATA;

+6 −0
Original line number Diff line number Diff line
@@ -105,6 +105,12 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
        {
            p_cb->loc_auth_req   = cb_data.io_req.auth_req;
            p_cb->loc_io_caps    = cb_data.io_req.io_cap;
#if (defined(BLE_PERIPHERAL_DISPLAYONLY) && (BLE_PERIPHERAL_DISPLAYONLY == TRUE))
            if (p_cb->role == HCI_ROLE_SLAVE)
            {
                p_cb->loc_io_caps    = SMP_IO_CAP_OUT;
            }
#endif
            p_cb->loc_oob_flag   = cb_data.io_req.oob_data;
            p_cb->loc_enc_size   = cb_data.io_req.max_key_size;
            p_cb->loc_i_key      = cb_data.io_req.init_keys;