[PATCH BlueZ 2/3] thermometer: Fix handling of missing Temperature Type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



According to HTS 1.0, it is not mandatory to have Temperature Type
information (the Characteristic and the indication field are both
unconditionally optional).

Given there is no default value specified on the spec, we assume the
thermometer is for general use, and set the type to "Body".
---
 thermometer/thermometer.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 9bf9881..7906d84 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -1086,13 +1086,8 @@ static void proc_measurement(struct thermometer *t, const uint8_t *pdu,
 		type = temptype2str(pdu[index]);
 	} else if (t->has_type)
 		type = temptype2str(t->type);
-	else {
-		DBG("Can't get temperature type");
-		return;
-	}
-
-	if (type == NULL)
-		return;
+	else
+		type = "Body";
 
 	m.type = g_strdup(type);
 	m.value = final ? "Final" : "Intermediate";
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux