Closed MalcolmBoura closed 2 years ago
Why not propose these changes directly to maintainer of OneWire class? (pjrc.com)
Why not propose these changes directly to maintainer of OneWire class? (pjrc.com)
I will be doing but first I would like to see the discussion of getAddress, see #166, progress further. I have some ideas on that and will make the suggestions there.
As I have too much work at the moment it is hard for me to participate , sorry
Following the useful discussion on #166 I have come to the conclusion that these methods, at least in their present form, do not really belong in DallasTemperature or OneWire.
OneWireManager::getAddress(deviceIndex); OneWireManager::getOneWire(deviceIndex) OneWire::readPowerSupply(deviceAddress) OneWire::readPowerSupply() // for the bus as a whole which is usually what is required OneWireManager::readPowerSupply(deviceIndex)
Deprecate getDeviceCount(), getDS18Count() and replace with an iterator
I have started coding and it is all falling into place quite nicely which is a good sign. When it has progressed a bit further I will publish it via github.
Good action, (I try to keep reading your posts)
Please keep in mind that for the Arduino platform a lot of people are at beginner level.
Good to make a sophisticated level, but do not forget those who can just walk and are not able to run yet :)
Several functions operate on the entire OneWire bus or apply to all OneWire devices. They should be part of either OneWire or a OneWire extension class. getAddress() readPowerSupply() getDeviceCount() Addresses would also benefit from being a class.
Removing the functions from DallasTemperature is likely to break things so unfortunately they have to be retained but should be deprecated and should be rewritten so that they call the replacement OneWire functions. As an intermediate step I am writing a OneWire extension class.
It should be possible to write an Address class that can be dropped in and used interchangeably with the uint8_t* approach. I have made a start on that and it looks promising.