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();
|
initBackends();
|
||||||
|
|
||||||
|
//QObject::connect(&zigateBkd, SIGNAL(readyRead()), &zigateBkd, SLOT(getData()));
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
extern QApplication a;
|
extern QApplication a;
|
||||||
extern ZigateBackend zigateBkd;
|
extern ZigateBackend zigateBkd;
|
||||||
|
//extern SerialManager serialManager;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -27,10 +27,8 @@ class SerialManager : public QSerialPort
|
|||||||
QString serialDeviceProduct;
|
QString serialDeviceProduct;
|
||||||
quint32 baudRate = 115200;
|
quint32 baudRate = 115200;
|
||||||
void write(QByteArray datas);
|
void write(QByteArray datas);
|
||||||
|
|
||||||
SerialManager();
|
SerialManager();
|
||||||
~SerialManager();
|
~SerialManager();
|
||||||
|
|
||||||
void initSerial();
|
void initSerial();
|
||||||
bool findSerialDevice();
|
bool findSerialDevice();
|
||||||
//void getData();
|
//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 de message
|
||||||
type = payloadD.mid(0, 2);
|
type = payloadD.mid(0, 2);
|
||||||
ln = payloadD.mid(2, 2).toHex().toUInt(nullptr, 16);
|
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)
|
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);
|
crctmp = crctmp ^ payloadD.at(0) ^ payloadD.at(1);
|
||||||
|
@ -128,10 +128,6 @@ class ZigateBackend : QObject
|
|||||||
//int interpretResult(QByteArray datas);
|
//int interpretResult(QByteArray datas);
|
||||||
//void getResponse();
|
//void getResponse();
|
||||||
bool resetCoordinator();
|
bool resetCoordinator();
|
||||||
void interpretResult();
|
|
||||||
|
|
||||||
// commands
|
|
||||||
void getVersion();
|
|
||||||
|
|
||||||
// commands
|
// commands
|
||||||
void getVersion();
|
void getVersion();
|
||||||
@ -330,6 +326,7 @@ class ZigateBackend : QObject
|
|||||||
{"FF02", " Xiaomi private"},
|
{"FF02", " Xiaomi private"},
|
||||||
{"1234", " Xiaomi private"}
|
{"1234", " Xiaomi private"}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user