The programmer's journal file: the text of a write to the servo that survives a restart of the panel, and the parse of it.
More...
|
| static uint16_t | crc16 (const char *s, size_t n) |
| | The link CRC-16 of n bytes.
|
| static char * | put (char *at, const char *s) |
| | Appends a string without its terminator.
|
| static char * | put_hex (char *at, unsigned v, unsigned digits) |
| | Appends v as upper-case hexadecimal digits.
|
| static char * | put_image (char *at, const char *key, const kst_image_t *img) |
| | Appends a line of a key and the image's registers in hexadecimal.
|
| size_t | kst_prog_file_text (const kst_prog_t *p, char *out, size_t n) |
| | The text of the state as it is, for a caller that only reads.
|
| size_t | kst_prog_file_take (kst_prog_t *p, char *out, size_t n) |
| | The file text is to be written: fill out and return its length; 0 while nothing is to be written or n is too small.
|
| void | kst_prog_file_done (kst_prog_t *p, bool ok) |
| | How the write of the text kst_prog_file_take() gave went.
|
| static int | hex (char c) |
| | The value of one hexadecimal digit.
|
| static long | take_hex (const char *s, unsigned digits) |
| | Reads a number of hexadecimal digits.
|
| static bool | take_image (const char *s, size_t left, const char *key, kst_image_t *img) |
| | "key" + 64 digits + newline at s, left bytes there.
|
| static bool | parse (loaded_t *into, const char *text, size_t len) |
| | Parses a file text into the loaded state.
|
| bool | kst_prog_file_whole (const char *text, size_t len) |
| | Whether text is a whole file: its version, its lines and its check value.
|
| bool | kst_prog_file_load (kst_prog_t *p, const char *text, size_t len) |
| | The file as found at start.
|
The programmer's journal file: the text of a write to the servo that survives a restart of the panel, and the parse of it.
See kst_prog.h.
SPDX-License-Identifier: MIT
| void kst_prog_file_done |
( |
kst_prog_t * | p, |
|
|
bool | ok ) |
How the write of the text kst_prog_file_take() gave went.
The answer to a write's journal releases that write when the card completed the file and the write's start gate holds as it is now: the port in PROGRAMMING on the write's port, no STOP, the bench not ARMED and ENABLE WRITE TO SERVO on. Otherwise the write ends as one that did not start: nothing goes to the servo, its record is cleared, and the message names the gate that refused it, or KST_PROG_MSG_STORE_FAILED.
- Parameters
-
| p | The programmer state. |
| ok | true when the card completed the file. |