-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheth_transport.h
More file actions
31 lines (23 loc) · 663 Bytes
/
Copy patheth_transport.h
File metadata and controls
31 lines (23 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include "gen.h"
#include <cstdint>
#include <cstdlib>
#include <string>
#include <utility>
class console;
class eth_transport
{
protected:
uint64_t pkt_cnt_rx { 0 };
uint64_t pkt_cnt_tx { 0 };
bool trace { false };
public:
eth_transport();
virtual ~eth_transport();
virtual bool begin() = 0;
virtual void set_trace(const bool state) { trace = state; }
virtual std::string identifier() const = 0;
virtual void show_state(console *const cnsl) const;
virtual bool transmit(const uint8_t *const data, const size_t n_bytes) = 0;
virtual std::pair<uint8_t *, size_t> get(const int timeout) = 0;
};