Changes

5,609 bytes added ,  15:16, 2 November 2018
Line 1,786: Line 1,786:     
AVL data or events can be sent encapsulated in binary SMS. TP-DCS field of these SMS should indicate that message contains 8-bit data (for example: TP-DCS can be 0x04).
 
AVL data or events can be sent encapsulated in binary SMS. TP-DCS field of these SMS should indicate that message contains 8-bit data (for example: TP-DCS can be 0x04).
 +
 +
{| class="wikitable"
 +
|-
 +
! colspan="3" align="center" style="background: black; color: white;"|SM data (TP-UD)
 +
|-
 +
| AVL data array ||IMEI: 8 bytes
 +
|}
 +
 +
AVL data array – array of encoded AVL data
 +
 +
IMEI – IMEI of sending module encoded as a big endian 8-byte long number.
 +
 +
 +
*'''24 position SMS data protocol'''
 +
 +
 +
24-hour SMS is usually sent once every day and contains GPS data of last 24 hours. TP-DCS field of this SMS should indicate that message contains 8-bit data (i.e. TP-DCS can be 0x04).
 +
 +
Note, that 24 position data protocol is used only with subscribed SMS. Event SMS use standard AVL data protocol.
 +
 +
 +
'''Encoding'''
 +
 +
To be able to compress 24 GPS data entries into one SMS (140 octets), the data is encoded extensively using bit fields. Data packet can be interpreted as a bit stream, where all bits are numbered as follows:
 +
 +
 +
{| class="wikitable"
 +
|-
 +
!style="background: black; color: white;"| Byte 1 !!style="background: black; color: white;"| Byte 2 !!style="background: black; color: white;"| Byte 3 !!style="background: black; color: white;"| Bytes 4-…
 +
|-
 +
| Bits 0-7 || Bits 8-15 || Bits 16-24 || Bits 25-…
 +
|}
 +
 +
Bits in a byte are numbered starting from least significant bit. A field of 25 bits would consist of bits 0 to 24 where 0 is the least significant bit and bit 24 – most significant bit.
 +
 +
 +
'''Structure'''
 +
 +
{| class="wikitable "
 +
|-
 +
! colspan="4" align="center" style="background: black; color: white;"|SMS Data Structure
 +
|-
 +
| || 8 || Codec ID || Codec ID = 4
 +
|-
 +
| || 35 || Timestamp || Time corresponding to the first (oldest) GPS data element,
 +
 +
represented in seconds elapsed from 2000.01.01 00:00 EET.
 +
|-
 +
| || 5 || ElementCount || Number of GPS data elements
 +
|}
 +
 +
 +
 +
{| class="wikitable "
 +
|-
 +
! colspan="4" align="center" style="background: black; color: white;"|SMS Data Structure
 +
|-
 +
|ElementCount * ||  || GPSDataElement || GPS data elements.
 +
|-
 +
| ||  || Byte-aling padding || Padding bits to align to 8-bits boundary
 +
 +
represented in seconds elapsed from 2000.01.01 00:00 EET.
 +
|-
 +
| || 64 || IMEI || IMEI of sending device as 8-byte long integer
 +
|}
 +
The time of only the first GPS data element is specified in Timestamp field. Time corresponding to each further element can be computed as elementTime = Timestamp + (1 hour * elementNumber).
 +
 +
 +
{| class="wikitable "
 +
|-
 +
! colspan="5" align="center" style="background: black; color: white;"|GPSDataElement
 +
|-
 +
| ||  || Size (bits) || Field || Description
 +
|-
 +
| || || 1 || ValidElement || ValidElement=1 – there is a valid GpdDataElement following,
 +
ValidElement=0 – no element at this position
 +
|-
 +
| rowspan="8"| ValidElement == 1
 +
|-
 +
| || 1 || DifferentialCoords || Format of following data.
 +
|-
 +
| rowspan="3"| DifferentialCoords == 1
 +
|-
 +
| 14 || LongitudeDiff || Difference from previous element‘s longitude.
 +
LongitudeDiff = prevLongitude – Longitude + 213 – 1
 +
|-
 +
| 14 || LatitudeDiff || Difference from previous element‘s latitude
 +
LatitudeDiff = prevLatitude – Latitude + 213 – 1
 +
|-
 +
| rowspan="3"| DifferentialCoords == 0
 +
|-
 +
| 21 || Longitude || Longitude= {(LongDegMult + 18 * 108) * (221 –
 +
1)} over {36*108}
 +
|-
 +
| 20 || Latitude || Latitude=(LatDegMult + 9*108) * (220 – 1) over
 +
{18*108}
 +
|-
 +
| || || 8 || Speed || Speed in km/h
 +
|}
 +
 +
 +
