Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stereoprotocol.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Kirk + Roland
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
27 #ifndef SW_AIRBORNE_MODULES_STEREO_CAM_STEREOPROTOCOL_H_
28 #define SW_AIRBORNE_MODULES_STEREO_CAM_STEREOPROTOCOL_H_
29 
30 #include <inttypes.h>
31 #include "pprzlink/pprzlink_device.h"
32 
33 struct MsgProperties {
37 } ;
39 // function primitives
40 
45 
50 
55 uint8_t stereoprot_isEndOfMsg(uint8_t *stack, uint16_t i, uint16_t buffer_size);
56 
62 //void stereoprot_get_msg_properties(uint8_t *, MsgProperties *, uint16_t,uint16_t);
63 
64 uint8_t WritePart(struct link_device *, uint8_t *, uint8_t);
65 void stereoprot_sendArray(struct link_device *fd, uint8_t *b, uint8_t array_width, uint8_t array_height);
66 
72  uint16_t *msg_start, uint8_t *msg_buf, uint8_t *ser_read_buf, uint8_t *stereocam_datadata_new,
73  uint8_t *stereocam_datalen, uint8_t *stereocam_data_matrix_width, uint8_t *stereocam_data_matrix_height);
74 
78 void stereoprot_get_msg_properties(uint8_t *raw, MsgProperties *properties, uint16_t start, uint16_t buffer_size);
79 
80 
81 
82 
83 #endif /* SW_AIRBORNE_SUBSYSTEMS_GPS_STEREOPROTOCOL_H_ */
unsigned short uint16_t
Definition: types.h:16
uint16_t extract_loc
Definition: stereocam.c:55
uint8_t stereoprot_isEndOfMsg(uint8_t *stack, uint16_t i, uint16_t buffer_size)
Checks if the sequence in the array is equal to 255-0-0-171, as this means that this is the end of an...
uint8_t handleStereoPackage(uint8_t newByte, uint16_t buffer_size, uint16_t *insert_loc, uint16_t *extract_loc, uint16_t *msg_start, uint8_t *msg_buf, uint8_t *ser_read_buf, uint8_t *stereocam_datadata_new, uint8_t *stereocam_datalen, uint8_t *stereocam_data_matrix_width, uint8_t *stereocam_data_matrix_height)
Get all available data from stereo com link and decode any complete messages.
uint16_t insert_loc
Definition: stereocam.c:55
void stereoprot_sendArray(struct link_device *fd, uint8_t *b, uint8_t array_width, uint8_t array_height)
uint16_t msg_start
Definition: stereocam.c:55
int32_t counter
uint16_t positionImageStart
uint16_t stereoprot_diff(uint16_t counter, uint16_t i, uint16_t buffer_size)
Decrement circular buffer counter by i.
uint8_t stereoprot_isStartOfMsg(uint8_t *stack, uint16_t i, uint16_t buffer_size)
Checks if the sequence in the array is equal to 255-0-0-171, as this means a new image is starting fr...
unsigned char uint8_t
Definition: types.h:14
int fd
Definition: serial.c:26
void stereoprot_get_msg_properties(uint8_t *raw, MsgProperties *properties, uint16_t start, uint16_t buffer_size)
Retrieve size of image from message.
uint8_t WritePart(struct link_device *, uint8_t *, uint8_t)
uint8_t ser_read_buf[STEREO_BUF_SIZE]
Definition: stereocam.c:54
uint8_t msg_buf[STEREO_BUF_SIZE]
Definition: stereocam.c:56
uint16_t stereoprot_add(uint16_t counter, uint16_t i, uint16_t buffer_size)
Increment circular buffer counter by i.