-
Notifications
You must be signed in to change notification settings - Fork 426
nimble/host: add support for asynchronous authorization #2013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
5552678
to
cacfff5
Compare
cacfff5
to
406662a
Compare
406662a
to
87aa57f
Compare
#AutoPTS run mynewt GATT/SR/GAR/BI-03-C GATT/SR/GAR/BI-09-C GATT/SR/GAR/BI-15-C GATT/SR/GAR/BI-20-C GATT/SR/GAR/BI-40-C GATT/SR/GAW/BI-04-C GATT/SR/GAW/BI-11-C |
Scheduled PR #2013 (comment), board: nrf52, estimated start time: 16:05:06, test case count: 7, estimated duration: 0:14:24 Test cases to be runGATT/SR/GAR/BI-03-CGATT/SR/GAR/BI-09-C GATT/SR/GAR/BI-15-C GATT/SR/GAR/BI-20-C GATT/SR/GAR/BI-40-C GATT/SR/GAW/BI-04-C GATT/SR/GAW/BI-11-C |
AutoPTS Bot results: Successful tests (7)GATT GATT/SR/GAR/BI-03-C PASSGATT GATT/SR/GAR/BI-09-C PASS GATT GATT/SR/GAR/BI-15-C PASS GATT GATT/SR/GAR/BI-20-C PASS GATT GATT/SR/GAR/BI-40-C PASS GATT GATT/SR/GAW/BI-04-C PASS GATT GATT/SR/GAW/BI-11-C PASS |
@@ -471,6 +560,190 @@ ble_att_svr_read_flat(uint16_t conn_handle, | |||
return rc; | |||
} | |||
|
|||
int | |||
ble_att_svr_create_read_rsp(uint16_t conn_handle, uint16_t cid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helpers that are not used outside this file should be static
and they don't need to be declared in ble_att_priv.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But they are used in ble_gatts_pending_req_auth()
. Maybe it's confusing because they are in separate commits.
Or did you mean to remove all ble_att_svr_build_foo_rsp
from ble_att_priv.h
, because these are not used outside ble_att_svr.c
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, removed all unnecessary declarations from ble_att_priv.h
and converted them back to static. PTAL
This commit introduces handling authorization in nimble. Each operation on characteristic that has authorize flags will require authorization. Application can respond in GAP authorization event callback with accept, reject or pending response. The latter response should trigger user action to either accept or reject request and finish handling att request. ble_att_svr_create_foo_rsp helpers are introduced to hanldle preparing and sending ATT responses. This is done on top of PR apache#1668 by SumeetSingh19
For authorization testing purposes two characteristics with authorize flags and authorize shell command are added.
BLE_GAP_AUTHORIZE_REJECT is always returned when authorized attribute is being accessed. This is needed for GATT/SR tests that requires rejecting ATT requests with insufficient authorization error.
ble_gatts_pending_req_auth method can be used to prepare and send response to pending ATT request e.g. when user has to authorize operation on attribute that requires authorization
87aa57f
to
3424aca
Compare
This introduces handling authorization in nimble. Each operation on characteristic that has authorize flags will require authorization. Application can respond in GAP authorization event callback with accept, reject or pending response. The latter response should trigger user action to either accept or reject request and finish handling att request
This is done on top of PR #1668 by SumeetSingh19
Fixes GATT/SR/GAW/BI-11-C qualification test case