Skip to content

Commit

Permalink
ble/gatt_client: reject wrong configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
milamikica committed Apr 18, 2024
1 parent 8182555 commit 8915696
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ble/gatt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2607,6 2607,10 @@ uint8_t gatt_client_write_client_characteristic_configuration(btstack_packet_han
return status;
}

if (configuration > 3){
return ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
}

if ( (configuration & GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION) &&
((characteristic->properties & ATT_PROPERTY_NOTIFY) == 0u)) {
log_info("gatt_client_write_client_characteristic_configuration: GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED");
Expand Down

0 comments on commit 8915696

Please sign in to comment.