-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
piglow: presence of both Shutdown and Close confuses #25
Comments
I was wondering the same. Is there value in shutting down without closing? |
|
@zankich can you think of a good reason why someone would want to shutdown and not close the device? If you do, we should probably keep both methods, but either way, I think that we should always shutdown during closing tho, what do you think? |
@mattetti I can imagine a case where you want to set a persistent color on your PiGlow, but do not want to have a program running in the background. Some process may wake up and set the colors to a specific pattern and then exit, or if you have a more complex system a routine which opens a connection to the PiGlow and and then closes the connection when it's finished. If you sent the PiGlow a |
Hmm that's very interesting. That's a totally realistic use case IMHO and does justify the 2 methods. Maybe some documentation might clarify why there are two methods. After all both Burcu and I were surprised. |
Yeah the documentation could be clearer for sure. I took a first stab at it with my PR, but there is definitely room to improve. |
You can close the file descriptor and it will keep using displaying the latest state. These devices are state machines, not going to stop working when you close the I2C connection through devfs. |
Isn't it possible to do the shutdown in Close? Is there a reason why Shutdown has to be a separate method?
The text was updated successfully, but these errors were encountered: