rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
fm_req.h
Go to the documentation of this file.
1
30
31#pragma once
32
33#include <stdbool.h>
34#include <stddef.h>
35#include <stdint.h>
36
37#include "card_tree.h"
38#include "fm_io.h"
39#include "fm_ops.h"
40#include "fm_rules.h"
41#include "fm_tree.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
58
62typedef struct {
63 uint64_t size;
64 int64_t mtime;
66 unsigned entries;
67 unsigned unlisted;
68} fm_info_t;
69
96
102typedef struct {
103 const fm_io_t *io;
110 void (*bench)(fm_bench_t *out, void *ctx);
116 bool (*cancelled)(void *ctx);
124 void (*progress)(uint64_t done, uint64_t total, void *ctx);
129 void (*look)(void *ctx);
130 uint8_t *chunk;
131 size_t size;
132 void *ctx;
134
148fm_err_t fm_req_run(fm_req_t *req, const fm_runner_t *run);
149
156void fm_req_bench(const fm_req_t *req, fm_bench_t *live);
157
158#ifdef __cplusplus
159}
160#endif
The folders of the panel's SD (Secure Digital) card, and the files in them with a fixed name.
#define CARD_DIR_MAX
Room for a folder path and its terminator: two folders of 8 characters and the "/" between them are 1...
Definition card_tree.h:113
The card as the file manager's core sees it: a table of functions the caller supplies,...
fm_err_t
What a call of the core or of the card came to. FM_OK is 0; every other value is a refusal or a failu...
Definition fm_io.h:51
#define FM_NAME_BUF
Room for a listed name and its terminator: FM_LIST_NAME_MAX (63) bytes, as the panel's directory walk...
Definition fm_io.h:44
#define FM_PATH_SIZE
Room for a path and its terminator.
Definition fm_name.h:54
The file manager's jobs on the card: copy, move, rename, delete, make a folder, make an empty file,...
void fm_req_bench(const fm_req_t *req, fm_bench_t *live)
The bench the rules read for req: live, the bench as it stands, with the log folders the request carr...
Definition fm_req.c:39
fm_err_t fm_req_run(fm_req_t *req, const fm_runner_t *run)
Answer req: every card call it needs, to its end.
Definition fm_req.c:139
fm_req_kind_t
What a request asks for.
Definition fm_req.h:50
@ FM_REQ_JOB
Definition fm_req.h:56
@ FM_REQ_INFO
Definition fm_req.h:55
@ FM_REQ_PAGE
Definition fm_req.h:52
@ FM_REQ_UP
Definition fm_req.h:54
@ FM_REQ_ENTER
Definition fm_req.h:53
@ FM_REQ_NONE
Definition fm_req.h:51
What the file manager may do to a name: the places the bench keeps, the files the logger writes,...
One pane of the file manager: a folder of the card, the page of its entries on show,...
fm_go_t
Which page fm_tree_page() reads.
Definition fm_tree.h:65
The bench as the rules see it, filled by the caller each time it asks. Every pointer may be NULL.
Definition fm_rules.h:101
What INFO reads of one entry.
Definition fm_req.h:62
unsigned entries
Definition fm_req.h:66
unsigned unlisted
Definition fm_req.h:67
int64_t mtime
Definition fm_req.h:64
uint64_t size
Definition fm_req.h:63
The card: every function set, each answering FM_OK or the reason it failed. ctx is passed to each of ...
Definition fm_io.h:117
One job. The fields are the job's; the screen reads them through fm_job_state().
Definition fm_ops.h:124
One request. The screen fills the fields of its kind, the runner writes the answer into the same requ...
Definition fm_req.h:74
bool is_dir
Definition fm_req.h:86
fm_info_t info
Definition fm_req.h:93
fm_go_t go
Definition fm_req.h:82
bool look
The slot is looked at before the request: a card put in, taken out or swapped since the last look is ...
Definition fm_req.h:79
int row
Definition fm_req.h:83
char auto_logs[CARD_DIR_MAX]
Definition fm_req.h:91
fm_req_kind_t kind
Definition fm_req.h:75
char name[FM_NAME_BUF]
Definition fm_req.h:85
unsigned mount
Definition fm_req.h:87
fm_tree_t tree
Definition fm_req.h:80
fm_job_t job
Definition fm_req.h:88
fm_err_t err
Definition fm_req.h:94
char user_logs[CARD_DIR_MAX]
Definition fm_req.h:89
char dir[FM_PATH_SIZE]
Definition fm_req.h:84
What the card's task gives the runner: the card, the bench as it stands, CANCEL, the progress,...
Definition fm_req.h:102
uint8_t * chunk
Definition fm_req.h:130
void(*) progress(uint64_t done, uint64_t total, void *ctx)
A job's bytes done after a step, for the progress box; may be NULL.
Definition fm_req.h:124
void(*) bench(fm_bench_t *out, void *ctx)
The bench now: ARMED, the logger's open files, the IOmcu link. The runner sets the log folders from t...
Definition fm_req.h:110
void * ctx
Definition fm_req.h:132
void(*) look(void *ctx)
Look at the slot, for a request with look set; may be NULL.
Definition fm_req.h:129
const fm_io_t * io
Definition fm_req.h:103
size_t size
Definition fm_req.h:131
bool(*) cancelled(void *ctx)
Whether CANCEL was pressed since the request was handed over.
Definition fm_req.h:116
One pane. The fields are the pane's; read them, change them through the functions.
Definition fm_tree.h:77