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

rd_auth wr_auth flags

Hi, is there a tutorial or more documentation available for explaining the purpose and how to use rd_auth and wr_auth flags? E.g., if I set rd_auth = 1 do I still have to initialize and use read_perm? 

So should rd_auth and wr_auth be used in conjunction with GAP encryption, MITM, and LESC pairing options? Or is rd_auth and wr_auth redundant if I already implemented passkey pairing and GAP encryption & MITM protection? 

It only says in the official documentation that rd_auth is for "Read authorization and value will be requested from the application on every read operation." I also tried looking in this previous post but it was not helpful in answering the specific question about rd_auth and wr_auth. https://devzone.nordicsemi.com/f/nordic-q-a/14258/time-to-understand-read-write-read_perm-write_perm-rd_auth-wr_auth

Parents Reply Children
  • Hi in the Characteristics tutorial they say: "you also have the option to define the permissions with associated authorization requirements. For example if you need Man In The Middle protection (MITM) or a passkey to access your attribute." 

    Nordic documentation says that when rd_auth/wr_auth = 1 there is function call sd_ble_gatts_rw_authorize_reply() with either success or failure to respond to the event BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST. But the documentation is unclear as to what causes success or failure for the authorization request. 

    I have already successfully enabled MITM and passkey requirement with my code and it worked with rd_auth/wr_auth = 0. When I set rd_auth/wr_auth = 1, reflash code and bond to Nordic peripheral with correct passkey, I try to read and write value to custom characteristic through nrf_connect app. But I get an error 133(0x85) GATT ERROR. This is strange because before when using passkey and rd_auth/wr_auth = 0, I can read and write without any error. 

    So I am still confused as to whether I am supposed to use "rd_auth/wr_auth = 1" for another purpose/case?

Related