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

No BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST with secure connection?

When I add an attribute with BLE_GAP_CONN_SEC_MODE_SET_OPEN I get a BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event when I try to read it. I do not however get a BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event when I add the attributes with BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM. Why?

Parents
  • You should not get an authorize request unless you specifically set the rd_auth or wr_auth flags in the characteristic metadata.

    I suspect you are not memsetting your variables to zero, and that those bits take on random values depending on where the compiler decides to place the data.

  • Ah, ok, normally (with the phone) I have an encrypted connection but for testing I use a tool which connects without encryption. I wanted to test the status I return, but it seems the softdevice already handles this than. I don't know if that's wanted behavior. If a set rd_auth than I aspect the authorize requests. Not that if this than that or else if this than etc... I bump into more places where the softdevice handles stuff but where I aspect the application should handle it. I have used other solutions that are more transparent. Or the firmware/softdevice handles it or the application. Without conditions.

    Anyway it clear now. Thanks.

Reply
  • Ah, ok, normally (with the phone) I have an encrypted connection but for testing I use a tool which connects without encryption. I wanted to test the status I return, but it seems the softdevice already handles this than. I don't know if that's wanted behavior. If a set rd_auth than I aspect the authorize requests. Not that if this than that or else if this than etc... I bump into more places where the softdevice handles stuff but where I aspect the application should handle it. I have used other solutions that are more transparent. Or the firmware/softdevice handles it or the application. Without conditions.

    Anyway it clear now. Thanks.

Children
No Data
Related