aboutsummaryrefslogtreecommitdiff
path: root/tools/test-generator.py
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-14 14:06:06 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-14 14:06:06 +0500
commitb6a318daabbaf485e327cab77adba98413462516 (patch)
tree85310d380accd48fac59141f7383dc311db92e59 /tools/test-generator.py
parentb6ac9da5428f1177df360cdbfc58d219d3230a10 (diff)
downloadtrackermap-server-b6a318daabbaf485e327cab77adba98413462516.tar.gz
trackermap-server-b6a318daabbaf485e327cab77adba98413462516.tar.bz2
trackermap-server-b6a318daabbaf485e327cab77adba98413462516.zip
Use driverUniqueId instead of rfid in test script and OsmAnd protocol
Diffstat (limited to 'tools/test-generator.py')
-rwxr-xr-xtools/test-generator.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/test-generator.py b/tools/test-generator.py
index 47c1c478f..41ec5a2fa 100755
--- a/tools/test-generator.py
+++ b/tools/test-generator.py
@@ -35,7 +35,7 @@ for i in range(0, len(waypoints)):
lon = lon1 + (lon2 - lon1) * j / count
points.append((lat, lon))
-def send(conn, lat, lon, course, speed, alarm, ignition, accuracy, rpm, fuel, rfid):
+def send(conn, lat, lon, course, speed, alarm, ignition, accuracy, rpm, fuel, driverUniqueId):
params = (('id', id), ('timestamp', int(time.time())), ('lat', lat), ('lon', lon), ('bearing', course), ('speed', speed))
if alarm:
params = params + (('alarm', 'sos'),)
@@ -47,8 +47,8 @@ def send(conn, lat, lon, course, speed, alarm, ignition, accuracy, rpm, fuel, rf
params = params + (('rpm', rpm),)
if fuel:
params = params + (('fuel', fuel),)
- if rfid:
- params = params + (('rfid', rfid),)
+ if driverUniqueId:
+ params = params + (('driverUniqueId', driverUniqueId),)
conn.request('GET', '?' + urllib.urlencode(params))
conn.getresponse().read()
@@ -74,7 +74,7 @@ while True:
accuracy = 100 if (index % 10) == 0 else 0
rpm = random.randint(500, 4000)
fuel = random.randint(0, 80)
- rfid = driver_id if (index % len(points)) == 0 else False
- send(conn, lat1, lon1, course(lat1, lon1, lat2, lon2), speed, alarm, ignition, accuracy, rpm, fuel, rfid)
+ driverUniqueId = driver_id if (index % len(points)) == 0 else False
+ send(conn, lat1, lon1, course(lat1, lon1, lat2, lon2), speed, alarm, ignition, accuracy, rpm, fuel, driverUniqueId)
time.sleep(period)
index += 1