diff options
author | Santiago Carot-Nemesio <sancane@gmail.com> | 2011-12-09 19:19:01 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-12-15 13:24:18 +0200 |
commit | 3ff4427f399f13e126185e9e429752a2fc524a9b (patch) | |
tree | d0f79880ffc0be7d0a4738d04787d630084f3bc8 /thermometer/thermometer.c | |
parent | c275bde366db4da6319043f048e1add572dc9dbc (diff) | |
download | bluez-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/thermometer.c')
-rw-r--r-- | thermometer/thermometer.c | 11 |
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) |