aboutsummaryrefslogtreecommitdiffstats
path: root/thermometer
diff options
context:
space:
mode:
authorSantiago Carot-Nemesio <sancane@gmail.com>2011-12-09 19:19:01 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2011-12-15 13:24:18 +0200
commit3ff4427f399f13e126185e9e429752a2fc524a9b (patch)
treed0f79880ffc0be7d0a4738d04787d630084f3bc8 /thermometer
parentc275bde366db4da6319043f048e1add572dc9dbc (diff)
downloadbluez-3ff4427f399f13e126185e9e429752a2fc524a9b.tar.gz
bluez-3ff4427f399f13e126185e9e429752a2fc524a9b.tar.xz
bluez-3ff4427f399f13e126185e9e429752a2fc524a9b.zip
thermometer: Process measurement interval indications
This patch emits PropertyChange signal whenever a new value is set in the measurement interval characteristic.
Diffstat (limited to 'thermometer')
-rw-r--r--thermometer/thermometer.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 64ac26fb..bc05edc4 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -1083,7 +1083,16 @@ static void proc_measurement(struct thermometer *t, const uint8_t *pdu,
static void proc_measurement_interval(struct thermometer *t, const uint8_t *pdu,
uint16_t len)
{
- DBG("TODO: Process measurements interval indication");
+ guint16 interval;
+
+ if (len < 5) {
+ DBG("Measurement interval value is not provided");
+ return;
+ }
+
+ interval = att_get_u16(&pdu[3]);
+
+ change_property(t, "Interval", &interval);
}
static void ind_handler(const uint8_t *pdu, uint16_t len, gpointer user_data)