MariuszSkamra commented on code in PR #2013:
URL: https://github.com/apache/mynewt-nimble/pull/2013#discussion_r2290891549


##########
apps/btshell/src/btshell.h:
##########
@@ -97,6 +97,23 @@ struct btshell_scan_opts {
 extern struct btshell_conn btshell_conns[MYNEWT_VAL(BLE_MAX_CONNECTIONS)];
 extern int btshell_num_conns;
 
+/* BLE_GATT_READ_MAX_ATTRS * (1 ATT + 1 EATT chan) */
+#define PENDING_ATTR_MAX MYNEWT_VAL(BLE_GATT_READ_MAX_ATTRS) * 2
+
+struct auth_attr {
+    uint16_t conn_handle;
+    uint16_t attr_handle;
+};
+
+extern struct auth_attr authorized_attrs[PENDING_ATTR_MAX];

Review Comment:
   I am not convinced to this approach. It is because, I'm concerned it won't 
work as expected to the user. As the `authorized_attrs` size is limited to 
`PENDING_ATTR_MAX`, the authorization state can be lost IMO. I would expect the 
once authorized client won't be asked for authorization again on attribute 
access attempt.
   
   The solution that comes to my mind would be a authorization state being 
stored by user. Meaning the user on authorization required characteristic 
registration provides authorization state block.
   Such block would be flags where each flag would correspond to connection 
index, so the total number of bits would be `BLE_MAX_CONNECTIONS`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to