aboutsummaryrefslogtreecommitdiff
path: root/redbutton.go
diff options
context:
space:
mode:
Diffstat (limited to 'redbutton.go')
-rw-r--r--redbutton.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/redbutton.go b/redbutton.go
index 549ed9d..a0e069c 100644
--- a/redbutton.go
+++ b/redbutton.go
@@ -12,7 +12,7 @@ type Button struct {
Lid bool
}
-func GetState(dev *hid.Device) (Button, error) {
+func State(dev *hid.Device) (Button, error) {
buf := make([]byte, 8)
buf[0] = 0x01
buf[7] = 0x02
@@ -35,11 +35,11 @@ func GetState(dev *hid.Device) (Button, error) {
}, nil
}
-func PollState(dev *hid.Device) <-chan Button {
+func Poll(dev *hid.Device) <-chan Button {
ch := make(chan Button)
go func() {
for {
- state, err := GetState(dev)
+ state, err := State(dev)
if err != nil {
panic(err)
}