Documentation ¶
Index ¶
- Variables
- type ArgonOne
- type ArgonOnePowerMode
- type AudioContext
- type AudioManager
- type Command
- type CommandFunc
- type Config
- type Conn
- type ConnPool
- type DecodeFrameIteratorFunc
- type DecodeIteratorFunc
- type Display
- type DisplayFlag
- type DisplayManager
- type EPD
- type Error
- type Event
- type Field
- type FilePoll
- type FilePollFlags
- type FilePollFunc
- type FontFace
- type FontFlags
- type FontManager
- type FontSize
- type FontSizeUnit
- type GPIO
- type GPIOEdge
- type GPIOEvent
- type GPIOMode
- type GPIOPin
- type GPIOPull
- type GPIOState
- type HttpStatic
- type I2C
- type I2CBus
- type InputDevice
- type InputDeviceType
- type InputEvent
- type InputManager
- type InputService
- type InputStub
- type InputType
- type KeyCode
- type LIRC
- type LIRCEvent
- type LIRCKeycodeManager
- type LIRCMode
- type LIRCType
- type Logger
- type Measurement
- type Media
- type MediaCodec
- type MediaDecodeContext
- type MediaFlag
- type MediaFrame
- type MediaInput
- type MediaKey
- type MediaManager
- type MediaMetadata
- type MediaOutput
- type MediaPacket
- type MediaStream
- type MetricWriter
- type Metrics
- type PingService
- type PingStub
- type Platform
- type PlatformType
- type Point
- type Publisher
- type SPI
- type SPIBus
- type SPIMode
- type Server
- type Service
- type ServiceDiscovery
- type ServiceFlag
- type ServiceRecord
- type ServiceStub
- type Size
- type Surface
- type SurfaceFlags
- type SurfaceFormat
- type SurfaceManager
- type Unit
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( ZeroPoint = Point{0, 0} ZeroSize = Size{0, 0} )
Functions ¶
This section is empty.
Types ¶
type ArgonOne ¶
type ArgonOne interface { // Set fan duty cycle (0-100) SetFan(uint8) error // Set Power Mode SetPower(ArgonOnePowerMode) error }
type ArgonOnePowerMode ¶
type ArgonOnePowerMode uint
const ( ARGONONE_POWER_DEFAULT ArgonOnePowerMode = iota ARGONONE_POWER_ALWAYSON ARGONONE_POWER_UART )
func (ArgonOnePowerMode) String ¶
func (v ArgonOnePowerMode) String() string
type AudioContext ¶ added in v3.0.3
type AudioContext interface { // Write data to audio output device Write(MediaFrame) error }
type AudioManager ¶ added in v3.0.3
type AudioManager interface { // OpenDefaultSink opens default output device OpenDefaultSink() (AudioContext, error) // Close audio stream Close(AudioContext) error }
type Command ¶
type Command interface { Name() string // Return command name Usage() (string, string) // Return command syntax and description Args() []string // Return command arguments Run(context.Context) error // Run the command }
Command is determined from parsed arguments
type CommandFunc ¶
CommandFunc is the function signature for running a command
type Config ¶
type Config interface { Parse() error // Parse command line arguments Args() []string // Return arguments, not including flags Usage(string) // Print out usage for all or specific command Version() Version // Return version information // Define flags FlagString(string, string, string, ...string) *string FlagBool(string, bool, string, ...string) *bool FlagUint(string, uint, string, ...string) *uint FlagInt(string, int, string, ...string) *int FlagDuration(string, time.Duration, string, ...string) *time.Duration FlagFloat(string, float64, string, ...string) *float64 // Define a command with name, description, calling function Command(string, string, CommandFunc) error // Get command from provided arguments GetCommand([]string) (Command, error) // Get flag values GetString(string) string GetBool(string) bool GetUint(string) uint GetInt(string) int GetDuration(string) time.Duration GetFloat(string) float64 }
type Conn ¶
type Conn interface { // Addr returns the bound server address, or empty string if connection is closed Addr() string // Mutex Lock() // Lock during RPC call Unlock() // Unlock at end of RPC call // ListServices returns a list of all services supported by the // remote server ListServices(context.Context) ([]string, error) // NewStub returns the stub for a named service NewStub(string) ServiceStub // Err translates service error codes to gopi error types Err(error) error }
Conn is a connection to a remote server
type DecodeFrameIteratorFunc ¶
type DecodeFrameIteratorFunc func(MediaFrame) error
type DecodeIteratorFunc ¶
type DecodeIteratorFunc func(MediaDecodeContext, MediaPacket) error
type Display ¶
type Display interface { Id() uint32 // Return display number Flags() DisplayFlag // Return information about the display Name() string // Return name of the display Size() (uint32, uint32) // Return display size for nominated display number, or (0,0) if display does not exist PixelsPerInch() uint32 // Return the PPI (pixels-per-inch) for the display, or return zero if unknown }
Display implements a pixel-based display device
type DisplayFlag ¶ added in v3.0.4
type DisplayFlag uint32
const ( DISPLAY_FLAG_HDMI DisplayFlag = (1 << iota) DISPLAY_FLAG_DVI DISPLAY_FLAG_LCD DISPLAY_FLAG_SDTV DISPLAY_FLAG_NTSC DISPLAY_FLAG_PAL DISPLAY_FLAG_UNPLUGGED DISPLAY_FLAG_ATTACHED DISPLAY_FLAG_NONE DisplayFlag = 0 DISPLAY_FLAG_MIN = DISPLAY_FLAG_HDMI DISPLAY_FLAG_MAX = DISPLAY_FLAG_ATTACHED )
func (DisplayFlag) FlagString ¶ added in v3.0.4
func (f DisplayFlag) FlagString() string
func (DisplayFlag) String ¶ added in v3.0.4
func (f DisplayFlag) String() string
type DisplayManager ¶ added in v3.0.4
type DisplayManager interface { // Displays return all attached displays Displays() []Display // Displays returns specific display Display(uint32) (Display, error) // PowerOn a display, can return ErrNotImplemented if // a specific display does not support control PowerOn(Display) error // PowerOff a display, can return ErrNotImplemented if // a specific display does not support control PowerOff(Display) error }
DisplayManager manages the connected displays and emits Display objects when their state changes
type EPD ¶ added in v3.0.3
type EPD interface { // Return screen size Size() Size // Clear display Clear(context.Context) error // Draw image on the display Draw(context.Context, image.Image) error // Size image and draw on the display. A size value of // 1.0 is equivalent to calling Draw DrawSized(context.Context, float64, image.Image) error // Sleep display Sleep() error }
type Event ¶
type Event interface {
Name() string // Return name of the event
}
Event is an emitted event
type Field ¶
type Field interface { // Name returns field name Name() string // Kind returns kind of field or nil Kind() string // IsNil returns true if value is nil IsNil() bool // Value returns field value, or nil Value() interface{} // SetValue sets specific value and returns error if unsupported SetValue(interface{}) error // Copy returns a copy of the field Copy() Field }
type FilePoll ¶
type FilePoll interface { // Watch a file descriptor for changes Watch(uintptr, FilePollFlags, FilePollFunc) error // Unwatch a file descriptor Unwatch(uintptr) error }
type FilePollFlags ¶
type FilePollFlags uint
Read and Write flags
const ( FILEPOLL_FLAG_READ FilePollFlags = (1 << iota) // File descriptor ready for reading FILEPOLL_FLAG_WRITE // File descriptor ready for writing FILEPOLL_FLAG_NONE FilePollFlags = 0 FILEPOLL_FLAG_MIN FilePollFlags = FILEPOLL_FLAG_READ FILEPOLL_FLAG_MAX FilePollFlags = FILEPOLL_FLAG_WRITE )
func (FilePollFlags) String ¶
func (f FilePollFlags) String() string
func (FilePollFlags) StringFlag ¶
func (f FilePollFlags) StringFlag() string
type FilePollFunc ¶
type FilePollFunc func(uintptr, FilePollFlags)
FilePollFunc is the handler for file polling
type FontFace ¶
type FontFace interface { Name() string // Get Face Name (from the filename) Index() uint // Get Face Index NumFaces() uint // Get Number of faces within the file NumGlyphs() uint // Number of glyphs for the face Family() string // Return name of font family Style() string // Return style name of font face Flags() FontFlags // Return properties for face }
FontFace represents a typeface
type FontManager ¶
type FontManager interface { // Open a font face - first face at index 0 is loaded OpenFace(path string) (FontFace, error) // Open a font face - indexed within file of several faces OpenFaceAtIndex(path string, index uint) (FontFace, error) // Open font faces at path, checking to see if individual files should // be opened through a callback function OpenFacesAtPath(path string, callback func(manager FontManager, path string, info os.FileInfo) bool) error // Destroy a font face DestroyFace(FontFace) error // Return an array of font families which are loaded Families() []string // Return faces in a family and/or with a particular set of attributes Faces(family string, flags FontFlags) []FontFace }
FontManager for font management
type FontSize ¶
type FontSize struct { Size float32 Unit FontSizeUnit }
type FontSizeUnit ¶
type FontSizeUnit uint
const ( FONT_SIZE_PIXELS FontSizeUnit = iota FONT_SIZE_POINTS )
type GPIO ¶
type GPIO interface { // Return number of physical pins, or 0 if if cannot be returned // or nothing is known about physical pins NumberOfPhysicalPins() uint // Return array of available logical pins or nil if nothing is // known about pins Pins() []GPIOPin // Return logical pin for physical pin number. Returns // GPIO_PIN_NONE where there is no logical pin at that position // or we don't now about the physical pins PhysicalPin(uint) GPIOPin // Return physical pin number for logical pin. Returns 0 where there // is no physical pin for this logical pin, or we don't know anything // about the layout PhysicalPinForPin(GPIOPin) uint // Read pin state ReadPin(GPIOPin) GPIOState // Write pin state WritePin(GPIOPin, GPIOState) // Get pin mode GetPinMode(GPIOPin) GPIOMode // Set pin mode SetPinMode(GPIOPin, GPIOMode) // Set pull mode to pull down or pull up - will // return ErrNotImplemented if not supported SetPullMode(GPIOPin, GPIOPull) error // Start watching for rising and/or falling edge, // or stop watching when GPIO_EDGE_NONE is passed. // Will return ErrNotImplemented if not supported Watch(GPIOPin, GPIOEdge) error }
GPIO implements the GPIO interface for simple input and output
type GPIOEvent ¶ added in v3.0.3
GPIOEvent happens when a pin is watched and edge is either rising or falling
type GPIOPin ¶
type GPIOPin uint8 // GPIOPin is the logical GPIO pin
const ( // Invalid pin constant GPIO_PIN_NONE GPIOPin = 0xFF )
type GPIOPull ¶
type GPIOPull uint8 // GPIOPull is the GPIO Pin resistor configuration (pull up/down or floating)
type HttpStatic ¶ added in v3.0.4
type HttpStatic interface { // Serve a folder and child folders with root URL as "path" ServeFolder(path, folder string) error }
HttpStatic serves files and folders from the filesystem
type I2C ¶
type I2C interface { // Return all valid devices Devices() []I2CBus // Set current slave address SetSlave(I2CBus, uint8) error // Get current slave address GetSlave(I2CBus) uint8 // Return true if a slave was detected at a particular address DetectSlave(I2CBus, uint8) (bool, error) // Read and Write data directly Read(I2CBus) ([]byte, error) Write(I2CBus, []byte) (int, error) // Read Byte (8-bits), Word (16-bits) & Block ([]byte) from registers ReadUint8(bus I2CBus, reg uint8) (uint8, error) ReadInt8(bus I2CBus, reg uint8) (int8, error) ReadUint16(bus I2CBus, reg uint8) (uint16, error) ReadInt16(bus I2CBus, reg uint8) (int16, error) ReadBlock(bus I2CBus, reg, length uint8) ([]byte, error) // Write Byte (8-bits) and Word (16-bits) WriteUint8(bus I2CBus, reg, value uint8) error WriteInt8(bus I2CBus, reg uint8, value int8) error WriteUint16(bus I2CBus, reg uint8, value uint16) error WriteInt16(bus I2CBus, reg uint8, value int16) error }
I2C implements the I2C interface for sensors, etc.
type InputDevice ¶ added in v3.0.3
type InputDevice interface { Name() string Type() InputDeviceType }
InputDevice provides information about an input device
type InputDeviceType ¶ added in v3.0.3
type InputDeviceType uint16
const ( INPUT_DEVICE_NONE InputDeviceType = 0x0000 INPUT_DEVICE_KEYBOARD InputDeviceType = 0x0001 INPUT_DEVICE_MOUSE InputDeviceType = 0x0002 INPUT_DEVICE_TOUCHSCREEN InputDeviceType = 0x0004 INPUT_DEVICE_JOYSTICK InputDeviceType = 0x0008 INPUT_DEVICE_REMOTE InputDeviceType = 0x0010 // IR Remote INPUT_DEVICE_SONY_12 InputDeviceType = 0x0020 // 12-bit Sony IR codes INPUT_DEVICE_SONY_15 InputDeviceType = 0x0040 // 15-bit Sony IR codes INPUT_DEVICE_SONY_20 InputDeviceType = 0x0080 // 20-bit Sony IR codes INPUT_DEVICE_RC5_14 InputDeviceType = 0x0100 // 14-bit RC5 IR codes INPUT_DEVICE_NEC_32 InputDeviceType = 0x0200 // 32-bit NEC IR codes INPUT_DEVICE_APPLETV_32 InputDeviceType = 0x0400 // 32-bit Apple TV IR codes INPUT_DEVICE_ANY InputDeviceType = 0xFFFF INPUT_DEVICE_MIN = INPUT_DEVICE_KEYBOARD INPUT_DEVICE_MAX = INPUT_DEVICE_APPLETV_32 )
func (InputDeviceType) FlagString ¶ added in v3.0.3
func (d InputDeviceType) FlagString() string
func (InputDeviceType) String ¶ added in v3.0.3
func (d InputDeviceType) String() string
type InputEvent ¶ added in v3.0.3
type InputEvent interface { Event Key() KeyCode // Translated keycode Type() InputType // Event type (key press, repeat, etc) Device() (InputDeviceType, uint32) // Device information }
InputEvent is a key press, mouse move, etc.
type InputManager ¶ added in v3.0.3
type InputManager interface { Devices() []InputDevice RegisterDevice(InputDevice) error }
InputManager provides information on registered devices
type InputService ¶ added in v3.0.3
type InputService interface { Service }
type InputStub ¶ added in v3.0.3
type InputStub interface { ServiceStub Stream(ctx context.Context, ch chan<- InputEvent) error }
type InputType ¶ added in v3.0.3
type InputType uint
const ( INPUT_EVENT_NONE InputType = 0x0000 // Mouse and/or keyboard key/button press events INPUT_EVENT_KEYPRESS InputType = 0x0001 INPUT_EVENT_KEYRELEASE InputType = 0x0002 INPUT_EVENT_KEYREPEAT InputType = 0x0003 // Mouse and/or touchscreen move events INPUT_EVENT_ABSPOSITION InputType = 0x0004 INPUT_EVENT_RELPOSITION InputType = 0x0005 // Multi-touch events INPUT_EVENT_TOUCHPRESS InputType = 0x0006 INPUT_EVENT_TOUCHRELEASE InputType = 0x0007 INPUT_EVENT_TOUCHPOSITION InputType = 0x0008 )
type KeyCode ¶ added in v3.0.3
type KeyCode uint16
const ( KEYCODE_NONE KeyCode = 0x0000 KEYCODE_ESC KeyCode = 0x0001 KEYCODE_1 KeyCode = 0x0002 KEYCODE_2 KeyCode = 0x0003 KEYCODE_3 KeyCode = 0x0004 KEYCODE_4 KeyCode = 0x0005 KEYCODE_5 KeyCode = 0x0006 KEYCODE_6 KeyCode = 0x0007 KEYCODE_7 KeyCode = 0x0008 KEYCODE_8 KeyCode = 0x0009 KEYCODE_9 KeyCode = 0x000A KEYCODE_0 KeyCode = 0x000B KEYCODE_MINUS KeyCode = 0x000C KEYCODE_EQUAL KeyCode = 0x000D KEYCODE_BACKSPACE KeyCode = 0x000E KEYCODE_TAB KeyCode = 0x000F KEYCODE_Q KeyCode = 0x0010 KEYCODE_W KeyCode = 0x0011 KEYCODE_E KeyCode = 0x0012 KEYCODE_R KeyCode = 0x0013 KEYCODE_T KeyCode = 0x0014 KEYCODE_Y KeyCode = 0x0015 KEYCODE_U KeyCode = 0x0016 KEYCODE_I KeyCode = 0x0017 KEYCODE_O KeyCode = 0x0018 KEYCODE_P KeyCode = 0x0019 KEYCODE_LEFTBRACE KeyCode = 0x001A KEYCODE_RIGHTBRACE KeyCode = 0x001B KEYCODE_ENTER KeyCode = 0x001C KEYCODE_LEFTCTRL KeyCode = 0x001D KEYCODE_A KeyCode = 0x001E KEYCODE_S KeyCode = 0x001F KEYCODE_D KeyCode = 0x0020 KEYCODE_F KeyCode = 0x0021 KEYCODE_G KeyCode = 0x0022 KEYCODE_H KeyCode = 0x0023 KEYCODE_J KeyCode = 0x0024 KEYCODE_K KeyCode = 0x0025 KEYCODE_L KeyCode = 0x0026 KEYCODE_SEMICOLON KeyCode = 0x0027 KEYCODE_APOSTROPHE KeyCode = 0x0028 KEYCODE_GRAVE KeyCode = 0x0029 KEYCODE_LEFTSHIFT KeyCode = 0x002A KEYCODE_BACKSLASH KeyCode = 0x002B KEYCODE_Z KeyCode = 0x002C KEYCODE_X KeyCode = 0x002D KEYCODE_C KeyCode = 0x002E KEYCODE_V KeyCode = 0x002F KEYCODE_B KeyCode = 0x0030 KEYCODE_N KeyCode = 0x0031 KEYCODE_M KeyCode = 0x0032 KEYCODE_COMMA KeyCode = 0x0033 KEYCODE_DOT KeyCode = 0x0034 KEYCODE_SLASH KeyCode = 0x0035 KEYCODE_RIGHTSHIFT KeyCode = 0x0036 KEYCODE_KPASTERISK KeyCode = 0x0037 KEYCODE_LEFTALT KeyCode = 0x0038 KEYCODE_SPACE KeyCode = 0x0039 KEYCODE_CAPSLOCK KeyCode = 0x003A KEYCODE_F1 KeyCode = 0x003B KEYCODE_F2 KeyCode = 0x003C KEYCODE_F3 KeyCode = 0x003D KEYCODE_F4 KeyCode = 0x003E KEYCODE_F5 KeyCode = 0x003F KEYCODE_F6 KeyCode = 0x0040 KEYCODE_F7 KeyCode = 0x0041 KEYCODE_F8 KeyCode = 0x0042 KEYCODE_F9 KeyCode = 0x0043 KEYCODE_F10 KeyCode = 0x0044 KEYCODE_NUMLOCK KeyCode = 0x0045 KEYCODE_SCROLLLOCK KeyCode = 0x0046 KEYCODE_KP7 KeyCode = 0x0047 KEYCODE_KP8 KeyCode = 0x0048 KEYCODE_KP9 KeyCode = 0x0049 KEYCODE_KPMINUS KeyCode = 0x004A KEYCODE_KP4 KeyCode = 0x004B KEYCODE_KP5 KeyCode = 0x004C KEYCODE_KP6 KeyCode = 0x004D KEYCODE_KPPLUS KeyCode = 0x004E KEYCODE_KP1 KeyCode = 0x004F KEYCODE_KP2 KeyCode = 0x0050 KEYCODE_KP3 KeyCode = 0x0051 KEYCODE_KP0 KeyCode = 0x0052 KEYCODE_KPDOT KeyCode = 0x0053 KEYCODE_F11 KeyCode = 0x0057 KEYCODE_F12 KeyCode = 0x0058 KEYCODE_KPENTER KeyCode = 0x0060 KEYCODE_RIGHTCTRL KeyCode = 0x0061 KEYCODE_KPSLASH KeyCode = 0x0062 KEYCODE_SYSRQ KeyCode = 0x0063 KEYCODE_RIGHTALT KeyCode = 0x0064 KEYCODE_LINEFEED KeyCode = 0x0065 KEYCODE_HOME KeyCode = 0x0066 KEYCODE_UP KeyCode = 0x0067 KEYCODE_PAGEUP KeyCode = 0x0068 KEYCODE_LEFT KeyCode = 0x0069 KEYCODE_RIGHT KeyCode = 0x006A KEYCODE_END KeyCode = 0x006B KEYCODE_DOWN KeyCode = 0x006C KEYCODE_PAGEDOWN KeyCode = 0x006D KEYCODE_INSERT KeyCode = 0x006E KEYCODE_DELETE KeyCode = 0x006F KEYCODE_MACRO KeyCode = 0x0070 KEYCODE_MUTE KeyCode = 0x0071 KEYCODE_VOLUMEDOWN KeyCode = 0x0072 KEYCODE_VOLUMEUP KeyCode = 0x0073 KEYCODE_POWER KeyCode = 0x0074 KEYCODE_KPEQUAL KeyCode = 0x0075 KEYCODE_KPPLUSMINUS KeyCode = 0x0076 KEYCODE_KPCOMMA KeyCode = 0x0079 KEYCODE_LEFTMETA KeyCode = 0x007D KEYCODE_RIGHTMETA KeyCode = 0x007E KEYCODE_SLEEP KeyCode = 0x008E KEYCODE_WAKEUP KeyCode = 0x008F KEYCODE_KPLEFTPAREN KeyCode = 0x00B3 KEYCODE_KPRIGHTPAREN KeyCode = 0x00B4 KEYCODE_F13 KeyCode = 0x00B7 KEYCODE_F14 KeyCode = 0x00B8 KEYCODE_F15 KeyCode = 0x00B9 KEYCODE_F16 KeyCode = 0x00BA KEYCODE_F17 KeyCode = 0x00BB KEYCODE_F18 KeyCode = 0x00BC KEYCODE_F19 KeyCode = 0x00BD KEYCODE_F20 KeyCode = 0x00BE KEYCODE_F21 KeyCode = 0x00BF KEYCODE_F22 KeyCode = 0x00C0 KEYCODE_F23 KeyCode = 0x00C1 KEYCODE_F24 KeyCode = 0x00C2 KEYCODE_CLOSE KeyCode = 0x00CE KEYCODE_PLAY KeyCode = 0x00CF KEYCODE_PRINT KeyCode = 0x00D2 KEYCODE_SEARCH KeyCode = 0x00D9 KEYCODE_CANCEL KeyCode = 0x00DF KEYCODE_BRIGHTNESS_DOWN KeyCode = 0x00E0 KEYCODE_BRIGHTNESS_UP KeyCode = 0x00E1 KEYCODE_BRIGHTNESS_CYCLE KeyCode = 0x00F3 KEYCODE_BRIGHTNESS_AUTO KeyCode = 0x00F4 KEYCODE_MAX KeyCode = 0x02FF )
const ( KEYCODE_BTN0 KeyCode = 0x0100 KEYCODE_BTN1 KeyCode = 0x0101 KEYCODE_BTN2 KeyCode = 0x0102 KEYCODE_BTN3 KeyCode = 0x0103 KEYCODE_BTN4 KeyCode = 0x0104 KEYCODE_BTN5 KeyCode = 0x0105 KEYCODE_BTN6 KeyCode = 0x0106 KEYCODE_BTN7 KeyCode = 0x0107 KEYCODE_BTN8 KeyCode = 0x0108 KEYCODE_BTN9 KeyCode = 0x0109 KEYCODE_BTNLEFT KeyCode = 0x0110 KEYCODE_BTNRIGHT KeyCode = 0x0111 KEYCODE_BTNMIDDLE KeyCode = 0x0112 KEYCODE_BTNSIDE KeyCode = 0x0113 KEYCODE_BTNEXTRA KeyCode = 0x0114 KEYCODE_BTNTOUCH KeyCode = 0x014A )
const ( KEYCODE_EJECT KeyCode = iota + 0x0200 KEYCODE_POWER_OFF KEYCODE_POWER_ON KEYCODE_INPUT_SELECT KEYCODE_INPUT_PC KEYCODE_INPUT_VIDEO1 KEYCODE_INPUT_VIDEO2 KEYCODE_INPUT_VIDEO3 KEYCODE_INPUT_VIDEO4 KEYCODE_INPUT_VIDEO5 KEYCODE_INPUT_HDMI1 KEYCODE_INPUT_HDMI2 KEYCODE_INPUT_HDMI3 KEYCODE_INPUT_HDMI4 KEYCODE_INPUT_HDMI5 KEYCODE_INPUT_AUX1 KEYCODE_INPUT_AUX2 KEYCODE_INPUT_AUX3 KEYCODE_INPUT_AUX4 KEYCODE_INPUT_AUX5 KEYCODE_INPUT_CD KEYCODE_INPUT_DVD KEYCODE_INPUT_PHONO KEYCODE_INPUT_TAPE1 KEYCODE_INPUT_TAPE2 KEYCODE_INPUT_TUNER KEYCODE_INPUT_ANALOG KEYCODE_INPUT_DIGITAL KEYCODE_INPUT_INTERNET KEYCODE_INPUT_TEXT KEYCODE_INPUT_NEXT KEYCODE_INPUT_PREV KEYCODE_VIDEO_ASPECT KEYCODE_VIDEO_PIP KEYCODE_AUDIO_MONITOR KEYCODE_CLEAR KEYCODE_TIMER KEYCODE_CHANNEL_PREV KEYCODE_CHANNEL_GUIDE KEYCODE_RECORD KEYCODE_RECORD_SPEED KEYCODE_PLAY_SPEED KEYCODE_PLAY_MODE KEYCODE_REPLAY KEYCODE_DISPLAY KEYCODE_MENU KEYCODE_INFO //KEYCODE_HOME KEYCODE_THUMBS_UP KEYCODE_THUMBS_DOWN KEYCODE_FAVOURITE KEYCODE_BUTTON_RED KEYCODE_BUTTON_GREEN KEYCODE_BUTTON_YELLOW KEYCODE_BUTTON_BLUE KEYCODE_SEARCH_LEFT KEYCODE_SEARCH_RIGHT KEYCODE_CHAPTER_NEXT KEYCODE_CHAPTER_PREV KEYCODE_NAV_SELECT KEYCODE_SUBTITLE_TOGGLE KEYCODE_SUBTITLE_ON KEYCODE_SUBTITLE_OFF KEYCODE_STOP KEYCODE_PAUSE //KEYCODE_SLEEP KEYCODE_BROWSE KEYCODE_SHUFFLE KEYCODE_REPEAT KEYCODE_KEYPAD_10PLUS )
type LIRC ¶
type LIRC interface { // Get receive and send modes RecvMode() LIRCMode SendMode() LIRCMode SetRecvMode(LIRCMode) error SetSendMode(LIRCMode) error // Receive parameters RecvDutyCycle() uint32 RecvResolutionMicros() uint32 // Receive parameters SetRecvTimeoutMs(uint32) error SetRecvTimeoutReports(bool) error SetRecvCarrierHz(uint32) error SetRecvCarrierRangeHz(min, max uint32) error // Send parameters SendDutyCycle() uint32 SetSendCarrierHz(uint32) error SetSendDutyCycle(uint32) error // Send Pulse Mode, values are in milliseconds PulseSend([]uint32) error }
LIRC implements the IR send & receive interface
type LIRCEvent ¶
type LIRCEvent interface { Event Type() LIRCType Mode() LIRCMode Value() interface{} // value is uint32 in ms when mode is LIRC_MODE_MODE2 }
LIRCEvent is a pulse, space or timeout from an IR sensor
type LIRCKeycodeManager ¶ added in v3.0.3
type LIRCKeycodeManager interface { // Keycode returns keycodes which match a search phrase Keycode(string) []KeyCode // Lookup returns Keycodes in priority order for scancode Lookup(InputDevice, uint32) []KeyCode // Set Keycode for scancode, InputDevice and device name Set(InputDevice, uint32, KeyCode, string) error }
LIRCKeycodeManager manages the database of keycodes and IR codes
type Logger ¶
type Logger interface { Print(args ...interface{}) // Output logging Debug(args ...interface{}) // Output debugging information Printf(fmt string, args ...interface{}) // Output logging with format Debugf(fmt string, args ...interface{}) // Output debugging with format IsDebug() bool // IsDebug returns true if debug flag is set T() *testing.T // When testing, provides testing context }
Logger outputs information and debug messages
type Measurement ¶
type Measurement interface { Event Time() time.Time // Time returns the timestamp for the data point or time.Time{} Tags() []Field // Return the dimensions/tags for the data point Metrics() []Field // Return the metrics for the data point Get(string) interface{} // Return a field value Set(string, interface{}) error // Set a field value }
Measurement is a single data point
type Media ¶
type Media interface { URL() *url.URL // Return URL for the media location Metadata() MediaMetadata // Return metadata Flags() MediaFlag // Return flags Streams() []MediaStream // Return streams }
Media is an input or output
type MediaCodec ¶
type MediaCodec interface { // Name returns the unique name for the codec Name() string // Description returns the long description for the codec Description() string // Flags for the codec (Audio, Video, Encoder, Decoder) Flags() MediaFlag }
MediaCodec is the codec and parameters
type MediaDecodeContext ¶
type MediaDecodeContext interface { Stream() MediaStream // Origin of the packet Frame() int // Frame counter }
MediaDecodeContext provides packet data and streams for decoding frames of data
type MediaFlag ¶
type MediaFlag uint64
const ( MEDIA_FLAG_ALBUM MediaFlag = (1 << iota) // Is part of an album MEDIA_FLAG_ALBUM_TRACK // Is an album track MEDIA_FLAG_ALBUM_COMPILATION // Album is a compliation MEDIA_FLAG_TVSHOW // Is part of a TV Show MEDIA_FLAG_TVSHOW_EPISODE // Is a TV Show episode MEDIA_FLAG_FILE // Is a file MEDIA_FLAG_VIDEO // Contains video MEDIA_FLAG_AUDIO // Contains audio MEDIA_FLAG_SUBTITLE // Contains subtitles MEDIA_FLAG_DATA // Contains data stream MEDIA_FLAG_ATTACHMENT // Contains attachment MEDIA_FLAG_ARTWORK // Contains artwork MEDIA_FLAG_CAPTIONS // Contains captions MEDIA_FLAG_ENCODER // Is an encoder MEDIA_FLAG_DECODER // Is an decoder MEDIA_FLAG_NONE MediaFlag = 0 MEDIA_FLAG_MIN = MEDIA_FLAG_ALBUM MEDIA_FLAG_MAX = MEDIA_FLAG_DECODER )
func (MediaFlag) FlagString ¶
type MediaFrame ¶
MediaFrame is a decoded audio or video frame
type MediaInput ¶ added in v3.0.3
type MediaInput interface { Media // StreamsForFlag returns array of stream indexes for // the best streams to use according to the flags StreamsForFlag(MediaFlag) []int // Read loops over selected streams from media object, and // packets are provided to a Decode function Read(context.Context, []int, DecodeIteratorFunc) error // DecodeFrameIterator loops over data packets from media stream DecodeFrameIterator(MediaDecodeContext, MediaPacket, DecodeFrameIteratorFunc) error }
type MediaKey ¶
type MediaKey string
const ( MEDIA_KEY_BRAND_MAJOR MediaKey = "major_brand" // string MEDIA_KEY_BRAND_COMPATIBLE MediaKey = "compatible_brands" // string MEDIA_KEY_CREATED MediaKey = "creation_time" // time.Time MEDIA_KEY_ENCODER MediaKey = "encoder" // string MEDIA_KEY_ALBUM MediaKey = "album" // string MEDIA_KEY_ALBUM_ARTIST MediaKey = "artist" // string MEDIA_KEY_COMMENT MediaKey = "comment" // string MEDIA_KEY_COMPOSER MediaKey = "composer" // string MEDIA_KEY_COPYRIGHT MediaKey = "copyright" // string MEDIA_KEY_YEAR MediaKey = "date" // uint MEDIA_KEY_DISC MediaKey = "disc" // uint MEDIA_KEY_ENCODED_BY MediaKey = "encoded_by" // string MEDIA_KEY_FILENAME MediaKey = "filename" // string MEDIA_KEY_GENRE MediaKey = "genre" // string MEDIA_KEY_LANGUAGE MediaKey = "language" // string MEDIA_KEY_PERFORMER MediaKey = "performer" // string MEDIA_KEY_PUBLISHER MediaKey = "publisher" // string MEDIA_KEY_SERVICE_NAME MediaKey = "service_name" // string MEDIA_KEY_SERVICE_PROVIDER MediaKey = "service_provider" // string MEDIA_KEY_TITLE MediaKey = "title" // string MEDIA_KEY_TRACK MediaKey = "track" // uint MEDIA_KEY_VERSION_MAJOR MediaKey = "major_version" // string MEDIA_KEY_VERSION_MINOR MediaKey = "minor_version" // string MEDIA_KEY_SHOW MediaKey = "show" // string MEDIA_KEY_SEASON MediaKey = "season_number" // uint MEDIA_KEY_EPISODE_SORT MediaKey = "episode_sort" // string MEDIA_KEY_EPISODE_ID MediaKey = "episode_id" // uint MEDIA_KEY_COMPILATION MediaKey = "compilation" // bool MEDIA_KEY_GAPLESS_PLAYBACK MediaKey = "gapless_playback" // bool MEDIA_KEY_ACCOUNT_ID MediaKey = "account_id" // string MEDIA_KEY_DESCRIPTION MediaKey = "description" // string MEDIA_KEY_MEDIA_TYPE MediaKey = "media_type" // string MEDIA_KEY_PURCHASED MediaKey = "purchase_date" // time.Time MEDIA_KEY_ALBUM_SORT MediaKey = "sort_album" // string MEDIA_KEY_ARTIST_SORT MediaKey = "sort_artist" // string MEDIA_KEY_TITLE_SORT MediaKey = "sort_name" // string MEDIA_KEY_SYNOPSIS MediaKey = "synopsis" // string MEDIA_KEY_GROUPING MediaKey = "grouping" // string )
type MediaManager ¶
type MediaManager interface { // OpenFile opens a local media file OpenFile(path string) (MediaInput, error) // OpenURL opens a network-based stream OpenURL(url *url.URL) (MediaInput, error) // CreateFile creates a local media file for output CreateFile(path string) (MediaOutput, error) // Close will release resources and close a media object Close(Media) error // ListCodecs enumerates codecs for a specific name and/or // audio, video, encode and decode. By default (empty name and // MediaFlag) lists all codecs ListCodecs(string, MediaFlag) []MediaCodec }
MediaManager for media file management
type MediaMetadata ¶
type MediaMetadata interface { Keys() []MediaKey // Return all existing keys Value(MediaKey) interface{} // Return value for key, or nil }
MediaMetadata are key value pairs for a media object
type MediaOutput ¶ added in v3.0.3
type MediaOutput interface { Media // Write packets to output Write(MediaDecodeContext, MediaPacket) error }
type MediaPacket ¶
MediaPacket is a packet of data from a stream
type MediaStream ¶
type MediaStream interface { Index() int // Stream index Flags() MediaFlag // Flags for the stream (Audio, Video, etc) Codec() MediaCodec // Return codec and parameters }
MediaStream is a stream of packets from a media object
type MetricWriter ¶ added in v3.0.3
type MetricWriter interface { Ping() (time.Duration, error) // Ping the database and return latency Write(...Measurement) error // Write one or more measurements to the database }
MetricWriter implements a database writing object
type Metrics ¶
type Metrics interface { // Define a measurement with metric definitions and optional tag fields NewMeasurement(string, string, ...Field) (Measurement, error) // Field creates a field or nil if invalid Field(string, ...interface{}) Field // Emit metrics for a named measurement, omitting timestamp Emit(string, ...interface{}) error // EmitTS emits metrics for a named measurement, with defined timestamp EmitTS(string, time.Time, ...interface{}) error // Measurements returns array of all defined measurements Measurements() []Measurement // Return some standard tags HostTag() Field UserTag() Field EnvTag(string) Field }
Metrics provides a mechanism for defining measurements and emitting data, which may be time-series based and include tags/dimensions (which are indexed) and metrics (which are not)
type PingService ¶
type PingService interface { Service }
type Platform ¶
type Platform interface { Product() string // Product returns product name Type() PlatformType // Type returns flags identifying platform type SerialNumber() string // SerialNumber returns unique serial number for host Uptime() time.Duration // Uptime returns uptime for host LoadAverages() (float64, float64, float64) // LoadAverages returns 1, 5 and 15 minute load averages TemperatureZones() map[string]float32 // Return celcius values for zones }
type PlatformType ¶
type PlatformType uint32
const ( PLATFORM_NONE PlatformType = 0 // OS PLATFORM_DARWIN PlatformType = (1 << iota) >> 1 PLATFORM_RPI PLATFORM_LINUX // CPU PLATFORM_X86_32 PLATFORM_X86_64 PLATFORM_BCM2835_ARM6 PLATFORM_BCM2836_ARM7 PLATFORM_BCM2837_ARM8 PLATFORM_BCM2838_ARM8 // MIN AND MAX PLATFORM_MIN = PLATFORM_DARWIN PLATFORM_MAX = PLATFORM_BCM2838_ARM8 )
func (PlatformType) FlagString ¶
func (p PlatformType) FlagString() string
func (PlatformType) String ¶
func (p PlatformType) String() string
type Publisher ¶
type Publisher interface { // Emit an event, which can block if second argument is true Emit(Event, bool) error // Subscribe to events Subscribe() <-chan Event // Unsubscribe from events Unsubscribe(<-chan Event) }
Publisher emits events and allows for subscribing to emitted events
type SPI ¶
type SPI interface { // Return all valid devices Devices() []SPIBus // Mode returns the current SPI mode Mode(SPIBus) SPIMode // SetMode sets the current SPI mode SetMode(SPIBus, SPIMode) error // MaxSpeedHz returns the current data transfer speed MaxSpeedHz(SPIBus) uint32 // SetMaxSpeedHz sets the current data transfer speed SetMaxSpeedHz(SPIBus, uint32) error // BitsPerWord returns current configuration BitsPerWord(SPIBus) uint8 // SetBitsPerWord updates the current configuration SetBitsPerWord(SPIBus, uint8) error // Transfer reads and writes on the SPI bus Transfer(SPIBus, []byte) ([]byte, error) // Read bytes into a buffer Read(SPIBus, []byte) error // Write bytes from the buffer Write(SPIBus, []byte) error }
SPI implements the SPI interface for sensors, etc.
type SPIMode ¶
type SPIMode uint32 // SPIMode is the SPI Mode
const ( SPI_MODE_CPHA SPIMode = 0x01 SPI_MODE_CPOL SPIMode = 0x02 SPI_MODE_0 SPIMode = 0x00 SPI_MODE_1 SPIMode = (0x00 | SPI_MODE_CPHA) SPI_MODE_2 SPIMode = (SPI_MODE_CPOL | 0x00) SPI_MODE_3 SPIMode = (SPI_MODE_CPOL | SPI_MODE_CPHA) SPI_MODE_NONE SPIMode = 0xFF SPI_MODE_MASK SPIMode = 0x03 )
type Server ¶
type Server interface { // Register an RPC or HTTP service with the server RegisterService(interface{}, Service) error // Start server in background and return StartInBackground(network, addr string) error // Stop server, when argument is true forcefully disconnects any clients Stop(bool) error // Addr returns the address of the server, or empty if not connected Addr() string // NewStreamContext returns a streaming context which should be used // to cancel streaming to clients when the server is shutdown NewStreamContext() context.Context }
Server is a generic RPC or HTTP server, which can serve responses for registered services to clients
type Service ¶
type Service interface{}
Service defines an RPC or HTTP service. At the moment HTTP services must adhere to the http.Handler interface.
type ServiceDiscovery ¶ added in v3.0.3
type ServiceDiscovery interface { // NewServiceRecord returns a record from service, name, port, txt and // flags for IP4, IP6 or both NewServiceRecord(string, string, uint16, []string, ServiceFlag) (ServiceRecord, error) // EnumerateServices queries for available service names EnumerateServices(context.Context) ([]string, error) // Lookup queries for records for a service name Lookup(context.Context, string) ([]ServiceRecord, error) // Serve will respond to service discovery queries and // de-register those services when ending Serve(context.Context, []ServiceRecord) error }
type ServiceFlag ¶ added in v3.0.3
type ServiceFlag uint
const ( SERVICE_FLAG_NONE ServiceFlag = 0 SERVICE_FLAG_IP4 ServiceFlag = (1 << iota) SERVICE_FLAG_IP6 SERVICE_FLAG_MAX = SERVICE_FLAG_IP6 )
type ServiceRecord ¶ added in v3.0.3
type ServiceStub ¶
type ServiceStub interface {
New(Conn)
}
ServiceStub is a client-side stub used to invoke remote service methods
type SurfaceFlags ¶ added in v3.0.4
type SurfaceFlags uint16
SurfaceFlags are flags associated with renderable surface
const ( SURFACE_FLAG_BITMAP SurfaceFlags = (1 << iota) SURFACE_FLAG_OPENGL SURFACE_FLAG_OPENGL_ES SURFACE_FLAG_OPENGL_ES2 SURFACE_FLAG_OPENGL_ES3 SURFACE_FLAG_OPENVG SURFACE_FLAG_NONE SurfaceFlags = 0 SURFACE_FLAG_MIN = SURFACE_FLAG_BITMAP SURFACE_FLAG_MAX = SURFACE_FLAG_OPENVG )
func (SurfaceFlags) String ¶ added in v3.0.4
func (f SurfaceFlags) String() string
func (SurfaceFlags) StringFlag ¶ added in v3.0.4
func (f SurfaceFlags) StringFlag() string
type SurfaceFormat ¶ added in v3.0.4
type SurfaceFormat uint
SurfaceFormat defines the pixel format for a surface
const ( SURFACE_FMT_NONE SurfaceFormat = iota SURFACE_FMT_RGBA32 // 4 bytes per pixel with transparency SURFACE_FMT_XRGB32 // 4 bytes per pixel without transparency SURFACE_FMT_RGB888 // 3 bytes per pixel SURFACE_FMT_RGB565 // 2 bytes per pixel SURFACE_FMT_1BPP // 1 bit per pixel (Mono) SURFACE_FMT_MAX = SURFACE_FMT_1BPP )
func (SurfaceFormat) String ¶ added in v3.0.4
func (f SurfaceFormat) String() string
type SurfaceManager ¶ added in v3.0.4
type SurfaceManager interface { CreateBackground(SurfaceFlags) (Surface, error) DisposeSurface(Surface) error }
SurfaceManager to manage graphics surfaces
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pkg
|
|
graphics/surface/eglgbm
Graphics Surface Management with EGL, DRM and GBM
|
Graphics Surface Management with EGL, DRM and GBM |
hw/display
Display package enumerates displays and emits events when displays are added and removed
|
Display package enumerates displays and emits events when displays are added and removed |
hw/platform
Platform provides information about the hardware (Product, Serial Number, etc)
|
Platform provides information about the hardware (Product, Serial Number, etc) |
sys/drm
DRM (Direct Rendering Manager) bindings for Go On Debian, use: bash# apt install libdrm-dev Then when you depend on this code, use -tags drm when running go build test and install
|
DRM (Direct Rendering Manager) bindings for Go On Debian, use: bash# apt install libdrm-dev Then when you depend on this code, use -tags drm when running go build test and install |
sys/egl
Khronos EGL bindings For debian, you need to install the headers and libraries first: sudo apt install libegl1-mesa-dev
|
Khronos EGL bindings For debian, you need to install the headers and libraries first: sudo apt install libegl1-mesa-dev |
sys/ffmpeg
This package provides ffmpeg bindings, targetting new versions of the ffmpeg API.
|
This package provides ffmpeg bindings, targetting new versions of the ffmpeg API. |
sys/gbm
GBM (Generic Buffer Manager) bindings for Go On Debian, use: bash# apt install libgbm-dev Then when you depend on this code, use -tags grm when running go build test and install
|
GBM (Generic Buffer Manager) bindings for Go On Debian, use: bash# apt install libgbm-dev Then when you depend on this code, use -tags grm when running go build test and install |