CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
telecommand_types.h
Go to the documentation of this file.
1
2#ifndef INCLUDE_GUARD__TELECOMMAND_TYPES_H
3#define INCLUDE_GUARD__TELECOMMAND_TYPES_H
4
5#include <stdint.h>
6
7#define TCMD_MAX_RESP_FNAME_LEN 64
8
9typedef enum {
13
14 // Especially for commands which only work over the umbilical UART
16
17 // For commands like "test the flash memory", which corrupts the filesystem but is flight safe
19
20 // For commands which are intended for normal operation in flight
23
24typedef uint8_t (*TCMD_TCMDEXEC_Function_Ptr)(const char *args_str,
25 char *response_output_buf, uint16_t response_output_buf_len);
26
27typedef struct {
28 char* tcmd_name;
32 // TODO: maybe add other fields, including priority, expected execution duration, "config vs. action", etc.
33
35
36
37typedef struct {
39 uint8_t tcmd_idx;
40 char args_str_no_parens[255]; // TODO: consider changing this to a pointer, and storing the args somewhere else to save memory
48
49#endif // INCLUDE_GUARD__TELECOMMAND_TYPES_H
Definition telecommand_types.h:27
char * tcmd_name
Definition telecommand_types.h:28
TCMD_TCMDEXEC_Function_Ptr tcmd_func
Definition telecommand_types.h:29
uint8_t number_of_args
Definition telecommand_types.h:30
TCMD_readiness_level_enum_t readiness_level
Definition telecommand_types.h:31
Definition telecommand_types.h:37
char resp_fname[TCMD_MAX_RESP_FNAME_LEN]
Name of file that response should be written to, empty string otherwise.
Definition telecommand_types.h:46
char args_str_no_parens[255]
Definition telecommand_types.h:40
uint64_t timestamp_to_execute
The value of the @tsexec field when the telecommand was received.
Definition telecommand_types.h:44
uint8_t tcmd_idx
The index of the telecommand in the TCMD_telecommand_definitions array.
Definition telecommand_types.h:39
uint64_t timestamp_sent
The value of the @tssent field when the telecommand was received.
Definition telecommand_types.h:42
uint8_t(* TCMD_TCMDEXEC_Function_Ptr)(const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
Definition telecommand_types.h:24
TCMD_readiness_level_enum_t
Definition telecommand_types.h:9
@ TCMD_READINESS_LEVEL_FLIGHT_TESTING
Definition telecommand_types.h:18
@ TCMD_READINESS_LEVEL_FOR_OPERATION
Definition telecommand_types.h:21
@ TCMD_READINESS_LEVEL_IDEA_PHASE
Definition telecommand_types.h:10
@ TCMD_READINESS_LEVEL_NOT_IMPLEMENTED
Definition telecommand_types.h:11
@ TCMD_READINESS_LEVEL_IN_PROGRESS
Definition telecommand_types.h:12
@ TCMD_READINESS_LEVEL_GROUND_USAGE_ONLY
Definition telecommand_types.h:15
#define TCMD_MAX_RESP_FNAME_LEN
Definition telecommand_types.h:7