This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pc-ble-driver binding

Configuration
Serialized Bluetooth application.
Host:
Pc running Linux.
Host application:
    -Custom application linking pc-ble-driver from     github.com/.../pc-ble-driver
    -Implements a peripheral with 3 custom services. Only 1 service requires binding for access.

Ble connectivity chip:
nRF52832  running connectivity_2.0.1_115k2_with_s132_5.0.hex


Problem:I can not do binding. I was looking into the forum and could not find a usefull response to the problem or somebody that was able to do
the binding in this configuration.

When i try from the central to access the service that requires binding:
I get the event BLE_GAP_EVT_SEC_PARAMS_REQUEST, with the following parameters (connection handle, peer security parameters):
BLE_GAP_EVT_SEC_PARAMS_REQUEST:handle[0]current[0]
BLE_GAP_EVT_SEC_PARAMS_REQUEST:request sec params
-bond[1],io_caps[4],keypress[0],lesc[1],max_key_size[16],min_key_size[0],mitm[1],oob[0]
-kdist own enc[1]id[1]link[0]sign[0], peer enc[1]id[1]link[0]sign[0]

Accrding with "Gap peripheral Bonding: Passkey entry, Pripheral displays" i have to use the following function to reply:
    sd_ble_gap_sec_params_reply(adapter_t *adapter, uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params,             ble_gap_sec_keyset_t const *p_sec_keyset);
Looking in ble_gap_impl.cpp looks like the keyset will be copied into m_app_keys_table[index].keyset for future use


I can create  the first 4 parameters of the function with no problems as follows:
adapter_t *adapter, uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params

I do not know how to create ble_gap_sec_keyset_t const *p_sec_keyset

typedef struct
{
  ble_gap_sec_keys_t            keys_own;     /**< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding. */
  ble_gap_sec_keys_t            keys_peer;    /**< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL. */
} ble_gap_sec_keyset_t;

1. Where i can get the keys the peer sent?
2. Is that a API to generate own keys?
3. Are the keys stored in the connectivity chip and are they "power cycle" safe?
4. Is the binding possible in the serialized Bluetooth architecture?

Parents
  • Hi Kristin,

    I am using the architecture described a serialized Bluetooth application, not writing a program/project to be downloaded into the nRF52832.

    My application is running on a host running Linux and is linking pc-ble-driver library.

    It is connected over serial line with the connectivity chip (nRF52832) loaded with the connectivity firmware connectivity_2.0.1_115k2_with_s132_5.0.hex.

    In my host application:

    -create an adapter with sd_rpc_adapter_create(transport_layer);

    -open the adapter with sd_rpc_open(m_ble_adapter.m_adapter, status_handler, ble_evt_dispatch, log_handler);

    where the ble_evt_dispatch is the handler for all the ble events.

    Everything works fine for my application running on the linux host that inplements a peripheral, i create my custom profile(services), advertise, the central can connect to me and access the services that do not require binding. The only missing piece is doing the binding that is a mandatory requirement for one of our custom service.

    Can you please be more specific on where the peer manager module should be added?

    Into the pc-ble-driver library and recompile the library?(i am using the latest from github)

    Is the connectivity firmware suporting the binding process or must be also updated/recompiled.

    Thanks,

    Adrian

Reply
  • Hi Kristin,

    I am using the architecture described a serialized Bluetooth application, not writing a program/project to be downloaded into the nRF52832.

    My application is running on a host running Linux and is linking pc-ble-driver library.

    It is connected over serial line with the connectivity chip (nRF52832) loaded with the connectivity firmware connectivity_2.0.1_115k2_with_s132_5.0.hex.

    In my host application:

    -create an adapter with sd_rpc_adapter_create(transport_layer);

    -open the adapter with sd_rpc_open(m_ble_adapter.m_adapter, status_handler, ble_evt_dispatch, log_handler);

    where the ble_evt_dispatch is the handler for all the ble events.

    Everything works fine for my application running on the linux host that inplements a peripheral, i create my custom profile(services), advertise, the central can connect to me and access the services that do not require binding. The only missing piece is doing the binding that is a mandatory requirement for one of our custom service.

    Can you please be more specific on where the peer manager module should be added?

    Into the pc-ble-driver library and recompile the library?(i am using the latest from github)

    Is the connectivity firmware suporting the binding process or must be also updated/recompiled.

    Thanks,

    Adrian

Children
Related