feat:slave 300Hz
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <future>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include <initializer_list>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace ffmsep {
|
||||
|
||||
@@ -59,6 +61,7 @@ struct CPCodec {
|
||||
using CloseFn = void(*)(CPCodecContext*);
|
||||
using SendPacketFn = int(*)(CPCodecContext*, const CPPacket&);
|
||||
using ReceiveFrameFn = int(*)(CPCodecContext*, CPFrame&);
|
||||
using PresistFrameFn = int(*)(CPCodecContext*);
|
||||
|
||||
const char* name = nullptr;
|
||||
const char* long_name = nullptr;
|
||||
@@ -69,11 +72,13 @@ struct CPCodec {
|
||||
CloseFn close = nullptr;
|
||||
SendPacketFn send_packet = nullptr;
|
||||
ReceiveFrameFn receive_frame = nullptr;
|
||||
PresistFrameFn presistend = nullptr;
|
||||
};
|
||||
|
||||
struct CPCodecContext {
|
||||
const CPCodec* codec = nullptr;
|
||||
void* priv_data = nullptr;
|
||||
void* record_data = nullptr;
|
||||
CPMediaType codec_type = CPMediaType::Unknow;
|
||||
bool is_open = false;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace ffmsep {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -22,6 +22,7 @@ struct DecodedFrame {
|
||||
std::optional<tactile::MatrixSize> tactile_matrix_size;
|
||||
};
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
struct CPStreamConfig {
|
||||
std::string port;
|
||||
std::uint32_t baudrate = 115200;
|
||||
@@ -36,7 +37,7 @@ struct CPStreamConfig {
|
||||
CPCodecID codec_id = CPCodecID::Unknow;
|
||||
std::string codec_name;
|
||||
std::vector<std::uint8_t> slave_request_command{};
|
||||
std::chrono::milliseconds slave_request_interval{200};
|
||||
std::chrono::milliseconds slave_request_interval = 200ms;
|
||||
};
|
||||
|
||||
class CPStreamCore {
|
||||
|
||||
Reference in New Issue
Block a user