You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2018/04/14 01:40:38 UTC
[mynewt-core] branch master updated: Sensor API: Support only one
event per notifier/notification (#1023)
This is an automated email from the ASF dual-hosted git repository.
vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 7fc8e45 Sensor API: Support only one event per notifier/notification (#1023)
7fc8e45 is described below
commit 7fc8e45c02da27334d64fcc92a4aa46277258719
Author: Vipul Rahane <vr...@gmail.com>
AuthorDate: Fri Apr 13 18:40:36 2018 -0700
Sensor API: Support only one event per notifier/notification (#1023)
- earlier this was multiplexin multiple events for a single notification
---
hw/sensor/src/sensor.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/hw/sensor/src/sensor.c b/hw/sensor/src/sensor.c
index 13ac10b..5ed314e 100644
--- a/hw/sensor/src/sensor.c
+++ b/hw/sensor/src/sensor.c
@@ -982,19 +982,13 @@ err:
}
static int
-sensor_set_notification(struct sensor *sensor)
+sensor_set_notification(struct sensor *sensor, struct sensor_notifier *notifier)
{
- sensor_event_type_t event_type;
- const struct sensor_notifier *notifier;
int rc;
- event_type = 0;
- SLIST_FOREACH(notifier, &sensor->s_notifier_list, sn_next) {
- event_type |= notifier->sn_sensor_event_type;
- }
-
if (sensor->s_funcs->sd_set_notification) {
- rc = sensor->s_funcs->sd_set_notification(sensor, event_type);
+ rc = sensor->s_funcs->sd_set_notification(sensor,
+ notifier->sn_sensor_event_type);
} else {
rc = SYS_ENODEV;
}
@@ -1033,7 +1027,7 @@ sensor_register_notifier(struct sensor *sensor,
SLIST_INSERT_HEAD(&sensor->s_notifier_list, notifier, sn_next);
- rc = sensor_set_notification(sensor);
+ rc = sensor_set_notification(sensor, notifier);
if (rc != 0) {
goto remove;
}
--
To stop receiving notification emails like this one, please contact
vipulrahane@apache.org.