Longitude - longitude field value of GPSDataElement
 +
 +
Latitude - latitude field value of GPSDataElement
 +
 +
LongDegMult - longitude in degrees multiplied by 107 (integer part)
 +
 +
LatDegMult latitude in degrees multiplied by 107 (integer part)
 +
 +
prevLongitude longitude field value of previous GPSDataElemen
 +
 +
prevLatitude latitude field value of previous GPSDataElement
 +
 +
 +
 +
*'''Decoding GPS position'''
 +
 +
 +
When decoding GPS data with DifferentialCoords=1, Latitude and Longitude values can be computed as follows: Longitude=prevLongitude – LongitudeDiff + 213 – 1, Latitude=prevLatitude – LatitudeDiff + 213 – 1.
 +
 +
If there were no previous non-differential positions, differential coordinates should be computed assuming prevLongitude=prevLatitude=0.
 +
 +
When Longitude and Latitude values are known, longitude and latitude representation in degrees can be computed as follows:
 +
 +
[[Image:f11.png|f11.png]]
 +
 +
 +
 +
*'''SMS Events'''
 +
 +
When Configured to generate SMS event user will get this SMS upon event
 +
 +
<Year/Month/Day> <Hour:Minute:Second> P:<profile_nr> <SMS Text> Val:<Event Value> Lon:<longitude> Lat:<latitude> Q:<HDOP>
 +
 +
Example:
 +
 +
2016./04/11 12:00:00 P:3 Digital Input 1 Val:1 Lon:51.12258 Lat: 25.7461 Q:0.6
 +
 +
{| class="wikitable"
 +
|-
 +
| No information available || 0 || Iceland || 1C
 +
|-
 +
| Austria  || 1 || Kazakhstan || 1D
 +
|-
 +
| Albania  || 2 || Luxembourg || 1E
 +
|-
 +
| Andorra || 3 || Lithuania || 1F
 +
|-
 +
| Armenia || 4 || Latvia || 20
 +
|-
 +
| Azerbaijan || 5 || Malta  || 21
 +
|-
 +
| Belgium || 6 || Monaco  || 22
 +
|-
 +
| Bulgaria || 7 || Republic of Moldova || 23
 +
|-
 +
| Bosnia and Herzegovina || 8 || Macedonia || 24
 +
|-
 +
| Belarus  || 9 || Norway || 25
 +
|-
 +
| Switzerland || 0A || Netherlands || 26
 +
|-
 +
| Cyprus || 0B || Portugal || 27
 +
|-
 +
| Czech Republic || 0C || Poland  || 28
 +
|-
 +
| Germany || 0D || Romania || 29
 +
|-
 +
| Denmark || 0E || San Marino || 2A
 +
|-
 +
| Spain  || 0F || Russian Federation || 2B
 +
|-
 +
| Estonia || 10 || Sweden || 2C
 +
|-
 +
| France || 11 || Slovakia || 2D
 +
|-
 +
| Finland || 12 || Slovenia || 2E
 +
|-
 +
| Liechtenstein || 13 || Turkmenistan  || 2F
 +
|-
 +
| Faeroe Islands|| 14 || Turkey || 30
 +
|-
 +
| United Kingdom || 15 || Ukraine || 31
 +
|-
 +
| Georgia || 16 || Vatican City || 32
 +
|-
 +
| Greece || 17 || Yugoslavia || 33
 +
|-
 +
| Hungary || 18 || RFU || 34..FC
 +
|-
 +
| Croatia || 19 || European Community || FD
 +
|-
 +
| Italy || 1A || Example || FE
 +
|-
 +
| Ireland || 1B || Rest of the world || FF
 +
|}

Navigation menu