star

package
v0.0.0-...-f76e208 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRandomID

func MakeRandomID() string

MakeRandomID generates a random ID based on the specifications set for a Star USB ID

func SendUsbIDToPrinter

func SendUsbIDToPrinter(usbID string, address, bus, port int, printRebootMsg bool) error

SendUsbIDToPrinter sends the serial information to a certain USB endpoint If s is set to true, a message is printed on the printer to reboot

Types

type Printer

type Printer struct {
	Vendor       uint16
	Product      uint16
	Manufacturer string
	ProductName  string
	SerialNumber string
	Description  string
	Address      int
	Speed        string
	Bus          int
	Port         int
}

Printer defines the printer type

func (*Printer) SetUsbID

func (p *Printer) SetUsbID(usbID string, printRebootMsg bool) error

SetUsbID sets the USB-ID for printer

type PrinterList

type PrinterList []Printer

PrinterList is an array of printers

func (*PrinterList) Discover

func (pl *PrinterList) Discover() (int, error)

Discover scans the USB for Star devices

func (*PrinterList) SetGenericIDForAll

func (pl *PrinterList) SetGenericIDForAll() (int, error)

SetGenericIDForAll set a generic ID for all printers without an ID Error is set if something goes wrong

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL