Open crates-barrels opened 6 years ago
There are some fundamental issues with the error handling that should be addressed and this is for sure one of them, thanks for the report!
Also the status handling in the chip is not handled in a good way. As long as I find the time I am planning a new release later this year or in the beginning of next.
In
WaitForOneWireReady()
, anew Stopwatch()
is created, but never started. As a result, the if-test(stopWatch.ElapsedMilliseconds > 5000)
will never evaluate to true: https://github.com/Rinsen/OneWire/blob/a102c234155c33506b28b4c5500c9bdd784c7b11/src/Rinsen.IoT.OneWire/DS2482_100.cs#L329-L337 This can easily be fixed by changing line 329 tovar stopWatch = Stopwatch.StartNew();
The same issue can be found in this piece of code in
ReadStatus(bool setReadPointerToStatus = false)
: https://github.com/Rinsen/OneWire/blob/a102c234155c33506b28b4c5500c9bdd784c7b11/src/Rinsen.IoT.OneWire/DS2482_100.cs#L313-L321 Also, is the 1 millisecond time-out here not way too short? Or is there a specific reason for this?Regards