aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/events/OverspeedEventHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-21 18:33:38 +1300
committerGitHub <noreply@github.com>2016-12-21 18:33:38 +1300
commit48f83827701d06c3c2eab7d051a5f011cc42f65d (patch)
tree8bdfcc28e5ff7644d8c00ba045cbe4520f04521d /src/org/traccar/events/OverspeedEventHandler.java
parentda094cc974c545424c843d44d27711ac014d533d (diff)
parent40b74ef0eb357c51034d38fd6ff135f28f5406a9 (diff)
downloadtrackermap-server-48f83827701d06c3c2eab7d051a5f011cc42f65d.tar.gz
trackermap-server-48f83827701d06c3c2eab7d051a5f011cc42f65d.tar.bz2
trackermap-server-48f83827701d06c3c2eab7d051a5f011cc42f65d.zip
Merge pull request #2719 from Abyss777/additional_event_attributes
Add attributes to overspeed and maintenance events
Diffstat (limited to 'src/org/traccar/events/OverspeedEventHandler.java')
-rw-r--r--src/org/traccar/events/OverspeedEventHandler.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/events/OverspeedEventHandler.java b/src/org/traccar/events/OverspeedEventHandler.java
index 67aa0e758..00c3845d2 100644
--- a/src/org/traccar/events/OverspeedEventHandler.java
+++ b/src/org/traccar/events/OverspeedEventHandler.java
@@ -59,8 +59,10 @@ public class OverspeedEventHandler extends BaseEventHandler {
}
}
if (speed > speedLimit && oldSpeed <= speedLimit) {
- return Collections.singleton(
- new Event(Event.TYPE_DEVICE_OVERSPEED, position.getDeviceId(), position.getId()));
+ Event event = new Event(Event.TYPE_DEVICE_OVERSPEED, position.getDeviceId(), position.getId());
+ event.set("speed", speed);
+ event.set(ATTRIBUTE_SPEED_LIMIT, speedLimit);
+ return Collections.singleton(event);
}
return null;
}