gorecon

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

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

Go to latest
Published: Aug 21, 2016 License: MIT Imports: 5 Imported by: 0

README

GoRecon

This project implements Bitfinex Recons protocol for reading temperatures and controlling fan speeds.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel has methods to read and set current speed and temperatures

func NewChannel

func NewChannel(changeChan chan bool) *Channel

NewChannel returns the a new channel with defaults set

func (*Channel) AlarmTempC

func (c *Channel) AlarmTempC() int

AlarmTempC returns the current alarm temperature in Celsius

func (*Channel) AlarmTempF

func (c *Channel) AlarmTempF() int

AlarmTempF returns the current alarm termperature in Farenheit

func (*Channel) Export

func (c *Channel) Export() *ChannelExport

Export ...

func (*Channel) IsInitialized

func (c *Channel) IsInitialized() bool

IsInitialized checks if we've received initial data from fan controller

for this channel

func (*Channel) ManualSpeed

func (c *Channel) ManualSpeed() int

ManualSpeed returns the value of the controllers target speed (RPM)

func (*Channel) MarshalJSON

func (c *Channel) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*Channel) MaxSpeed

func (c *Channel) MaxSpeed() int

MaxSpeed returns the maximum speed that the fan supports (RPM)

func (*Channel) SetAlarmTempC

func (c *Channel) SetAlarmTempC(temp int) error

SetAlarmTempC sets the alarm termperature in Celsius

func (*Channel) SetAlarmTempF

func (c *Channel) SetAlarmTempF(temp int) error

SetAlarmTempF sets the alarm temperature in Farenheit

func (*Channel) SetSpeed

func (c *Channel) SetSpeed(speed int) error

SetSpeed changes the target speed of the fan controller (RPM)

func (*Channel) Speed

func (c *Channel) Speed() int

Speed returns the current speed (RPM)

func (*Channel) TempC

func (c *Channel) TempC() int

TempC returns current temperature in Celsius

func (*Channel) TempF

func (c *Channel) TempF() int

TempF returns current temperature in Farenheit

type ChannelExport

type ChannelExport struct {
	Speed       int `json:"speed"`
	MaxSpeed    int `json:"max_speed"`
	ManualSpeed int `json:"manual_speed"`
	TempF       int `json:"temp_f"`
	TempC       int `json:"temp_c"`
	AlarmTempF  int `json:"alarm_temp_f"`
	AlarmTempC  int `json:"alarm_temp_c"`
}

ChannelExport ...

type Device

type Device struct {
	Channels []*Channel
	// contains filtered or unexported fields
}

Device represents a Bitfinex Recon device

func NewDevice

func NewDevice(device io.ReadWriter, reportChan chan *Report) *Device

NewDevice initializes a device, optional second argument is a channel for

reporting events.

func (*Device) DisplayChannel

func (r *Device) DisplayChannel() int

DisplayChannel ...

func (*Device) Export

func (r *Device) Export() *DeviceExport

Export ...

func (*Device) IsAudioEnabled

func (r *Device) IsAudioEnabled() bool

IsAudioEnabled ...

func (*Device) IsInitialized

func (r *Device) IsInitialized() bool

IsInitialized ...

func (*Device) IsManual

func (r *Device) IsManual() bool

IsManual ...

func (*Device) IsStarted

func (r *Device) IsStarted() bool

IsStarted returns true if device polling is running

func (*Device) IsTempF

func (r *Device) IsTempF() bool

IsTempF ...

func (*Device) MarshalJSON

func (r *Device) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*Device) SetAudioEnabled

func (r *Device) SetAudioEnabled(b bool)

SetAudioEnabled ...

func (*Device) SetManual

func (r *Device) SetManual(b bool)

SetManual ...

func (*Device) SetTempF

func (r *Device) SetTempF(b bool)

SetTempF ...

func (*Device) Start

func (r *Device) Start() error

Start will start polling a device

func (*Device) Stop

func (r *Device) Stop()

Stop will stop the polling of a device

type DeviceExport

type DeviceExport struct {
	Audio          bool             `json:"audio"`
	Manual         bool             `json:"manual"`
	TempMode       string           `json:"temp_mode"`
	DisplayChannel int              `json:"display_channel"`
	Channels       []*ChannelExport `json:"channels"`
}

DeviceExport ...

type Report

type Report struct {
}

Report ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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