Svc/FileWorker/docs/sdd.md
Svc::FileWorker is an active F' component used for writing and reading files on the filesystem. Other components needing to read or write files may use this component to perform large/slow file operations without missing their deadlines.
| Name | Description | Validation |
|---|---|---|
| FileWorker-001 | FileWorker shall provide an async interface to read contents from a file and return the data in a client-provided buffer | Unit Test |
| FileWorker-002 | FileWorker shall provide an interface to write contents to a file passed in from a client-provided buffer | Unit Test |
| FileWorker-003 | FileWorker shall handle receiving read-done signals while in improper state | Unit Test |
| FileWorker-004 | FileWorker shall handle cancel for reads | Unit Test |
| State | Description |
|---|---|
| IDLE | FileWorker is ready to accept requests for transfer |
| READING | In the read process |
| WRITING | In the write process |
| Kind | Port Name | Port Type | Usage |
|---|---|---|---|
| async input | writeIn | Svc.FileWrite | Initiates a file write |
| output | writeDoneOut | Svc.SignalDone | File write has completed |
| async input | readIn | Svc.FileRead | Initiates a file read |
| output | readDoneOut | Svc.SignalDone | File read has completed |
| guarded input | cancelIn | Svc.CancelStatus | Cancels a current operation |
| async input | verifyIn | Svc.VerifyStatus | Initiates a verification of a file against an expected CRC checksum |
| output | verifyDoneOut | Svc.SignalDone | File verification results |
Calling component passes in a buffer for writing to file, the file location is path, and the offset to start writing at.
Calling component passes in a file path path to read and a buffer for client to read from