Documentation ¶
Index ¶
- type Display
- func (display *Display) Disconnect()
- func (display *Display) GetBatteryLevel() (batteryLevel int, err error)
- func (display *Display) GetID() (ID string, err error)
- func (display *Display) GetLocked() (unlocked bool, err error)
- func (display *Display) ReadBlindly() (data string, err error)
- func (display *Display) ReadBlindlyAndIgnore() (err error)
- func (display *Display) ReceiveCommandOutput(sentCommand string) (data string, err error)
- func (display *Display) Restart() (err error)
- func (display *Display) SendCloseFrame() (err error)
- func (display *Display) SendCommand(command string) (err error)
- func (display *Display) SendFrame(addr uint32, num uint8, data []byte) (err error)
- func (display *Display) SendImage(img image.Image) (err error)
- func (display *Display) SendImageBytes(data []byte) (err error)
- func (display *Display) SendImageScaled(img image.Image) (err error)
- func (display *Display) Shutdown() (err error)
- func (display *Display) Unlock(password string) (err error)
- type LoggingConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Display ¶
type Display struct { Connection io.ReadWriteCloser Width int Height int // contains filtered or unexported fields }
Display represents the physical display.
func NewDisplay ¶
func NewDisplay(conn io.ReadWriteCloser, password string) *Display
NewDisplay returns a new display, using a width of 400 and a height of 300. If the password is left empty, it is assumed that the display if unlocked.
func (*Display) Disconnect ¶
func (display *Display) Disconnect()
Disconnect closes the connection to the display
func (*Display) GetBatteryLevel ¶
GetBatteryLevel sends a command to the display to get its battery level. This requires the device to be unlocked.
func (*Display) ReadBlindly ¶
ReadBlindly reads any avalible data from the display and returns it (after formatting).
func (*Display) ReadBlindlyAndIgnore ¶
ReadBlindlyAndIgnore mindlessly reads data from the display and does not do anything wth it.
func (*Display) ReceiveCommandOutput ¶
ReceiveCommandOutput receives a previously sent command's output from the display.
func (*Display) Restart ¶
Restart sends a command to the display to restart it. This requires the device to be unlocked.
func (*Display) SendCloseFrame ¶
SendCloseFrame sends the last frame to the display
func (*Display) SendCommand ¶
SendCommand sends a command to the display.
func (*Display) SendFrame ¶
SendFrame sends a frame of image data to the display. This requires the display to be in data mode.
func (*Display) SendImage ¶
SendImage converts an image into bytes, then sends it to the display. If the image is not 400x300, it will crop it from the top left. This requires the display to be unlocked.
func (*Display) SendImageBytes ¶
SendImageBytes displays an array of bytes on the screen.
func (*Display) SendImageScaled ¶
SendImageScaled converts an image into bytes, then sends it to the display. If the image is not 400x300, it will resize it. This requires the display to be unlocked.
type LoggingConn ¶
LoggingConn is a connection that will optionally log all traffic.
func NewLoggingConn ¶
func NewLoggingConn(conn net.Conn, debug bool) *LoggingConn
NewLoggingConn returns a new connection that will optionally log all traffic.