trikRuntime
trikControl::MspUsbCommunicator Class Reference

Provides direct interaction with I2C device. More...

#include <mspUsbCommunicator.h>

Inheritance diagram for trikControl::MspUsbCommunicator:
Collaboration diagram for trikControl::MspUsbCommunicator:

Public Member Functions

 MspUsbCommunicator (trikHal::MspUsbInterface &usb)
 Constructor. More...
 
 ~MspUsbCommunicator () 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

MspUsbCommunicator::MspUsbCommunicator ( trikHal::MspUsbInterface usb)

Constructor.

Parameters
usb- USB bus communicator.
MspUsbCommunicator::~MspUsbCommunicator ( )
override

Member Function Documentation

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

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

Implements trikControl::MspCommunicatorInterface.

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

Send data to current device, if it is connected.

Implements trikControl::MspCommunicatorInterface.

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

Returns current status of the device.

Implements trikControl::DeviceInterface.


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