|
K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
|
Data Structures | |
| struct | kfsw_fwu_lite_message |
Macros | |
| #define | KFSW_FWU_LITE_HEADER_SIZE 12U |
| #define | KFSW_FWU_LITE_MAX_BLOCK_SIZE CONFIG_KFSW_FWU_LITE_BLOCK_SIZE |
Enumerations | |
| enum | kfsw_fwu_lite_opcode { KFSW_FWU_LITE_OP_BEGIN = 1 , KFSW_FWU_LITE_OP_BLOCK = 2 , KFSW_FWU_LITE_OP_STATUS = 3 , KFSW_FWU_LITE_OP_VERIFY = 4 , KFSW_FWU_LITE_OP_START_FLASHING = 5 , KFSW_FWU_LITE_OP_ABORT = 6 } |
| enum | kfsw_fwu_lite_status { KFSW_FWU_LITE_STATUS_OK = 0 , KFSW_FWU_LITE_STATUS_INVALID = 1 , KFSW_FWU_LITE_STATUS_OUT_OF_ORDER = 2 , KFSW_FWU_LITE_STATUS_BAD_BLOCK = 3 , KFSW_FWU_LITE_STATUS_BAD_IMAGE = 4 , KFSW_FWU_LITE_STATUS_TOO_LARGE = 5 , KFSW_FWU_LITE_STATUS_BUSY = 6 , KFSW_FWU_LITE_STATUS_FAILED = 7 } |
Functions | |
| int | kfsw_fwu_lite_encode (const struct kfsw_fwu_lite_message *message, uint8_t *buffer, size_t buffer_size, size_t *encoded_size) |
| int | kfsw_fwu_lite_decode (const uint8_t *buffer, size_t size, struct kfsw_fwu_lite_message *message) |
| int | kfsw_fwu_lite_handle (const struct kfsw_fwu_lite_message *request, struct kfsw_fwu_lite_message *reply) |
| const char * | kfsw_fwu_lite_status_name (uint8_t status) |
Uploads firmware in checksummed blocks over CSP, with retries.
It shares the update service with FTP; concurrent uploads return busy. RDP is optional and off by default.
| #define KFSW_FWU_LITE_HEADER_SIZE 12U |
#include <fwu_lite.h>
Fixed header on every request and reply, big-endian on the wire.
| #define KFSW_FWU_LITE_MAX_BLOCK_SIZE CONFIG_KFSW_FWU_LITE_BLOCK_SIZE |
#include <fwu_lite.h>
Largest block payload this build accepts.
| enum kfsw_fwu_lite_opcode |
#include <fwu_lite.h>
Wire opcodes.
Requests carry the low value; replies echo it.
| enum kfsw_fwu_lite_status |
#include <fwu_lite.h>
Reply status values.
Distinct from errno so the wire meaning is stable.
| int kfsw_fwu_lite_decode | ( | const uint8_t * | buffer, |
| size_t | size, | ||
| struct kfsw_fwu_lite_message * | message | ||
| ) |
#include <fwu_lite.h>
Decode a message from a buffer.
The decoded data points into buffer and is valid only while it is.
| buffer | Source bytes. | |
| size | Bytes available. | |
| [out] | message | Decoded message. |
| 0 | Decoded. |
| -EINVAL | A pointer is NULL. |
| -EBADMSG | The buffer is shorter than a header, or the opcode is not one this build knows. |
| -EMSGSIZE | The payload is larger than the block size. |
| int kfsw_fwu_lite_encode | ( | const struct kfsw_fwu_lite_message * | message, |
| uint8_t * | buffer, | ||
| size_t | buffer_size, | ||
| size_t * | encoded_size | ||
| ) |
#include <fwu_lite.h>
Encode a message into a buffer.
| message | Message to encode. | |
| buffer | Destination. | |
| buffer_size | Bytes available. | |
| [out] | encoded_size | Bytes written. |
| 0 | Encoded. |
| -EINVAL | A pointer is NULL. |
| -EMSGSIZE | The payload does not fit, or exceeds the block size. |
| int kfsw_fwu_lite_handle | ( | const struct kfsw_fwu_lite_message * | request, |
| struct kfsw_fwu_lite_message * | reply | ||
| ) |
#include <fwu_lite.h>
Apply a decoded request and produce the reply.
A rejected request returns a reply with the error status.
| request | Decoded request. | |
| [out] | reply | Reply to send back. |
| 0 | A reply was produced, whatever its status. |
| -EINVAL | A pointer is NULL. |
| const char * kfsw_fwu_lite_status_name | ( | uint8_t | status | ) |
#include <fwu_lite.h>
Human-readable name for a reply status.
| status | One of kfsw_fwu_lite_status. |