aboutsummaryrefslogtreecommitdiff
path: root/brother-info/main.go
blob: a41d5e0915c0b5c4774c1518eb12c04e43842df0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

import (
	"log"

	"janouch.name/sklad/ql"
)

func main() {
	printer, err := ql.Open()
	if err != nil {
		log.Fatalln(err)
	}
	if printer == nil {
		log.Fatalln("no suitable printer found")
	}

	defer printer.Close()

	if err := printer.Initialize(); err != nil {
		log.Fatalln(err)
	}
	if err := printer.UpdateStatus(); err != nil {
		log.Fatalln(err)
	}
	log.Printf("status\n%s", printer.LastStatus)
}