Unterschiede zwischen den Revisionen 21 und 22
Revision 21 vom 23.11.2008 14:34
Größe: 2177
Autor: ligi
Kommentar: add some info on data format
Revision 22 vom 23.11.2008 14:34
Größe: 2179
Autor: ligi
Kommentar: moving links sections to bottom
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 23: Zeile 23:
= Links =
 * http://mikrokopter.de/forum/topic-1735-1.html ( german )
Zeile 32: Zeile 30:
= Links =
 * http://mikrokopter.de/forum/topic-1735-1.html ( german )

TableOfContents

Protocol

  • The protocol is based on individual serial data frames that are organized as shown in the following table.

Start-Byte

Address-Byte

ID-Byte

n Data-Bytes coded

CRC-Byte1

CRC-Byte2

Stop-Byte

'#'

variable

'V','D' etc

"modified-base64"

variable

variable

'\r'

Commands

  • The Commands based on the dataframes above are listed [:en/SerialCommands:here]

Slave Adresses

  • Since Navi 0.12h FC 0.71f Mag 0.19 there are constant SlaveAdresses:

Slave-Address

Part

1

FC

2

NC

3

MK3MAG

Data Format

  • Have a look into the Functions Decode64 and SendOutData in uart.c of the FC Firmware to see how the Data is encoded and decoded.

  • /!\ ToDo: describe data-format

Checksum

  • unsigned int tmpCRC = 0; BR for(int i = 0; i < DataBufferLength;i++)BR { tmpCRC += DataBuffer[i]; } BR tmpCRC %= 4096; BR CRC1 = '=' + tmpCRC / 64; BR CRC2 = '=' + tmpCRC % 64;BR

  • /!\ ToDo: describe checksum calculation verbaly

Implementations

  • Sometimes its a lot more easy to look at code rather than reather than to look at Specifications/Documentation:
  • uart.c in the Flight-Ctrl Firmware ( C )
  • MKCommunicator.java from ["DUBwise"] ( Java / J2ME )
  • mktool.cpp @ ["QMKGroundStation"] ( C++ )
  • GroundStation ( LabView )

Links