File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed
connectivity/FEATURE_BLE/libraries/ble-api-implementation/source Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -991,6 +991,23 @@ uint8_t GattServer::atts_write_cb(
991
991
{
992
992
uint8_t err;
993
993
994
+ GattCharacteristic* auth_char = getInstance ().get_auth_char (handle);
995
+ if (auth_char && auth_char->isWriteAuthorizationEnabled ()) {
996
+ GattWriteAuthCallbackParams write_auth_params = {
997
+ connId,
998
+ handle,
999
+ offset,
1000
+ len,
1001
+ pValue,
1002
+ AUTH_CALLBACK_REPLY_SUCCESS
1003
+ };
1004
+
1005
+ GattAuthCallbackReply_t ret = auth_char->authorizeWrite (&write_auth_params);
1006
+ if (ret!= AUTH_CALLBACK_REPLY_SUCCESS) {
1007
+ return ret & 0xFF ;
1008
+ }
1009
+ }
1010
+
994
1011
/* we don't write anything during the prepare phase */
995
1012
bool write_happened = (operation != ATT_PDU_PREP_WRITE_REQ);
996
1013
@@ -1039,23 +1056,6 @@ uint8_t GattServer::atts_write_cb(
1039
1056
break ;
1040
1057
}
1041
1058
1042
- GattCharacteristic* auth_char = getInstance ().get_auth_char (handle);
1043
- if (auth_char && auth_char->isWriteAuthorizationEnabled ()) {
1044
- GattWriteAuthCallbackParams write_auth_params = {
1045
- connId,
1046
- handle,
1047
- offset,
1048
- len,
1049
- pValue,
1050
- AUTH_CALLBACK_REPLY_SUCCESS
1051
- };
1052
-
1053
- GattAuthCallbackReply_t ret = auth_char->authorizeWrite (&write_auth_params);
1054
- if (ret!= AUTH_CALLBACK_REPLY_SUCCESS) {
1055
- return ret & 0xFF ;
1056
- }
1057
- }
1058
-
1059
1059
if (write_happened) {
1060
1060
GattWriteCallbackParams write_params = {
1061
1061
connId,
You can’t perform that action at this time.
0 commit comments