jpraus / arduino-opentherm

Arduino library and hardware shield to send and receive data from Opentherm devices
Other
164 stars 42 forks source link

Timeout does not occur if input level stays high #8

Closed istepaniuk closed 4 years ago

istepaniuk commented 4 years ago

During MODE_LISTEN, the timeout counter is only incremented/checked if the input level is low. If the input level stays high, the code will alternate between MODE_LISTEN and MODE_READ forever.

This means that the code would be stuck in a loop if the slave keeps the bus in such state that the input pin is high, which is unlikely during normal operation but can happen if the connections are wrong.

Moreover, this condition is impossible to detect without circumventing the library. Perhaps an additional error code could be added instead of just going back to MODE_LISTEN when something goes wrong during MODE_READ

jpraus commented 4 years ago

Thanks for reporting.