CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
bulk_file_downlink.h File Reference
#include <stdint.h>
#include "littlefs/lfs.h"
#include "littlefs/littlefs_helper.h"
Include dependency graph for bulk_file_downlink.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  COMMS_bulk_file_downlink_state_enum_t { COMMS_BULK_FILE_DOWNLINK_STATE_IDLE , COMMS_BULK_FILE_DOWNLINK_STATE_DOWNLINKING , COMMS_BULK_FILE_DOWNLINK_STATE_PAUSED }
 

Functions

int32_t COMMS_bulk_file_downlink_start (char *file_path, uint32_t start_offset, uint32_t max_bytes)
 Initiate a bulk file downlink over the UHF radio.
 
uint8_t COMMS_bulk_file_downlink_pause (void)
 
uint8_t COMMS_bulk_file_downlink_resume (void)
 

Variables

char COMMS_bulk_file_downlink_file_path [LFS_MAX_PATH_LENGTH]
 
uint32_t COMMS_bulk_file_downlink_absolute_start_offset
 
uint32_t COMMS_bulk_file_downlink_next_start_offset
 
uint32_t COMMS_bulk_file_downlink_total_bytes
 
uint32_t COMMS_bulk_file_downlink_bytes_downlinked
 
uint8_t COMMS_bulk_file_downlink_next_seq_num
 
uint8_t COMMS_bulk_file_downlink_total_seq_num
 
COMMS_bulk_file_downlink_state_enum_t COMMS_bulk_file_downlink_state
 
lfs_file_t COMMS_bulk_file_downlink_file
 

Enumeration Type Documentation

◆ COMMS_bulk_file_downlink_state_enum_t

Enumerator
COMMS_BULK_FILE_DOWNLINK_STATE_IDLE 
COMMS_BULK_FILE_DOWNLINK_STATE_DOWNLINKING 
COMMS_BULK_FILE_DOWNLINK_STATE_PAUSED 

Function Documentation

◆ COMMS_bulk_file_downlink_pause()

uint8_t COMMS_bulk_file_downlink_pause ( void )
Here is the caller graph for this function:

◆ COMMS_bulk_file_downlink_resume()

uint8_t COMMS_bulk_file_downlink_resume ( void )
Here is the caller graph for this function:

◆ COMMS_bulk_file_downlink_start()

int32_t COMMS_bulk_file_downlink_start ( char * file_path,
uint32_t start_offset,
uint32_t max_bytes )

Initiate a bulk file downlink over the UHF radio.

Parameters
file_pathFile name/path to downlink.
start_offsetThe byte offset in the file to start downlinking from (0 for start).
max_bytesThe maximum number of bytes to downlink. Maximum value is 1000000 (1 MB, COMMS_bulk_file_downlink_total_bytes), for safety (to avoid a very very long-running downlink chain). Values >1 MB will be limited to 1 MB, and value 0 will be set to 1 MB.
Returns
0 on success. Negative LFS failure code on LFS failure. Positive error code on other (logical/request) errors.
Note
1 MB takes about 15 minutes to downlink at 9600 baud.
This function is safe to call at any point (including mid-downlink, or mid-pause). It will close the previous file and start a new downlink.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ COMMS_bulk_file_downlink_absolute_start_offset

uint32_t COMMS_bulk_file_downlink_absolute_start_offset
extern

◆ COMMS_bulk_file_downlink_bytes_downlinked

uint32_t COMMS_bulk_file_downlink_bytes_downlinked
extern

◆ COMMS_bulk_file_downlink_file

lfs_file_t COMMS_bulk_file_downlink_file
extern

◆ COMMS_bulk_file_downlink_file_path

char COMMS_bulk_file_downlink_file_path[LFS_MAX_PATH_LENGTH]
extern

◆ COMMS_bulk_file_downlink_next_seq_num

uint8_t COMMS_bulk_file_downlink_next_seq_num
extern

◆ COMMS_bulk_file_downlink_next_start_offset

uint32_t COMMS_bulk_file_downlink_next_start_offset
extern

◆ COMMS_bulk_file_downlink_state

COMMS_bulk_file_downlink_state_enum_t COMMS_bulk_file_downlink_state
extern

◆ COMMS_bulk_file_downlink_total_bytes

uint32_t COMMS_bulk_file_downlink_total_bytes
extern

◆ COMMS_bulk_file_downlink_total_seq_num

uint8_t COMMS_bulk_file_downlink_total_seq_num
extern