Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_ccsds.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------------
2// CCSDS header.
3//-----------------------------------------------------------------------------------------
4// Copyright (c) 2016-2017 Princeton Satellite Systems. All rights reserved.
5//-----------------------------------------------------------------------------------------
6
7#ifndef __CCSDS__
8#define __CCSDS__
9
10#include <matrixlib/matrixlib.h>
11#include "sc_ccsds_data.h"
12#include <string>
13#include <unordered_map>
14
17
18
31class CCSDS
32{
33
34 public:
36 CCSDS( void );
37
39 void add_telemetry_point( double point );
40 void add_telemetry_point( int32_t point );
41 void add_telemetry_point( int16_t point );
42 void add_telemetry_point( int8_t point );
43 void add_telemetry_point( float point );
44 void add_telemetry_point( bool point );
45 void add_telemetry_point( ml_matrix& point );
46
47 int number_of_octets( void ){ return n_octets;};
48
50 void add_commands( char* file_name );
51
53 void set_telemetry_point_value( double point );
54 void set_telemetry_point_value( int32_t point );
55 void set_telemetry_point_value( int16_t point );
56 void set_telemetry_point_value( int8_t point );
57 void set_telemetry_point_value( float point );
58 void set_telemetry_point_value( bool point );
59 void set_telemetry_point_value( ml_matrix& point );
60
62 void set_packet_header( uint16_t version_number, uint16_t identification_field, uint16_t sequence_control_field )
63 {
64 this->version_number = version_number;
65 this->identification_field = identification_field;
66 this->sequence_control_field = sequence_control_field;
67 }
68
69 int16_t get_packet_leader( void ){ return packet_leader_field;};
70
71 int get_telemetry_point_type( char* name );
72
74 void receive_command( void *buffer );
75
77 bool has_new_command( void );
78
80 int command_data_type( void );
81
84 int32_t get_command_data_int32( void );
85 int16_t get_command_data_int16( void );
86 int8_t get_command_data_int8( void );
87 float get_command_data_float( void );
88 bool get_command_data_bool( void );
89 ml_matrix get_command_data_ml_matrix( void );
90
92 void create_frame( char* frame_name );
93 void output_frame( void *buffer );
94 void create_header( void );
95
96 protected:
97 uint16_t version_number;
98 uint16_t identification_field;
99 uint16_t sequence_control_field;
100 uint16_t packet_data_length;
101 uint16_t packet_leader_field;
102
103 std::unordered_map<std::string, ccsds_data> telemetry;
104
105 int n_octets;
106
107 void* header;
108};
109
110#endif
CCSDS space packet protocol.
Definition: sc_ccsds.h:32
void create_frame(char *frame_name)
Create a telemetry frame.
double get_command_data_double(void)
Command data.
void set_telemetry_point_value(double point)
Add a telemetry point.
Definition: sc_ccsds.cc:82
int command_data_type(void)
Indicates command data type.
void receive_command(void *buffer)
Receive a commmand.
void add_commands(char *file_name)
Add commands.
void set_packet_header(uint16_t version_number, uint16_t identification_field, uint16_t sequence_control_field)
Add header information.
Definition: sc_ccsds.h:62
bool has_new_command(void)
Indicates a new command is available.
CCSDS(void)
Constructor.
Definition: sc_ccsds.cc:19
void add_telemetry_point(double point)
Add telemetry points.
Definition: sc_ccsds.cc:45
Implements CCSDS_DATA.