att_db_util: fix permission encoding

This commit is contained in:
Matthias Ringwald 2018-04-30 11:41:56 +02:00
parent 15f22304d2
commit 8bea14f288

View File

@ -181,13 +181,13 @@ static uint16_t att_db_util_encode_permissions(uint16_t properties, uint8_t read
if (read_permission & 1){ if (read_permission & 1){
flags |= ATT_PROPERTY_READ_PERMISSION_BIT_0; flags |= ATT_PROPERTY_READ_PERMISSION_BIT_0;
} }
if (read_permission & 1){ if (read_permission & 2){
flags |= ATT_PROPERTY_READ_PERMISSION_BIT_1; flags |= ATT_PROPERTY_READ_PERMISSION_BIT_1;
} }
if (write_permission & 1){ if (write_permission & 1){
flags |= ATT_PROPERTY_WRITE_PERMISSION_BIT_0; flags |= ATT_PROPERTY_WRITE_PERMISSION_BIT_0;
} }
if (write_permission & 1){ if (write_permission & 2){
flags |= ATT_PROPERTY_WRITE_PERMISSION_BIT_1; flags |= ATT_PROPERTY_WRITE_PERMISSION_BIT_1;
} }
return flags; return flags;