trikRuntime
trikControl::MspI2cCommunicator Class Reference

Provides direct interaction with I2C device. More...

#include <mspI2cCommunicator.h>

Inheritance diagram for trikControl::MspI2cCommunicator:
Collaboration diagram for trikControl::MspI2cCommunicator:

Public Member Functions

 MspI2cCommunicator (const trikKernel::Configurer &configurer, trikHal::MspI2cInterface &i2c)
 Constructor. More...
 
 ~MspI2cCommunicator () override
 
void send (const QByteArray &data) override
 Send data to current device, if it is connected. More...
 
int read (const QByteArray &data) override
 Reads data by given I2C command number and returns the result. More...
 
Status status () const override
 Returns current status of the device. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 

Additional Inherited Members

- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 
- Static Public Member Functions inherited from trikControl::DeviceInterface
static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 

Detailed Description

Provides direct interaction with I2C device.

Constructor & Destructor Documentation

MspI2cCommunicator::MspI2cCommunicator ( const trikKernel::Configurer configurer,
trikHal::MspI2cInterface i2c 
)

Constructor.

Parameters
configurer- contains preparsed XML configuration.
MspI2cCommunicator::~MspI2cCommunicator ( )
override

Member Function Documentation

int MspI2cCommunicator::read ( const QByteArray &  data)
overridevirtual

Reads data by given I2C command number and returns the result.

Implements trikControl::MspCommunicatorInterface.

void MspI2cCommunicator::send ( const QByteArray &  data)
overridevirtual

Send data to current device, if it is connected.

Implements trikControl::MspCommunicatorInterface.

DeviceInterface::Status MspI2cCommunicator::status ( ) const
overridevirtual

Returns current status of the device.

Implements trikControl::DeviceInterface.


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