If NCS have a similar function as peer_manager.c in nRFSDK17?

Now,I have a project writed by nRFSDK17.And I want to rewrite it by NCS.

I hope to get a module like peer_manager to manage paring and bonding,and I can distinguish connecting device by something like peer_id.

I try to make clear how peripheral_hids_mouse,but I failed.

Parents
  • Hi,

    There is no direct one-to-one mapping when you transition from nRF5SDK to nRF Connect SDK. For example, you can utilise the Bluetooth LE bond module which will help to switch between peers, scan for new peers and erase Bluetooth bonds. You can also use the Zephyr Bluetooth Stack and the APIs to achieve functionality similar to the peer manager in the nRF5SDK. It has APIs which help to pair & bond, distinguish between connected devices as well as for authenticating. You can also take a look at the Google Fast Pair Integration.

    Regards,

    Priyanka

  • Hi,

    I want the user entry passkey when their phone pairing with my board and now I just realize that display passkey on phone and need confirm at two sides together.

    I find this explain in LE passkey module:

    The CONFIG_BT_SMP_ENFORCE_MITM option is disabled by default to allow the dongle to connect without the authentication.

    I checked my prj.conf ,it is enabled.And even I use bt_passkey_set() to set a fixed passkey,It still run in this mode that confirm to bond.

  • Hi,

    Could you share your prj.conf?

    Regards,

    Priyanka

  • Hi。

    my prj.conf as follow:

    #

    # Copyright (c) 2019 Nordic Semiconductor ASA #版权所有(c) 2019北欧半导体ASA#版权所有(c) 2019北欧半导体ASA#版权所有(c) 2019北欧半导体ASA#版权所有(c) 2019北欧半导体ASA#版权所有(c) 2019北欧半导体ASA#版权所有(c) 2019北欧半导体ASA

    #

    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # SPDX许可证标识符:LicenseRef-Nordic-5条款# SPDX许可证标识符:LicenseRef-Nordic-5条款# SPDX许可证标识符:LicenseRef-Nordic-5条款# SPDX许可证标识符:LicenseRef-Nordic-5条款# SPDX许可证标识符:LicenseRef-Nordic-5条款# SPDX许可证标识符:LicenseRef-Nordic-5条款

    #

    CONFIG_NCS_SAMPLES_DEFAULTS=y

     

    CONFIG_BT=y

    CONFIG_BT_MAX_CONN=2

    CONFIG_BT_MAX_PAIRED=2

    CONFIG_BT_SMP=y

    CONFIG_BT_SMP_ENFORCE_MITM=y

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_MAX_CONN=2
    CONFIG_BT_MAX_PAIRED=2
    CONFIG_BT_SMP=y
    CONFIG_BT_SMP_ENFORCE_MITM=y
    CONFIG_BT_FIXED_PASSKEY=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_DEVICE_APPEARANCE=962
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_NAME_CNT=1
    CONFIG_BT_SCAN_MANUFACTURER_DATA_CNT=1
    CONFIG_BT_SCAN_WITH_IDENTITY=y
    CONFIG_BT_ID_MAX=1
    
    CONFIG_BT_EXT_ADV=y
    
    CONFIG_BT_HIDS=y
    CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1
    CONFIG_BT_GATT_UUID16_POOL_SIZE=12
    CONFIG_BT_GATT_CHRC_POOL_SIZE=8
    CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y
    
    CONFIG_BT_CONN_CTX=y
    
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    CONFIG_DK_LIBRARY=y
    
    CONFIG_MPSL=y
    CONFIG_MPSL_TIMESLOT_SESSION_COUNT=1
    
    CONFIG_DM_MODULE=y
    CONFIG_DM_MODULE_LOG_LEVEL_DBG=n
    CONFIG_DM_GPIO_DEBUG=y
    CONFIG_PWM=y
    
    CONFIG_DM_HIGH_PRECISION_CALC=y
    CONFIG_BT_DDFS=y
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    
    CONFIG_SERIAL=y
    CONFIG_UART_ASYNC_API=y
    
    CONFIG_BOARD_ENABLE_DCDC=n

  • The prj.conf looks fine. Please make sure that you also set a fixed passkey in the code. Also, could you explain a bit more on what issue you face now?

    -Priyanka

  • I want to pairing and bonding with a passkey that input at my phone or the central board,it seem defined as security level 3,But those sample such as hid_mouse use the security lecel 4 that confirm the same passkey both.I want to know how the code should be organized to arrive it.

  • Hi,

    Apologies for the delay. I see that you are being assisted for the same (pair and bond with static passkey) in a different ticket. 

    If that's the case, kindly close this ticket. Slight smile

    -Priyanka

Reply Children
No Data
Related