Diff between 73dd85a18b13d3e9cdef86079d759418037ff070 and faca31657e1b0cec0e03bbb7bf0e2d81222079d4

Changed Files

File Additions Deletions Status
src/shared/bass.c +2 -2 modified
unit/test-bass.c +1 -0 modified

Full Patch

diff --git a/src/shared/bass.c b/src/shared/bass.c
index f65e1ea..36bb9ea 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -1223,7 +1223,7 @@ static void bcast_recv_new(struct bt_bass_db *bdb, int i)
 	bt_uuid16_create(&uuid, BCAST_RECV_STATE_UUID);
 	bcast_recv_state->attr =
 		gatt_db_service_add_characteristic(bdb->service, &uuid,
-				BT_ATT_PERM_READ,
+				BT_ATT_PERM_READ | BT_ATT_PERM_READ_ENCRYPT,
 				BT_GATT_CHRC_PROP_READ |
 				BT_GATT_CHRC_PROP_NOTIFY,
 				bass_bcast_recv_state_read, NULL,
@@ -1252,7 +1252,7 @@ static void bass_new(struct bt_bass_db *bdb)
 	bdb->bcast_audio_scan_cp =
 		gatt_db_service_add_characteristic(bdb->service,
 				&uuid,
-				BT_ATT_PERM_WRITE,
+				BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_ENCRYPT,
 				BT_GATT_CHRC_PROP_WRITE |
 				BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP,
 				NULL, bass_bcast_audio_scan_cp_write,
diff --git a/unit/test-bass.c b/unit/test-bass.c
index 8983569..8d914cf 100644
--- a/unit/test-bass.c
+++ b/unit/test-bass.c
@@ -653,6 +653,7 @@ static void test_server(const void *user_data)
 	att = bt_att_new(io_get_fd(io), false);
 	g_assert(att);
 
+	bt_att_set_security(att, BT_ATT_SECURITY_MEDIUM);
 	bt_att_set_debug(att, BT_ATT_DEBUG, print_debug, "bt_att:", NULL);
 
 	data->db = gatt_db_new();