Diff between eb0d86a71f20115dcf1609a0d1dd49aa0af1bf59 and 44bc8f5572f04f128903beabfc225122bc01bbfc

Changed Files

File Additions Deletions Status
proximity/monitor.c +9 -3 modified

Full Patch

diff --git a/proximity/monitor.c b/proximity/monitor.c
index 6470db4..ca19a8f 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -53,6 +53,12 @@
 
 #define ALERT_LEVEL_CHR_UUID 0x2A06
 
+enum {
+	ALERT_NONE = 0,
+	ALERT_MILD,
+	ALERT_HIGH,
+};
+
 struct monitor {
 	struct btd_device *device;
 	GAttrib *attrib;
@@ -116,11 +122,11 @@ static char *read_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
 static uint8_t str2level(const char *level)
 {
 	if (g_strcmp0("high", level) == 0)
-		return 0x02;
+		return ALERT_HIGH;
 	else if (g_strcmp0("mild", level) == 0)
-		return 0x01;
+		return ALERT_MILD;
 
-	return 0x00;
+	return ALERT_NONE;;
 }
 
 static void char_discovered_cb(GSList *characteristics, guint8 status,