COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
mixwtnc_lib.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
37 #ifndef _MIXWTNCLIB_H
38 #define _MIXWTNCLIB_H 1
39 
40 
41 #include "support/configCosmos.h"
42 
43 #include <stdio.h>
44 #include <errno.h>
45 
47 #include "support/cosmos-errno.h"
48 
49 #define MIXWTNC_MTU 254
50 #define MIXWTNC_PAYLOAD_SIZE MIXWTNC_MTU
51 
52 //#define MIXWTNC_PAYLOAD_SIZE 255
53 #define MIXWTNC_FULL_SIZE (MIXWTNC_PAYLOAD_SIZE+19)
54 #define AX25_FLAG 0x7E
55 #define AX25_NOLAYER3 0xF0
56 
57 #define MIXWTNC_ID 1
58 #define MIXWTNC_BAUD 19200
59 #define MIXWTNC_BITS 8
60 #define MIXWTNC_PARITY 0
61 #define MIXWTNC_STOPBITS 1
62 
63 typedef struct
64 {
65  union
66  {
67  struct
68  {
69  union
70  {
71  struct
72  {
73  uint8_t flag;
74  char destination_address[7];
75  char source_address[7];
76  uint8_t control;
77  uint8_t protocol_id;
78  } header;
79  uint8_t preamble[17];
80  };
81  uint8_t payload[MIXWTNC_PAYLOAD_SIZE+2];
82  } part;
83  uint8_t full[MIXWTNC_FULL_SIZE];
84  };
85  uint16_t size;
87 
88 typedef struct
89 {
92  uint8_t flag;
94 
95 int32_t mixwtnc_connect(char *dev, mixwtnc_handle *handle, uint8_t flag);
99 int32_t mixwtnc_loadframe(mixwtnc_handle *handle, uint8_t *data, uint16_t size);
100 int32_t mixwtnc_loadframe(mixwtnc_handle *handle, vector<uint8_t> data);
101 int32_t mixwtnc_unloadframe(mixwtnc_handle *handle, uint8_t *data, uint16_t size);
102 int32_t mixwtnc_unloadframe(mixwtnc_handle *handle, vector<uint8_t>& data);
103 int32_t mixwtnc_unloadframe(mixwtnc_frame *frame, vector<uint8_t>& data);
104 uint16_t mixwtnc_calc_fcs(uint8_t *data, uint16_t length);
107 
108 
109 #endif
vector< string > part
Definition: cubesat2obj.cpp:5
int32_t mixwtnc_unloadframe(mixwtnc_handle *handle, uint8_t *data, uint16_t size)
Definition: mixwtnc_lib.cpp:177
Definition: mixwtnc_lib.h:88
uint16_t mixwtnc_calc_fcs(uint8_t *data, uint16_t length)
Definition: mixwtnc_lib.cpp:67
#define MIXWTNC_FULL_SIZE
Definition: mixwtnc_lib.h:53
int32_t mixwtnc_enterkiss(mixwtnc_handle *handle)
Definition: mixwtnc_lib.cpp:231
uint8_t control
Definition: mixwtnc_lib.h:76
int32_t mixwtnc_sendframe(mixwtnc_handle *handle)
Definition: mixwtnc_lib.cpp:115
int32_t mixwtnc_loadframe(mixwtnc_handle *handle, uint8_t *data, uint16_t size)
Definition: mixwtnc_lib.cpp:125
Simple Serial library header file.
int32_t mixwtnc_disconnect(mixwtnc_handle *handle)
Definition: mixwtnc_lib.cpp:90
uint8_t protocol_id
Definition: mixwtnc_lib.h:77
#define MIXWTNC_PAYLOAD_SIZE
Definition: mixwtnc_lib.h:50
uint8_t flag
Definition: mixwtnc_lib.h:92
uint8_t flag
Definition: mixwtnc_lib.h:73
Headers and definitions common to all COSMOS.
uint16_t size
Definition: mixwtnc_lib.h:85
COSMOS Error Codes.
gige_handle * handle
Definition: kpc9612p_recv.cpp:33
mixwtnc_frame frame
Definition: mixwtnc_lib.h:91
int32_t mixwtnc_recvframe(mixwtnc_handle *handle)
Definition: mixwtnc_lib.cpp:98
png_uint_32 length
Definition: png.c:2173
Definition: mixwtnc_lib.h:63
frame
Definition: imu_stream_plot.py:340
int32_t mixwtnc_connect(char *dev, mixwtnc_handle *handle, uint8_t flag)
Definition: mixwtnc_lib.cpp:78
int32_t mixwtnc_exitkiss(mixwtnc_handle *handle)
Definition: mixwtnc_lib.cpp:223
Definition: cssl_lib.h:34
cssl_t * serial
Definition: mixwtnc_lib.h:90