AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
spi_transaction_frame.hpp
Go to the documentation of this file.
1//================================================================================================
9//================================================================================================
10#ifndef SPI_TRANSACTION_FRAME_HPP
11#define SPI_TRANSACTION_FRAME_HPP
12
13#include <cstdint>
14#include <vector>
15
16namespace isobus
17{
18 //================================================================================================
22 //================================================================================================
24 {
25 public:
29 SPITransactionFrame(const std::vector<std::uint8_t> *txBuffer, bool read = false);
30
35 bool read_byte(std::size_t index, std::uint8_t &byte) const;
36
42 bool read_bytes(std::size_t index, std::uint8_t *buffer, std::size_t length) const;
43
47 std::vector<std::uint8_t> &get_rx_buffer();
48
52 const std::vector<std::uint8_t> *get_tx_buffer() const;
53
56 bool get_is_read() const;
57
58 private:
59 const std::vector<std::uint8_t> *txBuffer;
60 const bool read;
61 std::vector<std::uint8_t> rxBuffer;
62 };
63}
64#endif // SPI_TRANSACTION_FRAME_HPP
A class containing the data for a single SPI transaction.
const bool read
If true, the plugin will read the response to the write operation.
const std::vector< std::uint8_t > * get_tx_buffer() const
Get the buffer to transmit.
std::vector< std::uint8_t > rxBuffer
The buffer to store the response in.
bool get_is_read() const
Get whether the interface should read the response to the write operation.
bool read_byte(std::size_t index, std::uint8_t &byte) const
Read a byte from the response buffer.
std::vector< std::uint8_t > & get_rx_buffer()
Get the buffer to store the response in.
const std::vector< std::uint8_t > * txBuffer
The buffer to transmit.
SPITransactionFrame(const std::vector< std::uint8_t > *txBuffer, bool read=false)
Construct a new SPITransactionFrame object.
bool read_bytes(std::size_t index, std::uint8_t *buffer, std::size_t length) const
Read multiple bytes from the response buffer.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...