AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
isobus::SPITransactionFrame Class Reference

A class containing the data for a single SPI transaction. More...

#include <spi_transaction_frame.hpp>

Public Member Functions

 SPITransactionFrame (const std::vector< std::uint8_t > *txBuffer, bool read=false)
 Construct a new SPITransactionFrame object.
 
bool read_byte (std::size_t index, std::uint8_t &byte) const
 Read a byte from the response buffer.
 
bool read_bytes (std::size_t index, std::uint8_t *buffer, std::size_t length) const
 Read multiple bytes 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 > * get_tx_buffer () const
 Get the buffer to transmit.
 
bool get_is_read () const
 Get whether the interface should read the response to the write operation.
 

Private Attributes

const std::vector< std::uint8_t > * txBuffer
 The buffer to transmit.
 
const bool read
 If true, the plugin will read the response to the write operation.
 
std::vector< std::uint8_t > rxBuffer
 The buffer to store the response in.
 

Detailed Description

A class containing the data for a single SPI transaction.

Definition at line 23 of file spi_transaction_frame.hpp.

Constructor & Destructor Documentation

◆ SPITransactionFrame()

isobus::SPITransactionFrame::SPITransactionFrame ( const std::vector< std::uint8_t > * txBuffer,
bool read = false )

Construct a new SPITransactionFrame object.

Parameters
[in]txBufferA pointer to the buffer to transmit
[in]readIf true, the plugin will read the response to the write operation

Definition at line 17 of file spi_transaction_frame.cpp.

Member Function Documentation

◆ get_is_read()

bool isobus::SPITransactionFrame::get_is_read ( ) const

Get whether the interface should read the response to the write operation.

Returns
True if the interface should read the response to the write operation, false otherwise

Definition at line 83 of file spi_transaction_frame.cpp.

Here is the caller graph for this function:

◆ get_rx_buffer()

std::vector< std::uint8_t > & isobus::SPITransactionFrame::get_rx_buffer ( )

Get the buffer to store the response in.

Note
This function should only be called by the spi interface
Returns
The buffer to store the response in

Definition at line 73 of file spi_transaction_frame.cpp.

Here is the caller graph for this function:

◆ get_tx_buffer()

const std::vector< std::uint8_t > * isobus::SPITransactionFrame::get_tx_buffer ( ) const

Get the buffer to transmit.

Note
This function should only be called by the spi interface
Returns
The buffer to transmit

Definition at line 78 of file spi_transaction_frame.cpp.

Here is the caller graph for this function:

◆ read_byte()

bool isobus::SPITransactionFrame::read_byte ( std::size_t index,
std::uint8_t & byte ) const

Read a byte from the response buffer.

Parameters
[in]indexThe index of the byte to read
[in,out]byteThe byte to store the read value in
Returns
True if the byte was read successfully, false otherwise

Definition at line 28 of file spi_transaction_frame.cpp.

Here is the caller graph for this function:

◆ read_bytes()

bool isobus::SPITransactionFrame::read_bytes ( std::size_t index,
std::uint8_t * buffer,
std::size_t length ) const

Read multiple bytes from the response buffer.

Parameters
[in]indexThe index of the first byte to read
[in,out]bufferThe buffer to store the bytes in
[in]lengthThe number of bytes to read
Returns
True if the bytes were read successfully, false otherwise

Definition at line 51 of file spi_transaction_frame.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ read

const bool isobus::SPITransactionFrame::read
private

If true, the plugin will read the response to the write operation.

Definition at line 60 of file spi_transaction_frame.hpp.

◆ rxBuffer

std::vector<std::uint8_t> isobus::SPITransactionFrame::rxBuffer
private

The buffer to store the response in.

Definition at line 61 of file spi_transaction_frame.hpp.

◆ txBuffer

const std::vector<std::uint8_t>* isobus::SPITransactionFrame::txBuffer
private

The buffer to transmit.

Definition at line 59 of file spi_transaction_frame.hpp.


The documentation for this class was generated from the following files: