Improved collision detection for scan
This commit is contained in:
parent
ad4d307b57
commit
9fd35b781b
@ -280,7 +280,7 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
|
|||||||
if (_mbus_recv_event)
|
if (_mbus_recv_event)
|
||||||
_mbus_recv_event(MBUS_HANDLE_TYPE_SERIAL, buff, len);
|
_mbus_recv_event(MBUS_HANDLE_TYPE_SERIAL, buff, len);
|
||||||
|
|
||||||
if (remaining < 0)
|
if (remaining != 0)
|
||||||
{
|
{
|
||||||
// Would be OK when e.g. scanning the bus, otherwise it is a failure.
|
// Would be OK when e.g. scanning the bus, otherwise it is a failure.
|
||||||
// printf("%s: M-Bus layer failed to receive complete data.\n", __PRETTY_FUNCTION__);
|
// printf("%s: M-Bus layer failed to receive complete data.\n", __PRETTY_FUNCTION__);
|
||||||
|
@ -218,7 +218,7 @@ mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame)
|
|||||||
if (_mbus_recv_event)
|
if (_mbus_recv_event)
|
||||||
_mbus_recv_event(MBUS_HANDLE_TYPE_TCP, buff, len);
|
_mbus_recv_event(MBUS_HANDLE_TYPE_TCP, buff, len);
|
||||||
|
|
||||||
if (remaining < 0)
|
if (remaining != 0)
|
||||||
{
|
{
|
||||||
mbus_error_str_set("M-Bus layer failed to parse data.");
|
mbus_error_str_set("M-Bus layer failed to parse data.");
|
||||||
return -2;
|
return -2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user