bdm

package module
v0.0.0-...-429c8fe Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2015 License: MIT Imports: 3 Imported by: 0

README

BDM4065UC11

This is a RS-232C library for BDM4065UC/11.

GoDoc Build Status Coverage Status

Installation

go get github.com/pocke/BDM4065UC11

Usage

c, err := bdm.New("/dev/ttyUSB0", 9600)
if err != nil {
  panic(err)
}
defer c.Close()

// Get model number
data, err := c.Send([]byte{0xA2, 0x01})
if err != nil {
  panic(err)
}

fmt.Println(data.String())  // => BDM4065UC

Refs

Official manual

Documentation

Index

Constants

View Source
const (
	GetVersion byte = 0xA2

	GetPowerState byte = 0x19
	SetPowerState byte = 0x18

	GetUserInputControl      byte = 0x1D
	SetUserInputControl      byte = 0x1C
	GetUserInputControlState byte = 0x1B
	SetUserInputControlState byte = 0x1A

	GetPowerAtColdStart byte = 0xA4
	SetPowerAtColdStart byte = 0xA3

	// TODO: argument and result
	SetInputSource byte = 0xAC

	GetCurrentSource byte = 0xAD

	GetAutoSignalDetecting byte = 0xAF
	SetAutoSignalDetecting byte = 0xAE

	GetVideoParameters  byte = 0x33
	SetVideoParameters  byte = 0x32
	GetColorTemperature byte = 0x35
	SetColorTemperature byte = 0x34
	GetColorParameters  byte = 0x37
	SetColorParameters  byte = 0x36

	GetPictureFormat      byte = 0x3B
	SetPictureFormat      byte = 0x3A
	GetVGAVideoParameters byte = 0x39
	SetVGAVideoParameters byte = 0x38

	GetPictureInPicture byte = 0x3D
	SetPictureInPicture byte = 0x3C

	GetPIPSource byte = 0x85
	SetPIPSource byte = 0x84

	GetVolume byte = 0x45
	SetVolume byte = 0x44

	SetVolumeLimits byte = 0xB8

	GetAudioParameters byte = 0x43
	SetAudioParameters byte = 0x42

	GetMiscInfo byte = 0x0F

	GetSmartPower byte = 0xDE
	SetSmartPower byte = 0xDD

	SetVideoAlignment byte = 0x70

	GetTemperature byte = 0x2F

	GetSerialCode byte = 0x15

	GetTiling byte = 0x23
	SetTiling byte = 0x22

	GetlightSensor byte = 0x25
	SetlightSensor byte = 0x24

	GetOSDRotating byte = 0x27
	SetOSDRotating byte = 0x26

	GetInformationOSDFeature byte = 0x2D
	SetInformationOSDFeature byte = 0x2C

	GetMEMCEffect byte = 0x29
	SetMEMCEffect byte = 0x28

	GetTouchFeature byte = 0x1F
	SetTouchFeature byte = 0x1E

	GetNoiseReductionFeature byte = 0x2B
	SetNoiseReductionFeature byte = 0x2A

	GetScanModeFeature byte = 0x51
	SetScanModeFeature byte = 0x50

	GetScanConversionFeature byte = 0x53
	SetScanConversionFeature byte = 0x52

	GetSwitchOnDelayFeature byte = 0x55
	SetSwitchOnDelayFeature byte = 0x54

	SetFactoryReset byte = 0x56
)

Commands

View Source
const (
	SICPVersion     byte = 0x00
	PlatformVersion byte = 0x01
)

Arguments for get version command.

View Source
const (
	PowerStateOff byte = 0x01
	PowerStateOn  byte = 0x02
)

Arguments and result for power state.

View Source
const (
	UserInputMaskLocked   byte = 0x00 // 0b00000000
	UserInputMaskUnlocked byte = 0xff // 0b11111111

	UserInputMaskLocalKeyboard byte = 0x02 // 0b00000010
	UserInputMaskRemoteControl byte = 0x01 // 0b00000001

	UserInputLockAll          byte = 0x01
	UserInputLockAllButVolume byte = 0x02
	UserInputLockAllButPower  byte = 0x03
)

Arguments and result for user input control

View Source
const (
	PowerAtColdStartPowerOff   byte = 0x00
	PowerAtColdStartForcedOn   byte = 0x01
	PowerAtColdStartLastStatus byte = 0x02
)

Argumetns and result for power state at cold start.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is RS-232C client.

func New

func New(port string, baud int) (*Client, error)

New open a serial port and returns a new client.

func (*Client) Close

func (c *Client) Close() error

Close closes a serial port.

func (*Client) IsPowerOn

func (c *Client) IsPowerOn() (bool, error)

func (*Client) PlatformVersion

func (c *Client) PlatformVersion() (string, error)

func (*Client) PowerOff

func (c *Client) PowerOff() error

func (*Client) PowerOn

func (c *Client) PowerOn() error

func (*Client) SICPVersion

func (c *Client) SICPVersion() (string, error)

func (*Client) Send

func (c *Client) Send(data []byte) (Result, error)

Send writes data to the display, and reads result from the display.

type Result

type Result []byte

Result is result to read from display.

|                         Header                         |              Data             | Checksum |
[Header] [MonitorID] [Category] [Page] [Length] [Control] [Command] [Data 0] ... [Data N] [Checksum]
[Header] [MonitorID] [Category] [Page] [Length] [Control] [Data 0] [Status]               [Checksum]

func (Result) CheckChecksum

func (r Result) CheckChecksum() error

CHeckChecksum checks checksum. Returns an error if data is incosistent.

func (Result) Data

func (r Result) Data() []byte

Data returns data.

func (Result) Header

func (r Result) Header() []byte

Header returns header.

func (Result) String

func (r Result) String() string

For implement fmt.Stringer

Directories

Path Synopsis
_examples
model_num command
toggle_power command

Jump to

Keyboard shortcuts

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