rogue
Loading...
Searching...
No Matches
SrpV3.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_PROTOCOLS_SRP_SRPV3_H__
18#define __ROGUE_PROTOCOLS_SRP_SRPV3_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <memory>
24#include <thread>
25
26#include "rogue/Logging.h"
30
31namespace rogue {
32namespace protocols {
33namespace srp {
34
88 std::shared_ptr<rogue::Logging> log_;
89
90 static const uint32_t HeadLen = 20;
91 static const uint32_t TailLen = 4;
92
93 uint8_t timeout_ = 0x0A;
94
95 // Setup header, return write flag
96 bool setupHeader(std::shared_ptr<rogue::interfaces::memory::Transaction> tran,
97 uint32_t* header,
98 uint32_t& frameLen,
99 bool tx);
100
101 public:
112 static std::shared_ptr<rogue::protocols::srp::SrpV3> create();
113
115 static void setup_python();
116
124 SrpV3();
125
127 ~SrpV3();
128
138 void doTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> tran);
139
149 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
150
160 void setHardwareTimeout(uint8_t val);
161};
162
163// Convenience
164typedef std::shared_ptr<rogue::protocols::srp::SrpV3> SrpV3Ptr;
165} // namespace srp
166} // namespace protocols
167} // namespace rogue
168#endif
Memory slave device.
Definition Slave.h:54
Stream master endpoint.
Definition Master.h:65
Stream slave endpoint and default frame pool.
Definition Slave.h:72
SRP v3 bridge between Rogue memory transactions and stream frames.
Definition SrpV3.h:87
void setHardwareTimeout(uint8_t val)
Sets SRP hardware timeout field used in outgoing requests.
Definition SrpV3.cpp:77
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts an incoming SRP v3 response frame.
Definition SrpV3.cpp:200
~SrpV3()
Destroys the SRP v3 interface instance.
Definition SrpV3.cpp:74
static std::shared_ptr< rogue::protocols::srp::SrpV3 > create()
Creates an SRP v3 interface instance.
Definition SrpV3.cpp:50
SrpV3()
Constructs an SRP v3 interface instance.
Definition SrpV3.cpp:69
static void setup_python()
Registers Python bindings for this class.
Definition SrpV3.cpp:56
void doTransaction(std::shared_ptr< rogue::interfaces::memory::Transaction > tran)
Processes a memory transaction and emits SRP v3 request frame(s).
Definition SrpV3.cpp:133
std::shared_ptr< rogue::protocols::srp::SrpV3 > SrpV3Ptr
Definition SrpV3.h:164