Diff between 758c4ebf3947aa329957d13efe712d3e207ede1a and 4f410864a88eff86145286ebf03fd82ec0961e30

Changed Files

File Additions Deletions Status
src/shared/att-types.h +5 -0 modified
src/shared/att.c +1 -1 modified
unit/test-gatt.c +1 -1 modified

Full Patch

diff --git a/src/shared/att-types.h b/src/shared/att-types.h
index ce531d1..ea4c009 100644
--- a/src/shared/att-types.h
+++ b/src/shared/att-types.h
@@ -27,6 +27,11 @@
 #define __packed __attribute__((packed))
 #endif
 
+#define BT_ATT_SECURITY_NONE	0
+#define BT_ATT_SECURITY_LOW	1
+#define BT_ATT_SECURITY_MEDIUM	2
+#define BT_ATT_SECURITY_HIGH	3
+
 #define BT_ATT_DEFAULT_LE_MTU	23
 #define BT_ATT_MAX_LE_MTU	517
 #define BT_ATT_MAX_VALUE_LEN	512
diff --git a/src/shared/att.c b/src/shared/att.c
index 3b37cdf..f24da18 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -1364,7 +1364,7 @@ bool bt_att_set_sec_level(struct bt_att *att, int level)
 {
 	struct bt_security sec;
 
-	if (!att || level < BT_SECURITY_LOW || level > BT_SECURITY_HIGH)
+	if (!att || level < BT_ATT_SECURITY_LOW || level > BT_ATT_SECURITY_HIGH)
 		return false;
 
 	if (!att->io_on_l2cap) {
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 415680b..caaacbd 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1002,7 +1002,7 @@ static void test_signed_write_seclevel(struct context *context)
 	g_assert(bt_att_set_local_key(context->att, key, local_counter,
 								context));
 
-	g_assert(bt_att_set_sec_level(context->att, BT_SECURITY_MEDIUM));
+	g_assert(bt_att_set_sec_level(context->att, BT_ATT_SECURITY_MEDIUM));
 
 	g_assert(bt_gatt_client_write_without_response(context->client,
 							step->handle,