Snippet - Example DS2401+ driver

I just posted Example DS2401+ driver on Codeshare. Feel free to discuss and make suggestions here.

1 Like

Hi, I would add a test on the first byte to ensure that the detected device is well a DS2401 or not.

I would also use:

This returns all devices on the network…

@ leforban - Thanks for the feedback, I will add the chip family logic in a future update. I am not sure that “FindAllDevices” should be placed in the driver but rather a base class for all onewire devices connected to the system, so maybe I will add that if I ever go beyond having a single onewire device.

I must say that “FindAllDevices” actually returns the serial number of the device anyway so my implementation is actually redundant :wall: Oh how I wish that MS added proper XML documentation to their code so intelisense actually told you what you were doing with some of these classes… However since onewire examples are thin on the ground, It still at least the example explains the basic concept.