skyremote

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

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

Go to latest
Published: Oct 12, 2018 License: MIT Imports: 6 Imported by: 1

README

go-skyremote

CircleCI CodeFactor

IMPORTANT - This is not an official library by BSkyB

Go library for controlling Sky+HD and SkyQ boxes over IP

Largely adapted from https://github.com/dalhundal/sky-remote

Usage

The bundled CLI is an example of how to use the library in your own applications. The CLI itself is very simple and let's you change the channel.

$ go run main.go --help
      --channel string   3 digit channel number (default "100")
      --ip string        IP of remote box
      --port int         Port on remote box (default 49160)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TCPDialer

func TCPDialer(host string, port int) (net.Conn, error)

TCPDialer returns a TCP connection

Types

type Command

type Command int

Command represents a button on the remote

const (
	CmdPower       Command = 0
	CmdSelect      Command = 1
	CmdBackup      Command = 2
	CmdDismiss     Command = 2
	CmdChannelup   Command = 6
	CmdChanneldown Command = 7
	CmdInteractive Command = 8
	CmdSidebar     Command = 8
	CmdHelp        Command = 9
	CmdServices    Command = 10
	CmdSearch      Command = 10
	CmdTvguide     Command = 11
	CmdHome        Command = 11
	CmdI           Command = 14
	CmdText        Command = 15
	CmdUp          Command = 16
	CmdDown        Command = 17
	CmdLeft        Command = 18
	CmdRight       Command = 19
	CmdRed         Command = 32
	CmdGreen       Command = 33
	CmdYellow      Command = 34
	CmdBlue        Command = 35
	Cmd0           Command = 48
	Cmd1           Command = 49
	Cmd2           Command = 50
	Cmd3           Command = 51
	Cmd4           Command = 52
	Cmd5           Command = 53
	Cmd6           Command = 54
	Cmd7           Command = 55
	Cmd8           Command = 56
	Cmd9           Command = 57
	CmdPlay        Command = 64
	CmdPause       Command = 65
	CmdStop        Command = 66
	CmdRecord      Command = 67
	CmdFastforward Command = 69
	CmdRewind      Command = 71
	CmdBoxoffice   Command = 240
	CmdSky         Command = 241
)

Set of commands (buttons) which can be sent

type DialFunc

type DialFunc func(host string, port int) (net.Conn, error)

DialFunc is a function used to connect to remote boxes

type SkyRemote

type SkyRemote struct {
	Host   string
	Port   int
	Dialer DialFunc
}

SkyRemote allows us to control Sky+HD and SkyQ boxes over IP

func New

func New(host string, port int) *SkyRemote

New SkyRemote with default TCP dialer

func (*SkyRemote) ChangeChannel

func (s *SkyRemote) ChangeChannel(ch string) error

ChangeChannel on a Sky box, takes in a string e.g. "115"

func (*SkyRemote) CommandFromDigit

func (s *SkyRemote) CommandFromDigit(n int) (Command, error)

CommandFromDigit returns the correct command from a single digit 0-9

func (*SkyRemote) SendCommand

func (s *SkyRemote) SendCommand(c Command) error

SendCommand to Sky box

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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