CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
gnss_internal_drivers.c File Reference
#include "main.h"
#include "debug_tools/debug_uart.h"
#include "debug_tools/debug_i2c.h"
#include "gnss_receiver/gnss_internal_drivers.h"
#include "gnss_receiver/gnss_firehose_storage.h"
#include "uart_handler/uart_handler.h"
#include "stm32/stm32_timing_helpers.h"
#include "log/log.h"
#include "timekeeping/timekeeping.h"
#include <stdint.h>
#include <string.h>
Include dependency graph for gnss_internal_drivers.c:

Functions

static uint8_t GNSS_send_cmd_get_response_when_firehose_storage_disabled (const char *cmd_buf, uint8_t cmd_buf_len, uint8_t rx_buf[], const uint16_t rx_buf_max_size, uint16_t *rx_buf_len_dest, uint8_t remove_null_bytes_in_middle)
 Sends a log command to the GNSS, and receives the response.
uint8_t GNSS_send_cmd_get_response (const char *cmd_buf, uint8_t cmd_buf_len, uint8_t rx_buf[], const uint16_t rx_buf_max_size, uint16_t *rx_buf_len_dest, uint8_t remove_null_bytes_in_middle)
 Sends a log command to the GNSS, and receives the response.
const char * GNSS_rx_mode_enum_to_str (GNSS_rx_mode_enum_t rx_mode)

Variables

UART_HandleTypeDef * UART_gnss_port_handle
const uint32_t GNSS_RX_TIMEOUT_BEFORE_FIRST_BYTE_MS = 800
GNSS_rx_mode_enum_t GNSS_current_rx_mode = GNSS_RX_MODE_DISABLED
uint32_t GNSS_write_cmd_mode_data_to_firehose_file = 1
 Boolean. Whether to store command-mode GNSS data to the firehose file.
const uint32_t GNSS_RX_TIMEOUT_BETWEEN_BYTES_MS = 2500

Function Documentation

◆ GNSS_rx_mode_enum_to_str()

const char * GNSS_rx_mode_enum_to_str ( GNSS_rx_mode_enum_t rx_mode)
Here is the caller graph for this function:

◆ GNSS_send_cmd_get_response()

uint8_t GNSS_send_cmd_get_response ( const char * cmd_buf,
uint8_t cmd_buf_len,
uint8_t rx_buf[],
const uint16_t rx_buf_max_size,
uint16_t * rx_buf_len_dest,
uint8_t remove_null_bytes_in_middle )

Sends a log command to the GNSS, and receives the response.

Parameters
cmd_bufLog command string to send to the GNSS, without EOL characters.
cmd_buf_lenExact length of the log command string.
rx_bufBuffer to store the response (not necessarily null terminated).
rx_buf_max_sizeSize of the response buffer.
rx_buf_len_destPointer to place to store the length of the response buffer (not necessarily null terminated).
remove_null_bytes_in_middleIf non-zero, remove any null bytes in the middle of the response.
Returns
0 on success, >0 if error.
Note
This function is intended for "once" log commands and control commands.
This function does not validate the response, as related to the request.
This function properly handles interactions with the firehose file, if enabled.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNSS_send_cmd_get_response_when_firehose_storage_disabled()

uint8_t GNSS_send_cmd_get_response_when_firehose_storage_disabled ( const char * cmd_buf,
uint8_t cmd_buf_len,
uint8_t rx_buf[],
const uint16_t rx_buf_max_size,
uint16_t * rx_buf_len_dest,
uint8_t remove_null_bytes_in_middle )
static

Sends a log command to the GNSS, and receives the response.

Parameters
cmd_bufLog command string to send to the GNSS, without EOL characters.
cmd_buf_lenExact length of the log command string.
rx_bufBuffer to store the response (not necessarily null terminated).
rx_buf_max_sizeSize of the response buffer.
rx_buf_len_destPointer to place to store the length of the response buffer (not necessarily null terminated).
Returns
0 on success, >0 if error.
Note
This function is intended for "once" log commands and control commands.
This function does not validate the response, as related to the request.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ GNSS_current_rx_mode

◆ GNSS_RX_TIMEOUT_BEFORE_FIRST_BYTE_MS

const uint32_t GNSS_RX_TIMEOUT_BEFORE_FIRST_BYTE_MS = 800

◆ GNSS_RX_TIMEOUT_BETWEEN_BYTES_MS

const uint32_t GNSS_RX_TIMEOUT_BETWEEN_BYTES_MS = 2500

◆ GNSS_write_cmd_mode_data_to_firehose_file

uint32_t GNSS_write_cmd_mode_data_to_firehose_file = 1

Boolean. Whether to store command-mode GNSS data to the firehose file.

If GNSS firehose storage mode is enabled, and the send_cmd_get_response function is used, this config variable controls whether the command-mode response data is written to the firehose file.

◆ UART_gnss_port_handle

UART_HandleTypeDef* UART_gnss_port_handle
extern