Defaults

  • Read/Write timeout for file transfer: 30000 (30 seconds)
  • Packet size for file transfer: 131072 (128 KiB)
  • File transfer max sequence size: 800 (Packets)

Terminology

  • Sequence: Size is Packet size for file transfer multiplied by File transfer max sequence size
  • File Part: Size is Packet size for file transfer.

How-to guide

1) Request a file flash
2) Divide the file into sequences
3) Begin file sequence flash
4) Divide the sequence into file parts
5) Send the file part (in raw format)
6) Read the file part response
7) Send End file sequence flash:

  • If you finished sending file parts
  • Send the AP/CP packet accordingly

8) Repeat until the end of the file

Documentation

Compressed file transfer

If you see something like 0x00/0x05, it means that you should
use the left one for uncompressed data, and the right one for
LZ4 compressed data. A lot easier than manual decompressing.

Request file flash

Request:

ValueArgument TypeInformation
0x6632-bit integerPacket type
0x00/0x0532-bit integerPacket’s command.

Response:

ValueArgument TypeInformation
0x6632-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. Is always zero.

Begin file sequence flash

Request:

ValueArgument TypeInformation
0x6632-bit integerPacket type
0x02/0x0632-bit integerPacket’s command
dynamic32-bit integerLength (in bytes)

Response:

ValueArgument TypeInformation
0x6632-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. May not be zero.

Flash a file part

Send an empty packet for the first file part.
Request:

ValueArgument TypeInformation
dynamicRaw byte bufferFile Part buffer

Response:

ValueArgument TypeInformation
0x6632-bit integerPacket type, would be 0xFF on failure
dynamic32-bit integerCurrent file part index on LOKE’s side

End file sequence flash: MODEM

Last sequence should be 1 for true, 0 for false.
Send an empty packet before and after.
Request:

ValueArgument TypeInformation
0x6632-bit integerPacket type
0x03/0x0732-bit integerPacket’s command
0x0132-bit integerModem/CP
dynamic32-bit integerSequence byte length
dynamic32-bit integerBinary Type (PIT)
dynamic32-bit integerDevice Type (PIT)
dynamic32-bit integerIs last sequence

Response:

ValueArgument TypeInformation
0x6632-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. May not be zero.

End file sequence flash: PHONE

Last sequence should be 1 for true, 0 for false.
Send an empty packet before and after.
Request:

ValueArgument TypeInformation
0x6632-bit integerPacket type
0x03/0x0732-bit integerPacket’s command
0x0032-bit integerPhone/AP
dynamic32-bit integerSequence byte length
dynamic32-bit integerBinary Type (PIT)
dynamic32-bit integerDevice Type (PIT)
dynamic32-bit integerPartition Identifier (PIT)
dynamic32-bit integerIs last sequence

Response:

ValueArgument TypeInformation
0x6632-bit integerPacket type, would be 0xFF on failure
0x0032-bit integerStatus code. May not be zero.