Andrew Jeffery | a9d1508 | 2021-05-24 13:55:12 +0930 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "NVMeContext.hpp" |
| 4 | |
| 5 | #include <boost/asio/ip/tcp.hpp> |
| 6 | |
| 7 | class NVMeMCTPContext : public NVMeContext |
| 8 | { |
| 9 | public: |
| 10 | NVMeMCTPContext(boost::asio::io_service& io, int rootBus); |
| 11 | |
| 12 | virtual ~NVMeMCTPContext(); |
| 13 | |
| 14 | virtual void pollNVMeDevices() override; |
| 15 | virtual void close() override; |
| 16 | virtual void readAndProcessNVMeSensor() override; |
| 17 | virtual void processResponse(void* msg, size_t len) override; |
| 18 | |
| 19 | private: |
| 20 | boost::asio::ip::tcp::socket nvmeSlaveSocket; |
| 21 | boost::asio::deadline_timer mctpResponseTimer; |
| 22 | |
| 23 | void readResponse(); |
| 24 | }; |
| 25 | |
| 26 | namespace nvmeMCTP |
| 27 | { |
| 28 | void init(void); |
| 29 | } |