BT IOTM output command generation

BT IOTM output command generation

Taken from https://docs.google.com/document/d/1OCEyY5iAkspshI1NhnuIwthS2CVOhe314ujgJ6qTO20/edit#heading=h.bvqmpi5mcb1o

Note: This output control structure must only have the output control record type. IMEI record type must not be added as device ID is stored in the access token.

All fields in the message are little-endian.

BT output control structure

BT output control structure

Element name

No. of bytes

Comment

Example value

Record type

1

Type of record 

04

Record length

2

The remaining length of the record

0A 00

Expiry time

4

This field describes the period of output command validity (UTC time)

(example value Monday, September 4, 2017 7:27:12 AM)

50 00 AD 59

Output ID

1

Output identifier

00

Unique ID

1

Field is used to prevent repeated output command run. Each output command must have different Unique ID field in order to run commands.

CC

Command length

1

Length is used to describe Output data field size

3

Output data

*

For structure of this field please refer to section 8.

00 00 05

Example of output payload that can be used to turn on OUT1 for 1 second is given below:

02 04 0A 00 50 00 AD 59 00 11 03 00 64 00 DE

Example value

Description

02

Structure version

04

Record type (Output control)

0A 00

Remaining length of Output control record (10 bytes)

50 00 AD 59

Expiration. Command is valid until provided time in UTC format.

00

Output identifier (According to section 8. 00 Output stands for OUT1)

11

Unique identifier which is used to prevent duplicate output command run

03

Output command length in bytes

00 64 00

Output data. For structure please refer to section 8.

DE

Sum of all bytes starting with structure version

 

Output data structures

Output data structures

Output ID

Output name

Length

Data

00

OUT1

3

Function ID 00

Data B0 B1

Description Turn output off for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

Function ID 01

Data B0 B1

Description Turn output on for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

01

OUT2

3

Function ID 00

Data B0 B1

Description Turn output off for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

Function ID 01

Data B0 B1

Description Turn output on for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

02

OUT3

3

Function ID 00

Data B0 B1

Description Turn output off for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

Function ID 01

Data B0 B1

Description Turn output on for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

03

OUT4

3

Function ID 00

Data B0 B1

Description Turn output off for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

Function ID 01

Data B0 B1

Description Turn output on for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

04

OUT5

3

Function ID 00

Data B0 B1

Description Turn output off for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

Function ID 01

Data B0 B1

Description Turn output on for a period that is specified in data field (10ms resolution)

Output data field is combination of Function ID and Data fields

05

UNLOCK OVER CAN

2

Data B0 B1

Description Data field contains 16bit CAN output command ID

06

LOCK OVER CAN

2

Data B0 B1

Description Data field contains 16bit CAN output command ID

07

REMOTE DUMP COMMAND

1

Data 01

Description Forces device to log data from CAN1 for up to 20 seconds.

Data 02

Description Forces device to log data from CAN2 bus for up to 20 seconds.

08

STATIC SIGNAL1 CONTROL

1

Data 01

Description 01 is used to set static signal to 1. Any other data will change static signal state to 0.

09

STATIC SIGNAL2 CONTROL

1

Data 01

Description 01 is used to set static signal to 1. Any other data will change static signal state to 0.

0A

STATIC SIGNAL3 CONTROL

1

Data 01

Description 01 is used to set static signal to 1. Any other data will change static signal state to 0.

0B

STATIC SIGNAL4 CONTROL

1

Data 01

Description 01 is used to set static signal to 1. Any other data will change static signal state to 0.

0C

STATIC SIGNAL5 CONTROL

1

Data 01

Description 01 is used to set static signal to 1. Any other data will change static signal state to 0.

0D

SCRIPT REMOTE COMMAND

n

Any data that is received over Script remote 

 

command is passed directly to script that has initialised Remote commands. Command length cannot exceed 255 bytes.

0E

DEVICE RESET COMMAND

1

Data 00

Description Always send 00 with this output command to reset device.

0F

DEVICE RECORDS FORMAT COMMAND

1

Data 00

Description Always send 00 with this output command to format device records.

10

DEVICE EVENTS FORMAT COMMAND

1

Data 00

Description Always send 00 with this output command to format device events.

11

DEVICE AND EVENTS FORMAT COMMAND

1

Data 00

Description Always send 00 with this output command to format device records together with events.

12

FORCE CONNECT TO FMSET COMMAND

1

Data 00

Description Always send 00 with this output command to force device to connect to fmset and check settings state immediately.

13

GPS RESET COMMAND

1

Data 00

Description Always send 00 with this output command to reset device’s GPS receiver.

14

ODOMETER SET COMMAND

4

Data 00 00 FA 42

Description Output data is a float value that represents odometer value that has to be set. (125 in this example)

15

TACHOGRAPH

COMMAND

1

Description

01 - Force download driver card 1

02 - Force download driver card 2

03 - Force download DDD driver 1

04 - Force download DDD driver 2