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

BLE connection with NRF toolbox

Hi,

I'm using NRF52840, and I've developed a feature which bonds with NRF toolbox application. The problem is that when I'm using secured BLE, I can't receive any messages from my mobile (using NRF toolbox).

I've set pairing mode to NFC_PAIRING_MODE_LESC_OOB, and I use pm_conn_secure() to open a secured connection.

When initializing NUS service, I'm using BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM for RX and TX attributes.

However, when I'm using NFC_PAIRING_MODE_JUST_WORKS and BLE_GAP_CONN_SEC_MODE_SET_OPEN, everything is OK.

Should I do something else?

Thanks!!

Parents
  • Hi, 

    Please see this post to for the usage of BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM. 

    Setting the security_req_t cccd_write_access = SEC_MITM will require MITM and LESC to access the attribute. The security_req_t variable is passed to set_security_req() function to set the attributes security level. 

    -Amanda H.

  • Hi Amanda,

    I think my issue is different.

    ble_nus event handler executes on_write function when BLE_GATTS_EVT_WRITE event occurs.

    When connecting to mobile, the attribute handle of the event does not equal to the handle of the cccd. Therefore - communication doesn't start.

    After that - when I try to send messages from my mobile to the device - nothing happens and ble_nus event handler is not called.

    I also tried the solution from your suggested post - it didn't help.

    Do you have any other ideas?

    Thanks!

Reply
  • Hi Amanda,

    I think my issue is different.

    ble_nus event handler executes on_write function when BLE_GATTS_EVT_WRITE event occurs.

    When connecting to mobile, the attribute handle of the event does not equal to the handle of the cccd. Therefore - communication doesn't start.

    After that - when I try to send messages from my mobile to the device - nothing happens and ble_nus event handler is not called.

    I also tried the solution from your suggested post - it didn't help.

    Do you have any other ideas?

    Thanks!

Children
Related