Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
protocol.h File Reference

|STX|length|... More...

#include <inttypes.h>
#include "std.h"
+ Include dependency graph for protocol.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  dc_shot_union
 
union  mora_status_union
 
struct  mora_status_union::mora_status_struct
 
struct  mora_transport
 
struct  dc_shot_union.data
 

Macros

#define MORA_SHOOT   1
 
#define MORA_SHOOT_MSG_SIZE   (4*10)
 
#define MORA_BUFFER_EMPTY   2
 
#define MORA_PAYLOAD   3
 
#define MORA_PAYLOAD_MSG_SIZE   70
 
#define MORA_STATUS   4
 
#define MORA_STATUS_MSG_SIZE   (4*2)
 
#define STX   0x99
 
#define MoraSizeOf(_payload)   (_payload+5)
 
#define MoraPutUint8(_byte)
 
#define MoraHeader(msg_id, payload_len)
 
#define MoraTrailer()
 
#define MoraPut1ByteByAddr(_byte)
 

Functions

void parse_mora (struct mora_transport *t, uint8_t c)
 

Variables

uint8_t mora_ck_a
 
uint8_t mora_ck_b
 
struct mora_transport mora_protocol
 

Detailed Description

|STX|length|...

payload=(length-4) bytes ...|Checksum A|Checksum B|

where checksum is computed over length and payload:

mora_ck_a = mora_ck_b = length
for each byte b in payload
mora_ck_a += b;

Definition in file protocol.h.


Data Structure Documentation

union dc_shot_union

Definition at line 52 of file protocol.h.

+ Collaboration diagram for dc_shot_union:
Data Fields
uint8_t bin[MORA_SHOOT_MSG_SIZE]
struct dc_shot_union data
int32_t i[10]
union mora_status_union

Definition at line 83 of file protocol.h.

+ Collaboration diagram for mora_status_union:
Data Fields
uint8_t bin[MORA_STATUS_MSG_SIZE]
struct mora_status_struct data
struct mora_status_union::mora_status_struct

Definition at line 84 of file protocol.h.

Data Fields
uint16_t cpu
uint16_t extra
uint16_t shots
uint16_t threads
struct mora_transport

Definition at line 129 of file protocol.h.

Data Fields
uint8_t ck_a
uint8_t ck_b
uint8_t error
uint8_t msg_id
uint8_t msg_received
uint8_t payload[256]
uint8_t payload_idx
uint8_t payload_len
uint8_t status
struct dc_shot_union.data

Definition at line 53 of file protocol.h.

Data Fields
int32_t alt
int32_t course
int32_t groundalt
int32_t lat
int32_t lon
int32_t nr
int32_t phi
int32_t psi
int32_t theta
int32_t vground

Macro Definition Documentation

#define MORA_BUFFER_EMPTY   2

Definition at line 69 of file protocol.h.

Referenced by main().

#define MORA_PAYLOAD   3

Definition at line 73 of file protocol.h.

Referenced by digital_cam_uart_event(), and send_msg_image_buffer().

#define MORA_PAYLOAD_MSG_SIZE   70

Definition at line 74 of file protocol.h.

Referenced by digital_cam_uart_event(), and send_msg_image_buffer().

#define MORA_SHOOT   1

Definition at line 46 of file protocol.h.

Referenced by dc_send_command(), and main().

#define MORA_SHOOT_MSG_SIZE   (4*10)

Definition at line 47 of file protocol.h.

Referenced by dc_send_command(), and main().

#define MORA_STATUS   4

Definition at line 79 of file protocol.h.

Referenced by digital_cam_uart_event(), and send_msg_status().

#define MORA_STATUS_MSG_SIZE   (4*2)

Definition at line 80 of file protocol.h.

Referenced by digital_cam_uart_event(), and send_msg_status().

#define MoraHeader (   msg_id,
  payload_len 
)
Value:
{ \
uint8_t msg_len = MoraSizeOf( payload_len); \
mora_ck_a = msg_len; mora_ck_b = msg_len; \
MoraPutUint8(msg_id); \
}
#define CameraLinkTransmit(_x)
Definition: std.h:7
#define MoraPutUint8(_byte)
Definition: protocol.h:102
uint8_t mora_ck_a
Definition: protocol.c:5
#define MoraSizeOf(_payload)
Definition: protocol.h:100
#define STX
Definition: protocol.h:98
unsigned char uint8_t
Definition: types.h:14
uint8_t mora_ck_b
Definition: protocol.c:5

Definition at line 108 of file protocol.h.

Referenced by dc_send_command(), send_msg_image_buffer(), and send_msg_status().

#define MoraPut1ByteByAddr (   _byte)
Value:
{ \
uint8_t _x = *(_byte); \
}
#define MoraPutUint8(_byte)
Definition: protocol.h:102
unsigned char uint8_t
Definition: types.h:14

Definition at line 121 of file protocol.h.

#define MoraPutUint8 (   _byte)
Value:
{ \
mora_ck_a += _byte; \
}
#define CameraLinkTransmit(_x)
Definition: std.h:7
uint8_t mora_ck_a
Definition: protocol.c:5
uint8_t mora_ck_b
Definition: protocol.c:5

Definition at line 102 of file protocol.h.

Referenced by dc_send_command(), send_msg_image_buffer(), and send_msg_status().

#define MoraSizeOf (   _payload)    (_payload+5)

Definition at line 100 of file protocol.h.

#define MoraTrailer ( )
Value:
{ \
}
#define CameraLinkTransmit(_x)
Definition: std.h:7
uint8_t mora_ck_a
Definition: protocol.c:5
uint8_t mora_ck_b
Definition: protocol.c:5

Definition at line 116 of file protocol.h.

Referenced by dc_send_command(), send_msg_image_buffer(), and send_msg_status().

#define STX   0x99

Definition at line 98 of file protocol.h.

Referenced by parse_mora(), and start_message().

Function Documentation

Variable Documentation

uint8_t mora_ck_a

Definition at line 5 of file protocol.c.

uint8_t mora_ck_b

Definition at line 5 of file protocol.c.

struct mora_transport mora_protocol

Definition at line 18 of file protocol.c.

Referenced by digital_cam_uart_event(), and main().