2019-04-06 21:31:11 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
2019-04-12 02:15:28 +02:00
|
|
|
|
|
|
|
"janouch.name/sklad/ql"
|
2019-04-06 21:31:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-04-12 02:15:28 +02:00
|
|
|
printer, err := ql.Open()
|
2019-04-06 21:31:11 +02:00
|
|
|
if err != nil {
|
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
2019-04-12 02:15:28 +02:00
|
|
|
if printer == nil {
|
|
|
|
log.Fatalln("no suitable printer found")
|
2019-04-06 21:31:11 +02:00
|
|
|
}
|
2019-04-12 21:50:36 +02:00
|
|
|
|
2019-04-12 02:15:28 +02:00
|
|
|
defer printer.Close()
|
2019-04-06 21:31:11 +02:00
|
|
|
|
2019-04-12 02:15:28 +02:00
|
|
|
if err := printer.Initialize(); err != nil {
|
2019-04-06 21:31:11 +02:00
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
2019-04-12 21:50:36 +02:00
|
|
|
if err := printer.UpdateStatus(); err != nil {
|
2019-04-06 21:31:11 +02:00
|
|
|
log.Fatalln(err)
|
|
|
|
}
|
2019-04-12 21:50:36 +02:00
|
|
|
log.Printf("status\n%s", printer.LastStatus)
|
2019-04-06 21:31:11 +02:00
|
|
|
}
|