Compare commits
5 Commits
threaded
...
3870af9918
Author | SHA1 | Date | |
---|---|---|---|
3870af9918 | |||
e3d48adb8d | |||
26d042eac3 | |||
2b430512e5 | |||
50621141bf |
Binary file not shown.
2
main.cpp
2
main.cpp
@ -17,8 +17,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
initBackends();
|
initBackends();
|
||||||
|
|
||||||
//QObject::connect(&zigateBkd, SIGNAL(readyRead()), &zigateBkd, SLOT(getData()));
|
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
extern QApplication a;
|
extern QApplication a;
|
||||||
extern ZigateBackend zigateBkd;
|
extern ZigateBackend zigateBkd;
|
||||||
//extern SerialManager serialManager;
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -27,8 +27,10 @@ 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();
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#ifndef VERSION_H
|
|
||||||
#define VERSION_H
|
|
||||||
|
|
||||||
QString version = "0.1";
|
|
||||||
|
|
||||||
|
|
||||||
#endif // VERSION_H
|
|
||||||
|
@ -153,6 +153,7 @@ 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,6 +128,10 @@ 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();
|
||||||
@ -326,7 +330,6 @@ class ZigateBackend : QObject
|
|||||||
{"FF02", " Xiaomi private"},
|
{"FF02", " Xiaomi private"},
|
||||||
{"1234", " Xiaomi private"}
|
{"1234", " Xiaomi private"}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user