fix bug
This commit is contained in:
1 parent
afff934e77
commit
a95b4d21d1
2 files changed
+6
No files matched your search
@@ -7,6 +7,7 @@
|
|||||||
// HLK-LD2453 protocol.
|
// HLK-LD2453 protocol.
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
#include "LD2453Parser.h"
|
#include "LD2453Parser.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#if !defined(ARDUINO_ARCH_ESP32)
|
#if !defined(ARDUINO_ARCH_ESP32)
|
||||||
#warning "LD2453Parser was written/tested against the ESP32 Arduino core. Verify HardwareSerial pin-remap behavior on other cores."
|
#warning "LD2453Parser was written/tested against the ESP32 Arduino core. Verify HardwareSerial pin-remap behavior on other cores."
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ public:
|
|||||||
|
|
||||||
const RadarFrame &getLastFrame() const { return _lastFrame; }
|
const RadarFrame &getLastFrame() const { return _lastFrame; }
|
||||||
const LD2453Stats &getStats() const { return _stats; }
|
const LD2453Stats &getStats() const { return _stats; }
|
||||||
|
|
||||||
|
// Kiểm tra xem có đang nhận dữ liệu từ LD2453 không
|
||||||
|
bool isConnected() const {
|
||||||
|
return _stats.bytesReceived > 0 && (millis() - _lastByteTime) < 2000;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HardwareSerial *_serial = nullptr;
|
HardwareSerial *_serial = nullptr;
|
||||||
|
|||||||
Reference in new issue
Block a user