Back to Fprime

Svc::FileDispatcher

Svc/FileDispatcher/docs/sdd.md

4.2.24.0 KB
Original Source

Svc::FileDispatcher

Component to dispatch delivered files to various services. The user passes in a table that maps file extensions to numbered output ports represented by a user's own version of the enumeration in the configuration FileDispatcherCfg.fpp file. The user then connects the components that process the files to the output ports.

Requirements

Add requirements in the chart below

NameDescriptionRationaleValidation
FPRIME-FDISP-001File dispatcher will provide a way to dispatch files to other componentsNeed to have a way to supply a file name for a newly transferred fileUnit Test/System Test
FPRIME-FDISP-002File dispatcher will provide user configuration to map file types to output portsProjects will want to customize the dispatching typesUnit Test/System Test
FPRIME-FDISP-003File dispatcher will dispatch to specified output ports based on the supplied tableProjects will want to connect the dispatch types to components for processing new filesUnit Test/System Test

Usage Examples

Typical Usage

Svc::FileUplink is typically connected to FileDispatcher to process files that have been uplinked to the system. The user should create a configuration table that maps file extensions to output ports and supply it to the FileDispatcher component during initialization.

Configuration Table Structure

The user should instantiate an instance of FileDispatcherTable and supply it to the configure() function during initialization. The fields should be filled in as follows:

FieldValueNotes
numEntriesShould be > 0 and <= Svc::FileDispatcherCfg::FILE_DISPATCHER_MAX_TABLE_SIZEValues outside this range will cause an assert
entriesAn array of file extension to port mappingsNumber populated should match numEntries

The user should configure each entry in the entries array in the range covered by numEntries.

The fields should be filled as follows:

FieldValueNotes
fileExtThe file extension or suffix to detect in the file name and route. The same extension/suffix can be used multiple times and be routed to different portsMust be non-zero in length, or it will cause an assert
portThe outgoing port number must be a member of the FileDispatchPort or it will cause an assert
enabledA boolean that indicates if the routing is initially enabled or notCan be changed by ENABLE_DISPATCH command

Diagrams

Class Diagram

Port Descriptions

NameDescription
fileAnnounceRecvInput port that receives file name of new file
fileDispatchArray of output ports that dispatch a new files based on a user supplied table
pingInInput port for Health pinging
pingOutOutput port for returning Health pings

Component States

No state machines

Parameters

No parameters

Commands

NameDescription
ENABLE_DISPATCHEnables or disables a particular dispatch type

Events

NameDescription
FileDispatchStateSent when a dispatch type is enabled or disabled
FileDispatchedSent when a dispatch type is matched and dispatched

Telemetry

No telemetry

Unit Tests

NameDescriptionOutputCoverage
dispatchTestTests dispatches of files------
dispatchAllDisabledTestTests dispatches of files with all file types initially disabled------
dispatchAllCmdDisabledTestTests dispatches of files with all file types initially enabled, but then disabled by command------
dispatchAllCmdEnabledTestTests dispatches of files with all file types initially disabled, but then enabled by command------
dispatchNotFullConfigTestTests dispatches of files with a table with less entries than output ports------
dispatchPingTestTests ping returns------

Change Log

DateDescription
12/10/2025Initial Draft