Compare commits
1 Commits
3870af9918
...
threaded
Author | SHA1 | Date | |
---|---|---|---|
238b0453f8 |
Binary file not shown.
2
main.cpp
2
main.cpp
@ -17,6 +17,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
initBackends();
|
||||
|
||||
//QObject::connect(&zigateBkd, SIGNAL(readyRead()), &zigateBkd, SLOT(getData()));
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
extern QApplication a;
|
||||
extern ZigateBackend zigateBkd;
|
||||
//extern SerialManager serialManager;
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -27,10 +27,8 @@ class SerialManager : public QSerialPort
|
||||
QString serialDeviceProduct;
|
||||
quint32 baudRate = 115200;
|
||||
void write(QByteArray datas);
|
||||
|
||||
SerialManager();
|
||||
~SerialManager();
|
||||
|
||||
void initSerial();
|
||||
bool findSerialDevice();
|
||||
//void getData();
|
||||
|
@ -0,0 +1,7 @@
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
QString version = "0.1";
|
||||
|
||||
|
||||
#endif // VERSION_H
|
||||
|
@ -153,7 +153,6 @@ void ZigateBackend::interpretResult(QByteArray payload)
|
||||
//type de message
|
||||
type = payloadD.mid(0, 2);
|
||||
ln = payloadD.mid(2, 2).toHex().toUInt(nullptr, 16);
|
||||
|
||||
if ((unsigned char)type[0] == 128 or (unsigned char)type[0] == 0 or (unsigned char)type[0] == 153)
|
||||
{
|
||||
crctmp = crctmp ^ payloadD.at(0) ^ payloadD.at(1);
|
||||
|
@ -128,10 +128,6 @@ class ZigateBackend : QObject
|
||||
//int interpretResult(QByteArray datas);
|
||||
//void getResponse();
|
||||
bool resetCoordinator();
|
||||
void interpretResult();
|
||||
|
||||
// commands
|
||||
void getVersion();
|
||||
|
||||
// commands
|
||||
void getVersion();
|
||||
@ -330,6 +326,7 @@ class ZigateBackend : QObject
|
||||
{"FF02", " Xiaomi private"},
|
||||
{"1234", " Xiaomi private"}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user