ibutton

package
v0.0.0-...-0e89859 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2015 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ibutton provides access to Maxim iButton devices

Index

Constants

View Source
const (
	DS2422  deviceID = 0x00
	DS1923           = 0x20
	DS1922L          = 0x40
	DS1922T          = 0x60
	DS1922E          = 0x80
)

device identifier byte descriptors

Variables

This section is empty.

Functions

func Checksum

func Checksum(bytes []byte) uint16

Checksum returns the CRC16 checksum for the given byte array

Types

type Button

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

Button represents an iButton

func (*Button) ClearMemory

func (b *Button) ClearMemory() error

ClearMemory clears the ibutton memory

func (*Button) Close

func (b *Button) Close()

Close closes this iButton's 1-Wire session

func (*Button) CopyScratchpad

func (b *Button) CopyScratchpad() error

CopyScratchpad copies the scratchpad

func (*Button) Open

func (b *Button) Open() (err error)

Open opens this iButton's 1-Wire session

func (*Button) ReadLog

func (b *Button) ReadLog() (samples []Sample, err error)

ReadLog returns the log entries for the current mission

func (*Button) ReadScratchpad

func (b *Button) ReadScratchpad() (data []byte, err error)

ReadScratchpad reads the button scrathpad

func (*Button) StartMission

func (b *Button) StartMission() error

StartMission starts a mission

func (*Button) Status

func (b *Button) Status() (status *Status, err error)

Status returns the current iButton status

func (*Button) StopMission

func (b *Button) StopMission() error

StopMission stops the currently running mission

func (*Button) String

func (b *Button) String() string

func (*Button) WriteScratchpad

func (b *Button) WriteScratchpad() error

WriteScratchpad writes the button scrathpad

type Sample

type Sample struct {
	Time time.Time
	Temp Temperature
}

Sample represents a mission log sample

type Status

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

Status represents an iButton status. The iButton's status is saved in two register pages (0x0200-0x0263)

func (*Status) DeviceID

func (s *Status) DeviceID() (model deviceID)

DeviceID returns the device identifier

func (*Status) HighResolution

func (s *Status) HighResolution() bool

HighResolution true if the chip is in 16bit (0.0625°C) mode

func (*Status) MemoryCleared

func (s *Status) MemoryCleared() bool

MemoryCleared true when the memory has been successfully cleared (MEMCLR==1)

func (*Status) MissionInProgress

func (s *Status) MissionInProgress() bool

MissionInProgress true if a mission is running

func (*Status) MissionTimestamp

func (s *Status) MissionTimestamp() time.Time

MissionTimestamp the current mission timestamp

func (*Status) Name

func (s *Status) Name() string

Name the device model's name

func (*Status) SampleCount

func (s *Status) SampleCount() uint32

SampleCount count of recorded samples since last mission start

func (*Status) SampleRate

func (s *Status) SampleRate() (duration time.Duration)

SampleRate return the currently set sample rate

func (*Status) Time

func (s *Status) Time() time.Time

Time the time

type Temperature

type Temperature float32

Temperature represents a temperature

Directories

Path Synopsis
Package main provides a client for Maxim iButton devices
Package main provides a client for Maxim iButton devices
ibutton-gui

Jump to

Keyboard shortcuts

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