aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2014-10-09 20:17:48 -0400
committerjon-stumpf <jon.stumpf@gmail.com>2014-10-10 00:49:19 -0400
commit47843be139e6c797954c87043a80bf40e242f70d (patch)
treebd51eb5e938cff84ee072769f979c80eafb5e761 /tools
parent21d69f45cd5badf52e175fc234c5c7bd3c2aeb35 (diff)
downloadtraccar-server-47843be139e6c797954c87043a80bf40e242f70d.tar.gz
traccar-server-47843be139e6c797954c87043a80bf40e242f70d.tar.bz2
traccar-server-47843be139e6c797954c87043a80bf40e242f70d.zip
Added comments to scripts in tools/
Diffstat (limited to 'tools')
-rwxr-xr-xtools/demo.sh11
-rwxr-xr-xtools/hex.sh11
-rwxr-xr-xtools/test.sh11
3 files changed, 32 insertions, 1 deletions
diff --git a/tools/demo.sh b/tools/demo.sh
index 50e48e496..f161858ac 100755
--- a/tools/demo.sh
+++ b/tools/demo.sh
@@ -1,3 +1,13 @@
+#
+# This test data assumes device "123456789012345" exists.
+#
+# INSERT INTO device ( name, uniqueid )
+# VALUES ( 'Test Device 1', 123456789012345 );
+#
+# Note: Not all shells support "echo -e" (e.g., dash, the default on Ubuntu).
+# This will cause an unknown device error for "-e". bash works.
+#
+
(echo -n -e "\
\$PGID,123456789012345*06\r\n\
\$GPRMC,184332.07,A,1929.459,S,02410.381,E,74.00,16.78,210410,0.0,E,A*2B\r\n\
@@ -22,4 +32,3 @@
\$GPRMC,184448.08,A,1927.962,S,02410.832,E,74.00,16.78,210410,0.0,E,A*26\r\n\
";) | nc -v localhost 5005
-
diff --git a/tools/hex.sh b/tools/hex.sh
index 16a34b0d8..6e008b027 100755
--- a/tools/hex.sh
+++ b/tools/hex.sh
@@ -1,2 +1,13 @@
+#
+# This test data assumes device "352964051908664" exists.
+#
+# INSERT INTO device ( name, uniqueid )
+# VALUES ( 'Test Device for hex.sh', 352964051908664 );
+#
+# Note: Not all shells support "echo -e" (e.g., dash - default on Ubuntu).
+# This will cause an unknown device error for "-e".
+#
+
echo 234c233335323936343035313930383636343b4e410d0a2342233131303931343b3130323133323b353032372e35303732383b4e3b30333032362e32303336393b453b312e3937393b3238382e3137303b4e413b4e413b4e413b4e413b4e413b3b4e413bd091d0b0d182d0b0d180d0b5d18f3a333a31303020250d0a | perl -ne 's/([0-9a-f]{2})/print chr hex $1/gie' | nc -v -w 10 localhost 5039
#echo -n -e "\x0f\x00\x00\x00\x4e\x52\x30\x39\x46\x30\x34\x31\x35\x35\x00" >/dev/udp/localhost/5053
+
diff --git a/tools/test.sh b/tools/test.sh
index b9a5c6f3b..267d69161 100755
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -1,4 +1,15 @@
+#
+# This test data assumes three devices exist:
+#
+# INSERT INTO device ( name, uniqueid ) VALUES
+# ( 'Test Device 1', 123456789012345 ),
+# ( 'Test Device 2', 123456789012 ),
+# ( 'Test Device 3', 123456 );
+#
+# Note: Not all shells support "echo -e" (e.g., dash, the default on Ubuntu).
+# This will cause an unknown device error for "-e". bash works.
+
# testing data:
# ids - 123456789012345 (32), 123456789012 (1), 123456 (2)
# time - 12:00 + X min (where X is protocol number)