propellerdevice.h
1 #pragma once
2 
3 #include <QSerialPort>
4 #include <QStringList>
5 #include <QHash>
6 
18  : public QSerialPort
19 {
20  Q_OBJECT
21 
22  int resource_error_count;
23  quint32 _minimum_timeout;
24 
25  QString _reset;
26  QHash<QString, QString> _reset_defaults;
27  int _reset_gpio;
28 
29 public:
30  PropellerDevice(QObject * parent = 0);
32  bool open();
33 
34  static QStringList list();
35  void useReset(const QString & name, int pin = 17);
36  void useDefaultReset();
37  void setPortName(const QString & name);
38 
39  quint32 calculateTimeout(quint32 bytes, quint32 safety_factor = 15);
40  quint32 minimumTimeout();
41  quint32 resetPeriod();
42  void setMinimumTimeout(quint32 milliseconds);
43 
44 public slots:
45  void handleError(QSerialPort::SerialPortError e);
46  bool reset();
47 
48 signals:
49  void finished();
50  void sendError(const QString &);
51 };
void handleError(QSerialPort::SerialPortError e)
Definition: propellerdevice.cpp:45
PropellerDevice(QObject *parent=0)
Definition: propellerdevice.cpp:11
void setMinimumTimeout(quint32 milliseconds)
Definition: propellerdevice.cpp:129
static QStringList list()
Definition: propellerdevice.cpp:238
quint32 resetPeriod()
Definition: propellerdevice.cpp:252
void sendError(const QString &)
bool reset()
Definition: propellerdevice.cpp:199
void useDefaultReset()
Definition: propellerdevice.cpp:178
bool open()
Definition: propellerdevice.cpp:84
The PropellerDevice class provides access to serial Propeller devices.
Definition: propellerdevice.h:17
void setPortName(const QString &name)
Definition: propellerdevice.cpp:38
~PropellerDevice()
Definition: propellerdevice.cpp:32
quint32 calculateTimeout(quint32 bytes, quint32 safety_factor=15)
Definition: propellerdevice.cpp:144
quint32 minimumTimeout()
Definition: propellerdevice.cpp:118
void useReset(const QString &name, int pin=17)
Definition: propellerdevice.cpp:154