Dataflow Runtime API  3.0.3.0
Public Member Functions | List of all members
imt::base::os::winec7::SerialPort Class Reference

Defines the interface of a serial port. More...

#include <Imt.Base.OS.WinEC7/SerialPort.h>

Public Member Functions

 SerialPort (SerialPortConfig &config)
 Constructor. More...
 
virtual ~SerialPort (void)
 Destructor. More...
 
bool open (void)
 Opens the connection. More...
 
bool close (void)
 Closes the connection. More...
 
bool isOpen (void) const
 Returns true if connection is open. More...
 
bool sendData (const uint8_t *const pData, const uint32_t size, uint32_t &numberOfSentBytes)
 Sends the given data over the serial port. More...
 
bool readData (uint8_t *const pData, const uint32_t size, uint32_t &numberOfReadBytes)
 Reads the received data from the serial port. More...
 

Detailed Description

Defines the interface of a serial port.

During link time this interface will be statically linked to a platform dependent implementation of the driver.

Constructor & Destructor Documentation

◆ SerialPort()

imt::base::os::winec7::SerialPort::SerialPort ( SerialPortConfig config)
explicit

Constructor.

◆ ~SerialPort()

virtual imt::base::os::winec7::SerialPort::~SerialPort ( void  )
virtual

Destructor.

Member Function Documentation

◆ close()

bool imt::base::os::winec7::SerialPort::close ( void  )

Closes the connection.

Returns
true on success

◆ isOpen()

bool imt::base::os::winec7::SerialPort::isOpen ( void  ) const

Returns true if connection is open.

◆ open()

bool imt::base::os::winec7::SerialPort::open ( void  )

Opens the connection.

Returns
true on success

◆ readData()

bool imt::base::os::winec7::SerialPort::readData ( uint8_t *const  pData,
const uint32_t  size,
uint32_t numberOfReadBytes 
)

Reads the received data from the serial port.

Parameters
pDataWhere the data should be saved
sizeMaximum number of data to be saved
numberOfReadBytesContains the number of read bytes
Returns
true on success, false on error

◆ sendData()

bool imt::base::os::winec7::SerialPort::sendData ( const uint8_t *const  pData,
const uint32_t  size,
uint32_t numberOfSentBytes 
)

Sends the given data over the serial port.

Parameters
pDataPointer to the data to be transmitted
sizeNumber of bytes to be transmitted
numberOfSentBytesContains the number of sent bytes
Returns
true on success, false on error

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