Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thisissoon/go-orbitip-nfc
A Go library for running an NFC reader server for Gemini 2000 Orbit IP devices. http://www.gemini2k.com/orbit-ip-poe-nfc-smart-card-reader/
https://github.com/thisissoon/go-orbitip-nfc
golang nfc orbitip server
Last synced: 5 days ago
JSON representation
A Go library for running an NFC reader server for Gemini 2000 Orbit IP devices. http://www.gemini2k.com/orbit-ip-poe-nfc-smart-card-reader/
- Host: GitHub
- URL: https://github.com/thisissoon/go-orbitip-nfc
- Owner: thisissoon
- License: mit
- Created: 2017-05-08T08:56:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-10T09:20:34.000Z (over 7 years ago)
- Last Synced: 2024-06-20T19:13:56.204Z (5 months ago)
- Topics: golang, nfc, orbitip, server
- Language: Go
- Size: 17.6 KB
- Stars: 1
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Orbit IP NFC
[![GoDoc](https://godoc.org/github.com/thisissoon/go-orbitip-nfc?status.svg)](https://godoc.org/github.com/thisissoon/go-orbitip-nfc)
A Go library for running an NFC reader server for Gemini 2000 Orbit IP devices (http://www.gemini2k.com/orbit-ip-poe-nfc-smart-card-reader/).
## Example
``` go
package mainimport (
"context"
"fmt"
"os"
"os/signal"
"syscall"orbitip "github.com/thisissoon/go-orbitip-nfc"
)func main() {
srv := orbitip.New(
":80",
orbitip.DefaultRoot,
orbitip.DefaultExt,
orbitip.Handlers{
orbitip.PowerUpCmd: func(rv orbitip.ResponseValues, p orbitip.Params) error {
fmt.Println("Power Up")
rv.UI(orbitip.UI{RedFlash: true, BuzzerIntermittent: true}, 5, 50)
return nil
},
orbitip.CardReadCmd: func(rv orbitip.ResponseValues, p orbitip.Params) error {
fmt.Println("Card Read")
rv.UI(orbitip.UI{GreenFlash: true, BuzzerIntermittent: true}, 3, 50)
return nil
},
orbitip.PingCmd: func(rv orbitip.ResponseValues, p orbitip.Params) error {
fmt.Println("Ping")
return nil
},
orbitip.LevelChangeCmd: func(rv orbitip.ResponseValues, p orbitip.Params) error {
fmt.Println("Level Change", p.Contact1, p.Contact2)
return nil
},
orbitip.LevelChangeCmd: func(rv orbitip.ResponseValues, p orbitip.Params) error {
fmt.Println("Heart Beat")
return nil
},
})
go srv.ListenAndServe()
defer srv.Shutdown(context.Background())
C := make(chan os.Signal, 1)
signal.Notify(C, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
<-C
}
```