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
92 std::shared_ptr<rogue::Logging> log_;
93
94 static const uint32_t HeadLen = 20;
95 static const uint32_t TailLen = 4;
96
97 uint8_t timeout_ = 0x0A;
98
99 // Setup header, return write flag
100 bool setupHeader(std::shared_ptr<rogue::interfaces::memory::Transaction> tran,
101 uint32_t* header,
102 uint32_t& frameLen,
103 bool tx);
104
105 public:
116 static std::shared_ptr<rogue::protocols::srp::SrpV3> create();
117
119 static void setup_python();
120
128 SrpV3();
129
131 ~SrpV3();
132
142 void doTransaction(std::shared_ptr<rogue::interfaces::memory::Transaction> tran);
143
153 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
154
164 void setHardwareTimeout(uint8_t val);
165};
166
167// Convenience
168typedef std::shared_ptr<rogue::protocols::srp::SrpV3> SrpV3Ptr;
169} // namespace srp
170} // namespace protocols
171} // namespace rogue
172#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:91
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:204
~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:168