-
Notifications
You must be signed in to change notification settings - Fork 0
/
autorecoginze.h
42 lines (38 loc) · 985 Bytes
/
autorecoginze.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef AUTORECOGINZE_H
#define AUTORECOGINZE_H
#include <QObject>
#include <QtSerialPort/QSerialPortInfo>
#include <QMap>
class AutoRecoginze : public QObject
{
Q_OBJECT
public:
enum{
NO_CONNECT,
USB_CONNECTED=0x02,
MOTOR_CONNECTED=0x04,
};
static AutoRecoginze * getInstance();
static void autoDestroy();
bool startRecognize(bool bRetry = false);
void setAvailable();
void addMototInfo(quint8 nDeviceId,quint32 nDeviceMac);
void setConnectStatus(int nStatus);
protected:
explicit AutoRecoginze(QObject *parent = 0);
void findAvailablePorts();
signals:
public slots:
void openFailed();
void waitTimeout();
void onPortOpen(bool bSuccess);
private:
static AutoRecoginze * m_pAutoRecognize;
bool m_bFindAvaliable;
bool m_bTryNext;
QList <QSerialPortInfo> m_portList;
QMap<quint8,quint32> m_motorsInfo;
bool m_bHasSameId;
int m_nConnectStatus;
};
#endif // AUTORECOGINZE_H