CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
uart_telecommand_defs.h File Reference
Include dependency graph for uart_telecommand_defs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint8_t TCMDEXEC_uart_send_hex_get_response_hex (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Send arbitrary commands to a UART peripheral, and receive the response.
 
uint8_t TCMDEXEC_uart_get_last_rx_times_json (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Get a JSON dict of how long, in ms, SINCE each UART ISR handler was last triggered.
 
uint8_t TCMDEXEC_uart_set_baud_rate (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 

Function Documentation

◆ TCMDEXEC_uart_get_last_rx_times_json()

uint8_t TCMDEXEC_uart_get_last_rx_times_json ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Get a JSON dict of how long, in ms, SINCE each UART ISR handler was last triggered.

Note
Uses placeholder "-99" to mean "never triggered". A value of 50 means that handler was last triggered 50ms ago.
Intended for debugging and testing purposes, but safe to use in flight also.

◆ TCMDEXEC_uart_send_hex_get_response_hex()

uint8_t TCMDEXEC_uart_send_hex_get_response_hex ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Send arbitrary commands to a UART peripheral, and receive the response.

Parameters
args_str
  • Arg 0: UART port name to send data to: MPI, GNSS, CAMERA, EPS (case insensitive)
  • Arg 1: Data to be sent (bytes specified as hex - Max 5KiB buffer)
response_output_bufThe buffer to write the response to
response_output_buf_lenThe maximum length of the response_output_buf (its size)
Returns
0: Success, 1: Error parsing args, 2: Invalid uart port requested, 3: Error transmitting data, 4: Error receiving data, 5: Timeout waiting for response / No response, 6: Peripheral specific error, 7: Unhandled error
Note
This function doesn't toggle the EPS power lines for peripherals. Ensure they are powered on before using this function.
The camera UART port does not support receiving data in the function. TX only.
Here is the call graph for this function:

◆ TCMDEXEC_uart_set_baud_rate()

uint8_t TCMDEXEC_uart_set_baud_rate ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )
Here is the call graph for this function: