19 #ifndef FAULHABER_SERIAL_H 20 #define FAULHABER_SERIAL_H 27 #include <QtSerialPort/QSerialPort> 28 #include <QSharedPointer> 44 bool open(QString pBaudRate =
"19200", QString pParity =
"n", QString pByteSize =
"8", QString pStopBit =
"1");
47 bool send(
int pUnit, QString pCommand,
int pData,
bool pUseData);
57 static const unsigned char CR;
61 #endif // FAULHABER_SERIAL_H QSharedPointer< ErrorHandler > mErrorHandler
Error handler.
Definition: FaulhaberSerial.h:52
static const unsigned char CR
Carriage return character used as special end character when communicating with Faulhaber motors...
Definition: FaulhaberSerial.h:57
bool mIsPortInitialized
Flag that defines if port has been initialized or not.
Definition: FaulhaberSerial.h:54
bool close()
Close communication with the COM port.
Definition: FaulhaberSerial.cpp:145
void initialize(const QString pCOMPortName)
Initialize the COM port member variables.
Definition: FaulhaberSerial.cpp:45
bool receivePacket(int &pData)
Read a full packet of data from the COM port.
Definition: FaulhaberSerial.cpp:154
bool send(int pUnit, QString pCommand, int pData, bool pUseData)
Send a packet to the COM port.
Definition: FaulhaberSerial.cpp:184
FaulhaberSerial()
Constructor.
Definition: FaulhaberSerial.cpp:30
void attachErrorHandler(QSharedPointer< ErrorHandler > pDIOCard)
Definition: FaulhaberSerial.cpp:53
bool open(QString pBaudRate="19200", QString pParity="n", QString pByteSize="8", QString pStopBit="1")
Open communication with the COM port.
Definition: FaulhaberSerial.cpp:58
static const int RXTIMEOUT
Communication timeout limit in milliseconds.
Definition: FaulhaberSerial.h:58
~FaulhaberSerial()
Definition: FaulhaberSerial.cpp:37
bool mIsOpen
Flag that defines if port has been opened or not.
Definition: FaulhaberSerial.h:55
Class for communicating with Faulhaber MCBL 3006 through serial COM ports.
Definition: FaulhaberSerial.h:36
QSerialPort * mSerialPort
In Qt5, QSerialPort handles the COM port.
Definition: FaulhaberSerial.h:50