command

package
v0.0.0-...-8bc70f8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_GET_SCALE_PAR byte = 0x75
	CMD_ACK_SCALE_PAR byte = 0x76
	CMD_ERROR         byte = 0x28
	CMD_GET_MASSA     byte = 0x23
	CMD_ACK_MASSA     byte = 0x24
	CMD_SET_TARE      byte = 0xA3
	CMD_ACK_SET_TARE  byte = 0x12
	CMD_NACK_TARE     byte = 0x15
	CMD_SET_ZERO      byte = 0x72
	CMD_ACK_SET       byte = 0x27
	CMD_GET_NAME      byte = 0x20
	CMD_ACK_NAME      byte = 0x21
	CMD_SET_NAME      byte = 0x22
	CMD_GET_ETHERNET  byte = 0x2D
	CMD_ACK_ETHERNET  byte = 0x2E
	CMD_SET_ETHERNET  byte = 0x39
	CMD_GET_WIFI_IP   byte = 0x33
	CMD_ACK_WIFI_IP   byte = 0x34
	CMD_SET_WIFI_IP   byte = 0x31
	CMD_GET_WIFI_SSID byte = 0x3A
	CMD_SET_WIFI_SSID byte = 0x3C
	CMD_NACK          byte = 0x3F
)

Variables

View Source
var HEADERS = [3]byte{0xF8, 0x55, 0xCE}

Functions

func GetErrorMesage

func GetErrorMesage(code byte) string

Types

type Head struct {
	Headers [3]byte
	Len     int16
	Message []byte
	Crc16   int16
}

func NewGetInstantWeightHead

func NewGetInstantWeightHead() *Head

func NewGetScaleHead

func NewGetScaleHead() *Head

func NewHead

func NewHead() *Head

func NewSetTareHead

func NewSetTareHead(tVal [4]byte) *Head

func NewSetZeroHead

func NewSetZeroHead() *Head

func ReadHead

func ReadHead(buf io.Reader) (*Head, error)

func (*Head) Write

func (h *Head) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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