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

nRF Connect App Source code for Android

Hi,

I am working on a project where my mobile phone will be acting as a central device and nRF52840 DK will be acting as a peripheral device. I used the nRF UART and nRF toolbox app for basic string transfer from my phone to the nRF board. I was able to display the transmitted and received strings on the mobile app as well as on the desktop using Putty.

I wanted to know how the packets are going over the so I made another nRF52840 board as a sniffer. From the sniffer trace, I got to know that the data are sent and received as plain text. But I wanted to send and receive encrypted data.

When I searched on the internet I got to know that for sending and receiving encrypted data we need to pair and bond the device. So I added the peer manager to my code. But later I got to know that nRF Toolbox and nRF UART doesn't support pairing and bonding. Is it true??

Then I switched over nRF Connect on my mobile phone. It was working but I couldn't get the source code for nRF Connect on Github as it was available for nRF Toolbox and nRF UART.

Can someone please share me the source code for nRF connect App for Android??

Parents
  • Hi

    I recommend you have a look at our Android BLE Library over at our GitHub.

    Best regards,

    Simon

  • I have added the Android BLE Library into the nRF Toolbox App. Will it support bonding and pairing now?

    The nRF Toolbox logs are attached Below:

    <info> app: LE Secure Connections example started.
    <info> app: Advertising
    <info> app: PERIPHERAL: Connected, handle 1.
    <info> app: PERIPHERAL: BLE_GAP_EVT_SEC_PARAMS_REQUEST
    <info> app: PERIPHERAL: BLE_GAP_EVT_LESC_DHKEY_REQUEST
    <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 1
    <info> app: PERIPHERAL: BLE_GAP_EVT_PASSKEY_DISPLAY: passkey=495856 match_req=1
    <info> app: Press Button 1 to confirm, Button 2 to reject
    <info> app: Numeric Match. Conn handle: 1
    <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 1, procedure: Bonding
    <info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 1 kdist_own:0x3 kdist_peer:0x2
    

Reply
  • I have added the Android BLE Library into the nRF Toolbox App. Will it support bonding and pairing now?

    The nRF Toolbox logs are attached Below:

    <info> app: LE Secure Connections example started.
    <info> app: Advertising
    <info> app: PERIPHERAL: Connected, handle 1.
    <info> app: PERIPHERAL: BLE_GAP_EVT_SEC_PARAMS_REQUEST
    <info> app: PERIPHERAL: BLE_GAP_EVT_LESC_DHKEY_REQUEST
    <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 1
    <info> app: PERIPHERAL: BLE_GAP_EVT_PASSKEY_DISPLAY: passkey=495856 match_req=1
    <info> app: Press Button 1 to confirm, Button 2 to reject
    <info> app: Numeric Match. Conn handle: 1
    <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 1, procedure: Bonding
    <info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 1 kdist_own:0x3 kdist_peer:0x2
    

Children
No Data
Related