bt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PrintServiceUUID *bluetooth.UUID
	WriteUUID        *bluetooth.UUID
	NotificationUUID *bluetooth.UUID
)

Functions

func FindDevice

func FindDevice(name string, adapter *bluetooth.Adapter) (bluetooth.Addresser, error)

FindDevice search for the named BLE device and returns its address; it search indefinitely but can be stopped by pressing any key. The `adapter` parameter is a Bluetooth adapter that must be enabled before calling this function.

func SendCommands

func SendCommands(adapter *bluetooth.Adapter, address bluetooth.Addresser, commands chan []byte) error

SendCommands reads from the `commands` channel and send commands to the printer, ensuring a certain chunk size (20 bytes) and a small delay between each write.

Types

This section is empty.

Jump to

Keyboard shortcuts

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