Pigweed
 
Loading...
Searching...
No Matches
pw::i2c::MockMessage Class Reference

#include <initiator_message_mock.h>

Public Types

enum  Direction { kMockRead , kMockWrite }
 

Public Member Functions

constexpr MockMessage (Status expected_return_value, Address address, Direction direction, ConstByteSpan data_buffer)
 
constexpr MockMessage (Status expected_return_value, Address device_address)
 Alternative constructor for creating probe transactions.
 
Status return_value () const
 Gets the expected return value for the transaction.
 
Address address () const
 Gets the I2C address that the I2C transaction is targeting.
 
Direction direction () const
 
ConstByteSpan data_buffer () const
 Gets the buffer that is virtually read.
 

Detailed Description

Base class for creating expected individual Messages that make up a MockMessageTransaction instance. For read-only, write-only, or probe messages, improve code readability by using one of the following helpers instead:

  • pw::i2c::MockReadMessage
  • pw::i2c::MockWriteMessage
  • pw::i2c::MockProbeMessage

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