kopia lustrzana https://github.com/weetmuts/wmbusmeters
Print warning if decode of zero length telegram is attempted.
rodzic
006c88239f
commit
205b5593a8
|
@ -4126,6 +4126,8 @@ bool BusDeviceCommonImplementation::handleTelegram(AboutTelegram &about, vector<
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
last_received_ = time(NULL);
|
last_received_ = time(NULL);
|
||||||
|
|
||||||
|
assert(frame.size() > 0);
|
||||||
|
|
||||||
if (about.type == FrameType::MBUS && frame.size() == 1)
|
if (about.type == FrameType::MBUS && frame.size() == 1)
|
||||||
{
|
{
|
||||||
if (frame[0] == 0xe5)
|
if (frame[0] == 0xe5)
|
||||||
|
|
|
@ -211,6 +211,14 @@ void WMBusRawTTY::processSerialData()
|
||||||
{
|
{
|
||||||
FrameStatus status = checkWMBusFrame(data_buffer_, &frame_length, &payload_len, &payload_offset, false);
|
FrameStatus status = checkWMBusFrame(data_buffer_, &frame_length, &payload_len, &payload_offset, false);
|
||||||
|
|
||||||
|
if (payload_len == 0)
|
||||||
|
{
|
||||||
|
verbose("(rawtty) protocol error in message received length byte is zero!\n");
|
||||||
|
string msg = bin2hex(data_buffer_);
|
||||||
|
debug("(rawtty) protocol error \"%s\"\n", msg.c_str());
|
||||||
|
data_buffer_.clear();
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (status == PartialFrame)
|
if (status == PartialFrame)
|
||||||
{
|
{
|
||||||
// Partial frame, stop eating.
|
// Partial frame, stop eating.
|
||||||
|
|
Ładowanie…
Reference in New Issue