m6e

package module
v0.0.0-...-dcbe523 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: MIT Imports: 4 Imported by: 0

README

go-m6e

ThingMagic M6E Nano driver

Documentation

Index

Constants

View Source
const (
	ResponseTemperature = iota
	ResponseKeepAlive
	ResponseTempThrottle
	ResponseTagFound
	ResponseNoTagFound
	ResponseUnknown
)

Variables

View Source
var ErrCmdResponseTimeout = errors.New("Command reponse timeout")
View Source
var ErrCorruptResponse = errors.New("Corrupt response")
View Source
var ErrUnknownOpcode = errors.New("Unknown opcode")
View Source
var ErrWrongOpcodeResponse = errors.New("Wrong opcode response")

Functions

This section is empty.

Types

type M6E

type M6E struct {
	// contains filtered or unexported fields
}

M6E device handle

func New

func New(cfg *serial.Config) (*M6E, error)

New creates a new M6E device-handle

func (*M6E) Close

func (m *M6E) Close() error

Close closes the connection

func (*M6E) DisableDebugging

func (m *M6E) DisableDebugging()

func (*M6E) DisableReadFilter

func (m *M6E) DisableReadFilter() error

func (*M6E) EnableDebugging

func (m *M6E) EnableDebugging()

func (*M6E) EnableReadFilter

func (m *M6E) EnableReadFilter() error

func (*M6E) GetReadPower

func (m *M6E) GetReadPower() (float32, error)

func (*M6E) GetVersion

func (m *M6E) GetVersion() error

func (*M6E) GetWritePower

func (m *M6E) GetWritePower() (float32, error)

func (*M6E) ReadMessage

func (m *M6E) ReadMessage() (*ResponseMessage, error)

func (*M6E) SetAntennaPort

func (m *M6E) SetAntennaPort() error

func (*M6E) SetBaud

func (m *M6E) SetBaud(baudRate int) error

func (*M6E) SetReadPower

func (m *M6E) SetReadPower(powerSetting float32) error

SetReadPower sets the read-power, enter a value between 1 and 27 (value in dBm)

func (*M6E) SetRegion

func (m *M6E) SetRegion(reg Region) error

func (*M6E) SetTagProtocol

func (m *M6E) SetTagProtocol(protocol TagProtocol) error

func (*M6E) SetWritePower

func (m *M6E) SetWritePower(powerSetting float32) error

SetWritePower sets the write-power, enter a value between 1 and 27 (value in dBm)

func (*M6E) StartReading

func (m *M6E) StartReading() error

StartReading disables filtering and start reading continuously

func (*M6E) StopReading

func (m *M6E) StopReading() error

StopReading stops continuous read. Give 1000 to 2000ms for the module to stop reading.

type PowerMode

type PowerMode byte
const (
	PowerModeFull    PowerMode = 0x00
	PowerModeMinSave PowerMode = 0x01
	PowerModeMedSave PowerMode = 0x02
	PowerModeMaxSave PowerMode = 0x03
)

type Region

type Region byte
const (
	RegionIndia        Region = 0x04
	RegionJapan        Region = 0x05
	RegionChina        Region = 0x06
	RegionEurope       Region = 0x08
	RegionKorea        Region = 0x09
	RegionAustralia    Region = 0x0B
	RegionNewZealand   Region = 0x0C
	RegionNorthAmerica Region = 0x0D
	RegionOpen         Region = 0xFF
)

type ResponseMessage

type ResponseMessage struct {
	Status int
	Data   []byte
}

type Tag

type Tag struct {
	RFU          []byte
	RSSI         int
	FrequencyMhz float32
	Time         time.Time
	Phase        int
	ProtocolID   TagProtocol
	EmbeddedData []byte
	TagPC        []byte
	TagID        []byte
	TagCRC       []byte
}

func ParseTag

func ParseTag(lastKeepAlive time.Time, data []byte) (*Tag, error)

type TagProtocol

type TagProtocol byte
const (
	TagProtocolNone            TagProtocol = 0x00
	TagProtocolISO180006B      TagProtocol = 0x03
	TagProtocolGEN2            TagProtocol = 0x05
	TagProtocolISO180006BUCODE TagProtocol = 0x06
	TagProtocolIPX64           TagProtocol = 0x07
	TagProtocolIPX256          TagProtocol = 0x08
	TagProtocolATA             TagProtocol = 0x1D
)

type UserMode

type UserMode byte
const (
	UserModeNone    UserMode = 0x00
	UserModePrinter UserMode = 0x01
	UserModePortal  UserMode = 0x03
)

Jump to

Keyboard shortcuts

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