Improved collision detection for scan

This commit is contained in:
Stefan Wahren 2012-05-29 19:39:56 +02:00
parent ad4d307b57
commit 9fd35b781b
2 changed files with 2 additions and 2 deletions

View File

@ -280,7 +280,7 @@ mbus_serial_recv_frame(mbus_serial_handle *handle, mbus_frame *frame)
if (_mbus_recv_event)
_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.
// printf("%s: M-Bus layer failed to receive complete data.\n", __PRETTY_FUNCTION__);

View File

@ -218,7 +218,7 @@ mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame)
if (_mbus_recv_event)
_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.");
return -2;