Documentation
¶
Index ¶
- Variables
- func Loop(c *Client, delay time.Duration, loop func(Controllers) error) error
- type Client
- func (c *Client) AssertServerVersion(v Version) error
- func (c *Client) Close() error
- func (c *Client) CommonVersion() Version
- func (c *Client) DeviceListUpdatedHandler(h DeviceListUpdatedHandler)
- func (c *Client) Initialize(name string) error
- func (c *Client) RGBControllerResizeZone(deviceId uint32, req *RGBControllerResizeZoneRequest) error
- func (c *Client) RGBControllerSaveMode(deviceId uint32, req *RGBControllerSaveModeRequest) error
- func (c *Client) RGBControllerSetCustomMode(deviceId uint32) error
- func (c *Client) RGBControllerUpdateLeds(deviceId uint32, req *RGBControllerUpdateLedsRequest) error
- func (c *Client) RGBControllerUpdateMode(deviceId uint32, req *RGBControllerUpdateModeRequest) error
- func (c *Client) RGBControllerUpdateSingleLed(deviceId uint32, req *RGBControllerUpdateSingleLedRequest) error
- func (c *Client) RGBControllerUpdateZoneLeds(deviceId uint32, req *RGBControllerUpdateZoneLedsRequest) error
- func (c *Client) RequestControllerCount() (*RequestControllerCountResponse, error)
- func (c *Client) RequestControllerCountCtx(ctx context.Context) (*RequestControllerCountResponse, error)
- func (c *Client) RequestControllerData(deviceId uint32) (*RequestControllerDataResponse, error)
- func (c *Client) RequestControllerDataCtx(ctx context.Context, deviceId uint32) (*RequestControllerDataResponse, error)
- func (c *Client) RequestDeleteProfile(req *RequestDeleteProfileRequest) error
- func (c *Client) RequestLoadProfile(req *RequestLoadProfileRequest) error
- func (c *Client) RequestProfileList() (*RequestProfileListResponse, error)
- func (c *Client) RequestProfileListCtx(ctx context.Context) (*RequestProfileListResponse, error)
- func (c *Client) RequestProtocolVersion() error
- func (c *Client) RequestProtocolVersionCtx(ctx context.Context) error
- func (c *Client) RequestSaveProfile(req *RequestSaveProfileRequest) error
- func (c *Client) SendPacket(req *NetPacket) error
- func (c *Client) SendPacketAndExpectPacket(req *NetPacket) (*NetPacket, error)
- func (c *Client) SendPacketAndExpectPacketCtx(ctx context.Context, req *NetPacket) (*NetPacket, error)
- func (c *Client) SendRequest(req NetPacketRequest) error
- func (c *Client) SendRequestAndExpectResponse(req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
- func (c *Client) SendRequestAndExpectResponseCtx(ctx context.Context, req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
- func (c *Client) SendRequestForDevice(deviceId uint32, req NetPacketRequest) error
- func (c *Client) SendRequestForDeviceAndExpectResponse(deviceId uint32, req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
- func (c *Client) SendRequestForDeviceAndExpectResponseCtx(ctx context.Context, deviceId uint32, req NetPacketRequest, ...) (*NetPacket, error)
- func (c *Client) SetClientName(req *SetClientNameRequest) error
- type Color
- type Colors
- type ControllerCache
- type ControllerData
- type Controllers
- type DataDecoder
- type DataEncoder
- type DeviceListUpdatedHandler
- type DeviceListUpdatedResponse
- type ExchangeHandler
- type InvalidPacketHeaderMagicValueError
- type InvalidResponseNetPacketIdError
- type InvalidServerVersionError
- type Led
- type Mode
- type Modes
- type NetPacket
- type NetPacketCommand
- type NetPacketData
- type NetPacketDataBuilder
- func (r *NetPacketDataBuilder) Bytes() []byte
- func (r *NetPacketDataBuilder) EnsureSize(size int)
- func (r *NetPacketDataBuilder) WriteBytes(b []byte)
- func (r *NetPacketDataBuilder) WriteInt32(i int32)
- func (r *NetPacketDataBuilder) WriteLen(v any)
- func (r *NetPacketDataBuilder) WriteUint16(i uint16)
- func (r *NetPacketDataBuilder) WriteUint32(i uint32)
- func (r *NetPacketDataBuilder) WrtieString(b string)
- type NetPacketDataParser
- func (p *NetPacketDataParser) AssertAllRead() error
- func (p *NetPacketDataParser) ReadBytes(l int) ([]byte, error)
- func (p *NetPacketDataParser) ReadInt32() (int32, error)
- func (p *NetPacketDataParser) ReadString() (string, error)
- func (p *NetPacketDataParser) ReadUint16() (uint16, error)
- func (p *NetPacketDataParser) ReadUint32() (uint32, error)
- type NetPacketDecoder
- type NetPacketEncoder
- type NetPacketHeader
- type NetPacketId
- type NetPacketRequest
- type NetPacketResponse
- type RGBControllerResizeZoneRequest
- type RGBControllerSaveModeRequest
- type RGBControllerSetCustomModeRequest
- type RGBControllerUpdateLedsRequest
- type RGBControllerUpdateModeRequest
- type RGBControllerUpdateSingleLedRequest
- type RGBControllerUpdateZoneLedsRequest
- type RequestControllerCountRequest
- type RequestControllerCountResponse
- type RequestControllerDataRequest
- type RequestControllerDataResponse
- type RequestDeleteProfileRequest
- type RequestLoadProfileRequest
- type RequestProfileListRequest
- type RequestProfileListResponse
- type RequestProtocolVersionRequest
- type RequestProtocolVersionResponse
- type RequestSaveProfileRequest
- type ResponseTimeoutError
- type SetClientNameRequest
- type UnprocessedResponseError
- type Version
- type Zone
- type Zones
Constants ¶
This section is empty.
Variables ¶
var ColorBlack = Color{R: 0, G: 0, B: 0}
var ColorBlue = Color{R: 0, G: 0, B: 255}
var ColorCyan = Color{R: 0, G: 255, B: 255}
var ColorGreen = Color{R: 0, G: 255, B: 0}
var ColorMagenta = Color{R: 255, G: 0, B: 255}
var ColorRed = Color{R: 255, G: 0, B: 0}
var ColorWhite = Color{R: 255, G: 255, B: 255}
var ColorYellow = Color{R: 255, G: 255, B: 0}
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for communicating with an OpenRGB server. Create a new client with NewClient(). Calling RequestProtocolVersion() is recommended to sync versions of server and client.
func NewClientHostPort ¶
Creates a new client from a hostname and a port number.
func NewLocalClient ¶
Creates a new client to locahost from a port number.
func (*Client) AssertServerVersion ¶
Returns an error if server version is lower that the given version. RequestProtocolVersion() needs to be called before this function.
func (*Client) CommonVersion ¶
Finds the lowest common version between the client and the server. RequestProtocolVersion() needs to be called before this function.
func (*Client) DeviceListUpdatedHandler ¶
func (c *Client) DeviceListUpdatedHandler(h DeviceListUpdatedHandler)
Registers or overrides a handler to handle requests from the server.
func (*Client) RGBControllerResizeZone ¶
func (c *Client) RGBControllerResizeZone(deviceId uint32, req *RGBControllerResizeZoneRequest) error
Resizes a zone.
func (*Client) RGBControllerSaveMode ¶
func (c *Client) RGBControllerSaveMode(deviceId uint32, req *RGBControllerSaveModeRequest) error
Saves the mode.
func (*Client) RGBControllerSetCustomMode ¶
Set custom mode.
func (*Client) RGBControllerUpdateLeds ¶
func (c *Client) RGBControllerUpdateLeds(deviceId uint32, req *RGBControllerUpdateLedsRequest) error
Updates LEDs.
func (*Client) RGBControllerUpdateMode ¶
func (c *Client) RGBControllerUpdateMode(deviceId uint32, req *RGBControllerUpdateModeRequest) error
Updates the mode.
func (*Client) RGBControllerUpdateSingleLed ¶
func (c *Client) RGBControllerUpdateSingleLed(deviceId uint32, req *RGBControllerUpdateSingleLedRequest) error
Updates a single LED.
func (*Client) RGBControllerUpdateZoneLeds ¶
func (c *Client) RGBControllerUpdateZoneLeds(deviceId uint32, req *RGBControllerUpdateZoneLedsRequest) error
Updates zone LEDs.
func (*Client) RequestControllerCount ¶
func (c *Client) RequestControllerCount() (*RequestControllerCountResponse, error)
Gets the number of available devices.
func (*Client) RequestControllerCountCtx ¶
func (c *Client) RequestControllerCountCtx(ctx context.Context) (*RequestControllerCountResponse, error)
Gets the number of available devices.
func (*Client) RequestControllerData ¶
func (c *Client) RequestControllerData(deviceId uint32) (*RequestControllerDataResponse, error)
Gets the details of a device.
func (*Client) RequestControllerDataCtx ¶
func (c *Client) RequestControllerDataCtx(ctx context.Context, deviceId uint32) (*RequestControllerDataResponse, error)
Gets the details of a device.
func (*Client) RequestDeleteProfile ¶
func (c *Client) RequestDeleteProfile(req *RequestDeleteProfileRequest) error
Deletes the profile.
func (*Client) RequestLoadProfile ¶
func (c *Client) RequestLoadProfile(req *RequestLoadProfileRequest) error
Loads the profile.
func (*Client) RequestProfileList ¶
func (c *Client) RequestProfileList() (*RequestProfileListResponse, error)
Gets the available profiles.
func (*Client) RequestProfileListCtx ¶
func (c *Client) RequestProfileListCtx(ctx context.Context) (*RequestProfileListResponse, error)
Gets the available profiles.
func (*Client) RequestProtocolVersion ¶
Gets the server protocol version.
func (*Client) RequestProtocolVersionCtx ¶
Gets the server protocol version.
func (*Client) RequestSaveProfile ¶
func (c *Client) RequestSaveProfile(req *RequestSaveProfileRequest) error
Saves the profile.
func (*Client) SendPacket ¶
Sends a net packet to the server and expects no answer.
func (*Client) SendPacketAndExpectPacket ¶
Sends a packet to the server and expects an answer packet.
func (*Client) SendPacketAndExpectPacketCtx ¶
func (c *Client) SendPacketAndExpectPacketCtx(ctx context.Context, req *NetPacket) (*NetPacket, error)
Sends a packet to the server and expects an answer packet.
func (*Client) SendRequest ¶
func (c *Client) SendRequest(req NetPacketRequest) error
Sends a request to the server and expects no answer.
func (*Client) SendRequestAndExpectResponse ¶
func (c *Client) SendRequestAndExpectResponse(req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
Sends a request to the server and expects an answer response.
func (*Client) SendRequestAndExpectResponseCtx ¶
func (c *Client) SendRequestAndExpectResponseCtx(ctx context.Context, req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
Sends a request to the server and expects an answer response.
func (*Client) SendRequestForDevice ¶
func (c *Client) SendRequestForDevice(deviceId uint32, req NetPacketRequest) error
Sends a request to the server and expects no answer.
func (*Client) SendRequestForDeviceAndExpectResponse ¶
func (c *Client) SendRequestForDeviceAndExpectResponse(deviceId uint32, req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
Sends a request for a device to the server and expects an answer response.
func (*Client) SendRequestForDeviceAndExpectResponseCtx ¶
func (c *Client) SendRequestForDeviceAndExpectResponseCtx(ctx context.Context, deviceId uint32, req NetPacketRequest, res NetPacketResponse) (*NetPacket, error)
Sends a request for a device to the server and expects an answer response.
func (*Client) SetClientName ¶
func (c *Client) SetClientName(req *SetClientNameRequest) error
Sets the client name.
type Color ¶
func NewRGBColor ¶
type Colors ¶
type Colors []Color
Helper for multiple led states.
type ControllerCache ¶
type ControllerCache struct {
// contains filtered or unexported fields
}
Cache to use for controller data. Create a new cache with NewControllerCache().
func NewControllerCache ¶
func NewControllerCache(c *Client) *ControllerCache
Creates a new ControllerCache.
func (*ControllerCache) Controllers ¶
func (c *ControllerCache) Controllers() (Controllers, error)
Gets the controllers.
func (*ControllerCache) Invalidate ¶
func (c *ControllerCache) Invalidate()
Invalidates the current state. This should be called when a DeviceListUpdated packet is received.
type ControllerData ¶
type ControllerData struct { // RGBController type field value Type int32 // RGBController name field string value Name string // RGBController vendor field string value Vendor string // RGBController description field string value Description string // RGBController version field string value Version string // RGBController serial field string value Serial string // RGBController location field string value Location string // RGBController active_mode field value ActiveMode int32 Modes Modes Zones Zones Leds []*Led Colors []Color }
func (*ControllerData) Decode ¶
func (c *ControllerData) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
type Controllers ¶
type Controllers []*ControllerData
func (Controllers) Find ¶
func (c Controllers) Find(f func(*ControllerData) bool) (uint32, *ControllerData)
Finds a controller by a condition.
func (Controllers) FindByName ¶
func (c Controllers) FindByName(n string) (uint32, *ControllerData)
Finds a controller by name.
type DataDecoder ¶
type DataDecoder interface { // Reads the data from the NetPacketDataParser and fills the fields of this object. // Field values are changed only when the all reads were successful. // Errors can still happen after a successful decode. Decode(v Version, p *NetPacketDataParser) error }
Decodable net packet data.
type DataEncoder ¶
type DataEncoder interface { // Gets the body for the request with the given version. Encode(v Version, b *NetPacketDataBuilder) }
Encodable net packet data.
type DeviceListUpdatedHandler ¶
type DeviceListUpdatedHandler func(*DeviceListUpdatedResponse)
Type for handling requests coming from the server.
type DeviceListUpdatedResponse ¶
type DeviceListUpdatedResponse struct { }
func (*DeviceListUpdatedResponse) Decode ¶
func (res *DeviceListUpdatedResponse) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
func (*DeviceListUpdatedResponse) NetPacketId ¶
func (req *DeviceListUpdatedResponse) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type ExchangeHandler ¶
type ExchangeHandler struct {
// contains filtered or unexported fields
}
Manages the request-responses for a connection. Create a new handler with NewExchangeHandler().
func (*ExchangeHandler) Close ¶
func (eh *ExchangeHandler) Close() error
Sends a nil to all active handles.
func (*ExchangeHandler) Create ¶
func (eh *ExchangeHandler) Create(commandId NetPacketId) chan *NetPacket
Adds a new handle for the command.
func (*ExchangeHandler) Delete ¶
func (eh *ExchangeHandler) Delete(commandId NetPacketId, responseCh chan *NetPacket)
Deletes a handler.
func (*ExchangeHandler) Pop ¶
func (eh *ExchangeHandler) Pop(commandId NetPacketId) chan<- *NetPacket
Gets a handle for the command. Returns nil if no handler was found.
type InvalidPacketHeaderMagicValueError ¶
type InvalidPacketHeaderMagicValueError struct {
// contains filtered or unexported fields
}
Occurs, when an invalid magic header was found.
func (*InvalidPacketHeaderMagicValueError) Error ¶
func (e *InvalidPacketHeaderMagicValueError) Error() string
Error implements error
type InvalidResponseNetPacketIdError ¶
type InvalidResponseNetPacketIdError struct {
// contains filtered or unexported fields
}
Occurs, when an invalid net packet ID is returned.
func (*InvalidResponseNetPacketIdError) Error ¶
func (e *InvalidResponseNetPacketIdError) Error() string
Error implements error
type InvalidServerVersionError ¶
type InvalidServerVersionError struct {
// contains filtered or unexported fields
}
Occurs, when the server version is lower than expected.
func (*InvalidServerVersionError) Error ¶
func (e *InvalidServerVersionError) Error() string
Error implements error
type Led ¶
type Mode ¶
type Mode struct { // Mode name string value ModeName string // Mode value field value ModeValue int32 // Mode flags field value ModeFlags uint32 // Mode speed_min field value ModeSpeedMin uint32 // Mode speed_max field value ModeSpeedMax uint32 // Mode brightness_min field value ModeBrightnessMin uint32 //Mode brightness_max field value ModeBrightnessMax uint32 // Mode colors_min field value ModeColorsMin uint32 // Mode colors_max field value ModeColorsMax uint32 // Mode speed value ModeSpeed uint32 // Mode brightness value ModeBrightness uint32 // Mode direction value ModeDirection uint32 // Mode color_mode value ModeColorMode uint32 // Mode color values ModeColors []Color }
func (*Mode) Decode ¶
func (m *Mode) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
func (*Mode) Encode ¶
func (m *Mode) Encode(v Version, b *NetPacketDataBuilder)
Encode implements DataEncoder.
type NetPacket ¶
type NetPacket struct { Header *NetPacketHeader Data NetPacketData }
Packet for requests and responses.
func NewNetPacket ¶
func NewNetPacket(commandId NetPacketId, deviceId uint32, data []byte) *NetPacket
func (*NetPacket) DataParser ¶
func (p *NetPacket) DataParser() *NetPacketDataParser
Creates a parser for the data.
type NetPacketCommand ¶
type NetPacketCommand interface { // Gets the packet ID for the command. NetPacketId() NetPacketId }
Net packet command.
type NetPacketData ¶
type NetPacketData []byte
type NetPacketDataBuilder ¶
type NetPacketDataBuilder struct {
// contains filtered or unexported fields
}
Net packet data builder. The zero value for the builder is an empty data ready to use. All methods increase the size, if needed.
func (*NetPacketDataBuilder) Bytes ¶
func (r *NetPacketDataBuilder) Bytes() []byte
Gets the data of the request.
func (*NetPacketDataBuilder) EnsureSize ¶
func (r *NetPacketDataBuilder) EnsureSize(size int)
Makes sure that there are at least size bytes available.
func (*NetPacketDataBuilder) WriteBytes ¶
func (r *NetPacketDataBuilder) WriteBytes(b []byte)
Writes the data with a slice of bytes.
func (*NetPacketDataBuilder) WriteInt32 ¶
func (r *NetPacketDataBuilder) WriteInt32(i int32)
Writes the data with a int32.
func (*NetPacketDataBuilder) WriteLen ¶
func (r *NetPacketDataBuilder) WriteLen(v any)
Writes the data with a uint16 length. It panics if v's Kind is not [Array], [Chan], [Map], [Slice], [String], or pointer to [Array].
func (*NetPacketDataBuilder) WriteUint16 ¶
func (r *NetPacketDataBuilder) WriteUint16(i uint16)
Writes the data with a uint16.
func (*NetPacketDataBuilder) WriteUint32 ¶
func (r *NetPacketDataBuilder) WriteUint32(i uint32)
Writes the data with a uint32.
func (*NetPacketDataBuilder) WrtieString ¶
func (r *NetPacketDataBuilder) WrtieString(b string)
Writes the data with the length of a string followed by the string data.
type NetPacketDataParser ¶
type NetPacketDataParser struct {
// contains filtered or unexported fields
}
Net packet data parser. Create a new response with NetPacket.DataParser()
func (*NetPacketDataParser) AssertAllRead ¶
func (p *NetPacketDataParser) AssertAllRead() error
Returns an error if there is unread data.
func (*NetPacketDataParser) ReadBytes ¶
func (p *NetPacketDataParser) ReadBytes(l int) ([]byte, error)
Reads the given number of bytes from the content. Returns io.EOF error if the content runs out of data.
func (*NetPacketDataParser) ReadInt32 ¶
func (p *NetPacketDataParser) ReadInt32() (int32, error)
Reads an int32 from the content. Returns io.EOF error if the content runs out of data.
func (*NetPacketDataParser) ReadString ¶
func (p *NetPacketDataParser) ReadString() (string, error)
Reads the length of the string, then reads the string itself from the content. Returns io.EOF error if the content runs out of data.
func (*NetPacketDataParser) ReadUint16 ¶
func (p *NetPacketDataParser) ReadUint16() (uint16, error)
Reads a uint16 from the content. Returns io.EOF error if the content runs out of data.
func (*NetPacketDataParser) ReadUint32 ¶
func (p *NetPacketDataParser) ReadUint32() (uint32, error)
Reads a uint32 from the content. Returns io.EOF error if the content runs out of data.
type NetPacketDecoder ¶
type NetPacketDecoder struct {
// contains filtered or unexported fields
}
Decoder for OpenTGB net packets. Create a new decoder with NewNetPacketDecoder().
func NewNetPacketDecoder ¶
func NewNetPacketDecoder(r io.Reader) *NetPacketDecoder
Creates a new NetPacketDecoder.
func (*NetPacketDecoder) Decode ¶
func (d *NetPacketDecoder) Decode() (*NetPacket, error)
Reads the header and the data from the reader.
type NetPacketEncoder ¶
type NetPacketEncoder struct {
// contains filtered or unexported fields
}
Encoder for OpenRGB net packets. Create a new encoder with NewNetPacketEncoder().
func NewNetPacketEncoder ¶
func NewNetPacketEncoder(w io.Writer) *NetPacketEncoder
Creates a new NetPacketEncoder.
func (*NetPacketEncoder) Encode ¶
func (e *NetPacketEncoder) Encode(p *NetPacket) error
Writes the header and the data to the writer.
type NetPacketHeader ¶
type NetPacketHeader struct { // Magic value, "ORGB" PktMagic string // Device Index PktDevIdx uint32 // Packet ID PktId NetPacketId // Packet Size PktSize uint32 }
Packet header for requests and responses.
type NetPacketId ¶
type NetPacketId uint32
Packet command ID
const ( // Request RGBController device count from server NetPacketIdRequestControllerCount NetPacketId = 0 // Request RGBController data block NetPacketIdRequestControllerData NetPacketId = 1 // Request OpenRGB SDK protocol version from server NetPacketIdRequestProtocolVersion NetPacketId = 40 // Send client name string to server NetPacketIdSetClientName NetPacketId = 50 // Indicate to clients that device list has updated NetPacketIdDeviceListUpdated NetPacketId = 100 // Request profile list NetPacketIdRequestProfileList NetPacketId = 150 // Save current configuration in a new profile NetPacketIdRequestSaveProfile NetPacketId = 151 // Load a given profile NetPacketIdRequestLoadProfile NetPacketId = 152 // Delete a given profile NetPacketIdRequestDeleteProfile NetPacketId = 153 //RGBController::ResizeZone() NetPacketIdRgbcontrollerResizezone NetPacketId = 1000 // RGBController::UpdateLEDs() NetPacketIdRgbcontrollerUpdateleds NetPacketId = 1050 // RGBController::UpdateZoneLEDs() NetPacketIdRgbcontrollerUpdatezoneleds NetPacketId = 1051 // RGBController::UpdateSingleLED() NetPacketIdRgbcontrollerUpdatesingleled NetPacketId = 1052 // RGBController::SetCustomMode() NetPacketIdRgbcontrollerSetcustommode NetPacketId = 1100 // RGBController::UpdateMode() NetPacketIdRgbcontrollerUpdatemode NetPacketId = 1101 // RGBController::SaveMode() NetPacketIdRgbcontrollerSavemode NetPacketId = 1102 )
type NetPacketRequest ¶
type NetPacketRequest interface { NetPacketCommand DataEncoder }
Net packet request.
type NetPacketResponse ¶
type NetPacketResponse interface { NetPacketCommand DataDecoder }
Net packet response.
type RGBControllerResizeZoneRequest ¶
func (*RGBControllerResizeZoneRequest) Encode ¶
func (req *RGBControllerResizeZoneRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerResizeZoneRequest) NetPacketId ¶
func (req *RGBControllerResizeZoneRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RGBControllerSaveModeRequest ¶
func (*RGBControllerSaveModeRequest) Encode ¶
func (req *RGBControllerSaveModeRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerSaveModeRequest) NetPacketId ¶
func (req *RGBControllerSaveModeRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
func (*RGBControllerSaveModeRequest) Size ¶
func (req *RGBControllerSaveModeRequest) Size(v Version) int
type RGBControllerSetCustomModeRequest ¶
type RGBControllerSetCustomModeRequest struct { }
func (*RGBControllerSetCustomModeRequest) Encode ¶
func (req *RGBControllerSetCustomModeRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerSetCustomModeRequest) NetPacketId ¶
func (req *RGBControllerSetCustomModeRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RGBControllerUpdateLedsRequest ¶
type RGBControllerUpdateLedsRequest struct {
LedColor []Color
}
func (*RGBControllerUpdateLedsRequest) Encode ¶
func (req *RGBControllerUpdateLedsRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerUpdateLedsRequest) NetPacketId ¶
func (req *RGBControllerUpdateLedsRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
func (*RGBControllerUpdateLedsRequest) Size ¶
func (req *RGBControllerUpdateLedsRequest) Size(v Version) int
type RGBControllerUpdateModeRequest ¶
func (*RGBControllerUpdateModeRequest) Encode ¶
func (req *RGBControllerUpdateModeRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerUpdateModeRequest) NetPacketId ¶
func (req *RGBControllerUpdateModeRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
func (*RGBControllerUpdateModeRequest) Size ¶
func (req *RGBControllerUpdateModeRequest) Size(v Version) int
type RGBControllerUpdateSingleLedRequest ¶
func (*RGBControllerUpdateSingleLedRequest) Encode ¶
func (req *RGBControllerUpdateSingleLedRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerUpdateSingleLedRequest) NetPacketId ¶
func (req *RGBControllerUpdateSingleLedRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RGBControllerUpdateZoneLedsRequest ¶
func (*RGBControllerUpdateZoneLedsRequest) Encode ¶
func (req *RGBControllerUpdateZoneLedsRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RGBControllerUpdateZoneLedsRequest) NetPacketId ¶
func (req *RGBControllerUpdateZoneLedsRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
func (*RGBControllerUpdateZoneLedsRequest) Size ¶
func (req *RGBControllerUpdateZoneLedsRequest) Size(v Version) int
type RequestControllerCountRequest ¶
type RequestControllerCountRequest struct { }
func (*RequestControllerCountRequest) Encode ¶
func (req *RequestControllerCountRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestControllerCountRequest) NetPacketId ¶
func (req *RequestControllerCountRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestControllerCountResponse ¶
type RequestControllerCountResponse struct {
Count uint32
}
func (*RequestControllerCountResponse) Decode ¶
func (res *RequestControllerCountResponse) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
func (*RequestControllerCountResponse) NetPacketId ¶
func (req *RequestControllerCountResponse) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestControllerDataRequest ¶
type RequestControllerDataRequest struct { }
func (*RequestControllerDataRequest) Encode ¶
func (req *RequestControllerDataRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestControllerDataRequest) NetPacketId ¶
func (req *RequestControllerDataRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestControllerDataResponse ¶
type RequestControllerDataResponse struct {
Controller *ControllerData
}
func (*RequestControllerDataResponse) Decode ¶
func (res *RequestControllerDataResponse) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
func (*RequestControllerDataResponse) NetPacketId ¶
func (req *RequestControllerDataResponse) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestDeleteProfileRequest ¶
type RequestDeleteProfileRequest struct { // Profile name ProfileName string }
func (*RequestDeleteProfileRequest) Encode ¶
func (req *RequestDeleteProfileRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestDeleteProfileRequest) NetPacketId ¶
func (req *RequestDeleteProfileRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestLoadProfileRequest ¶
type RequestLoadProfileRequest struct { // Profile name ProfileName string }
func (*RequestLoadProfileRequest) Encode ¶
func (req *RequestLoadProfileRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestLoadProfileRequest) NetPacketId ¶
func (req *RequestLoadProfileRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestProfileListRequest ¶
type RequestProfileListRequest struct { }
func (*RequestProfileListRequest) Encode ¶
func (req *RequestProfileListRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestProfileListRequest) NetPacketId ¶
func (req *RequestProfileListRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestProfileListResponse ¶
type RequestProfileListResponse struct { // Profile name strings Names []string }
func (*RequestProfileListResponse) Decode ¶
func (res *RequestProfileListResponse) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
func (*RequestProfileListResponse) NetPacketId ¶
func (req *RequestProfileListResponse) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestProtocolVersionRequest ¶
type RequestProtocolVersionRequest struct {
ClientVersion Version
}
func (*RequestProtocolVersionRequest) Encode ¶
func (req *RequestProtocolVersionRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestProtocolVersionRequest) NetPacketId ¶
func (req *RequestProtocolVersionRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestProtocolVersionResponse ¶
type RequestProtocolVersionResponse struct {
ServerVersion Version
}
func (*RequestProtocolVersionResponse) Decode ¶
func (res *RequestProtocolVersionResponse) Decode(v Version, p *NetPacketDataParser) error
Decode implements DataDecoder.
func (*RequestProtocolVersionResponse) NetPacketId ¶
func (req *RequestProtocolVersionResponse) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type RequestSaveProfileRequest ¶
type RequestSaveProfileRequest struct { // Profile name ProfileName string }
func (*RequestSaveProfileRequest) Encode ¶
func (req *RequestSaveProfileRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*RequestSaveProfileRequest) NetPacketId ¶
func (req *RequestSaveProfileRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type ResponseTimeoutError ¶
type ResponseTimeoutError struct {
// contains filtered or unexported fields
}
Occurs, when a timeout happens while waiting for a response.
func (*ResponseTimeoutError) Error ¶
func (e *ResponseTimeoutError) Error() string
Error implements error.
func (*ResponseTimeoutError) Unwrap ¶
func (e *ResponseTimeoutError) Unwrap() error
type SetClientNameRequest ¶
type SetClientNameRequest struct { // Client name ClientName string }
func (*SetClientNameRequest) Encode ¶
func (req *SetClientNameRequest) Encode(v Version, b *NetPacketDataBuilder)
NetPacketId implements DataEncoder.
func (*SetClientNameRequest) NetPacketId ¶
func (req *SetClientNameRequest) NetPacketId() NetPacketId
NetPacketId implements NetPacketCommand.
type UnprocessedResponseError ¶
type UnprocessedResponseError struct {
// contains filtered or unexported fields
}
Occurs, when an invalid size response is returned.
func (*UnprocessedResponseError) Error ¶
func (e *UnprocessedResponseError) Error() string
Error implements error
type Version ¶
type Version uint32
const ClientVersion Version = 3
Highest version supported by the SDK
type Zone ¶
type Zone struct { // Zone name string value ZoneName string // Zone type value ZoneType int32 // Zone leds_min value ZoneLedsMin uint32 // Zone leds_max value ZoneLedsMax uint32 // Zone leds_count value ZoneLedsCount uint32 // Zone matrix_map data (*only if matrix_map exists) ZoneMatrixData [][]uint32 }