slightlynybbled / di2008

Object-oriented API for DATAQ DI-2008
MIT License
5 stars 2 forks source link

Feature request: indication when data is ready #7

Open waterlubber opened 4 years ago

waterlubber commented 4 years ago

I've been using this library to write data to CSV and other logging purposes, and I can't seem to find a way to determine if a "fresh set" of readings from the device are available. It looks to me like it's just editing the .value attribute of the scan list objects whenever it parses the received data from the device. Is there a way to either set a variable or trigger a callback function so that I don't have to rely on sleep() statements for synchronization? If not, could this be a feature that is added? I might be able to hack it in by editing the library directly but I'd rather have it done by someone who has a better understanding of how this library works.

I am aware that the device sends its data in small packets, the event should fire when the scanlist completes. Thank you for any help you can provide.

slightlynybbled commented 4 years ago

I think I can do this without too much effort. I haven't done much work on this in some time, but I still use it almost daily and in production. It won't be tomorrow, but I should be able to work this in.