Documentation
¶
Overview ¶
Package tsc provides helper functions to work with TSC label printers.
Index ¶
Constants ¶
View Source
const ( DefaultPort = 9100 DefaultReadSize = 1024 DefaultTimeout = 250 * time.Millisecond )
View Source
const CmdStatus = "\x1B!?" // 1
Variables ¶
This section is empty.
Functions ¶
func DiscoverDev ¶
Discover discovers and returns usb devices paths that pass a status check. For now it only checks /dev/usb/libN on linux machines.
func PrintDuration ¶
PrintDurations estimates the time it takes to print a number of labels
Types ¶
type Conn ¶
type Conn struct {
Dev string
Conn ReadWriteCloser
Timeout time.Duration
}
Conn represents a connection to a TSC printer either using a device file or net connection.
type NetDiscovery ¶
func NewNetDiscovery ¶
func NewNetDiscovery(timeout time.Duration) *NetDiscovery
type ReadWriteCloser ¶
ReadWriteCloser is the abstraction covering both printer device files and net connections.
Click to show internal directories.
Click to hide internal directories.