Added resumable loading, along with signal handling.

This version can store state after receiving SIGINT.
This is achieved by polling FIFO read state;
This commit is contained in:
2018-08-09 20:23:23 +00:00
parent 673577a601
commit 48840ad36c
29 changed files with 598 additions and 233 deletions

View File

@@ -1,14 +1,21 @@
#pragma once
#include <cstdint>
#include <vector>
#include <memory>
struct U2FMessage
{
uint32_t cid;
uint8_t cmd;
std::vector<uint8_t> data;
public:
uint32_t cid;
uint8_t cmd;
std::vector<uint8_t> data;
static U2FMessage read();
public:
U2FMessage() = default;
U2FMessage(const uint32_t nCID, const uint8_t nCMD);
static std::shared_ptr<U2FMessage> readNonBlock();
void write();
void write();
protected:
static void error(const uint32_t tCID, const uint16_t tErr);
};