aboutsummaryrefslogtreecommitdiff
path: root/tools/test-generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test-generator.py')
-rwxr-xr-xtools/test-generator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/test-generator.py b/tools/test-generator.py
index 41a32a565..0b8e4113c 100755
--- a/tools/test-generator.py
+++ b/tools/test-generator.py
@@ -32,10 +32,12 @@ for i in range(0, len(waypoints)):
lon = lon1 + (lon2 - lon1) * j / count
points.append((lat, lon))
-def send(conn, lat, lon, course, alarm):
+def send(conn, lat, lon, course, alarm, ignition):
params = (('id', id), ('timestamp', int(time.time())), ('lat', lat), ('lon', lon), ('bearing', course))
if alarm:
params = params + (('alarm', 'sos'),)
+ if ignition:
+ params = params + (('ignition', 'true'),)
conn.request('GET', '?' + urllib.urlencode(params))
conn.getresponse().read()
@@ -56,6 +58,7 @@ while True:
(lat1, lon1) = points[index % len(points)]
(lat2, lon2) = points[(index + 1) % len(points)]
alarm = ((index % 10) == 0)
- send(conn, lat1, lon1, course(lat1, lon1, lat2, lon2), alarm)
+ ignition = ((index % len(points)) != 0)
+ send(conn, lat1, lon1, course(lat1, lon1, lat2, lon2), alarm, ignition)
time.sleep(period)
index += 1