Help us shape the future of Go! Take the 2026 Go Developer Survey

lights

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionILightsManagerGetLights      = binder.FirstCallTransaction + 0
	TransactionILightsManagerGetLightState  = binder.FirstCallTransaction + 1
	TransactionILightsManagerOpenSession    = binder.FirstCallTransaction + 2
	TransactionILightsManagerCloseSession   = binder.FirstCallTransaction + 3
	TransactionILightsManagerSetLightStates = binder.FirstCallTransaction + 4
)
View Source
const (
	MethodILightsManagerGetLights      = "getLights"
	MethodILightsManagerGetLightState  = "getLightState"
	MethodILightsManagerOpenSession    = "openSession"
	MethodILightsManagerCloseSession   = "closeSession"
	MethodILightsManagerSetLightStates = "setLightStates"
)
View Source
const DescriptorILightsManager = "android.hardware.lights.ILightsManager"

Variables

This section is empty.

Functions

This section is empty.

Types

type ILightsManager

type ILightsManager interface {
	AsBinder() binder.IBinder
	GetLights(ctx context.Context) ([]Light, error)
	GetLightState(ctx context.Context, lightId int32) (LightState, error)
	OpenSession(ctx context.Context, sessionToken binder.IBinder, priority int32) error
	CloseSession(ctx context.Context, sessionToken binder.IBinder) error
	SetLightStates(ctx context.Context, sessionToken binder.IBinder, lightIds []int32, states []LightState) error
}

func NewLightsManagerStub

func NewLightsManagerStub(
	impl ILightsManagerServer,
) ILightsManager

NewLightsManagerStub creates a server-side ILightsManager wrapping the given server implementation. The returned value satisfies ILightsManager and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ILightsManagerServer

type ILightsManagerServer interface {
	GetLights(ctx context.Context) ([]Light, error)
	GetLightState(ctx context.Context, lightId int32) (LightState, error)
	OpenSession(ctx context.Context, sessionToken binder.IBinder, priority int32) error
	CloseSession(ctx context.Context, sessionToken binder.IBinder) error
	SetLightStates(ctx context.Context, sessionToken binder.IBinder, lightIds []int32, states []LightState) error
}

ILightsManagerServer is the server-side interface that user implementations provide to NewLightsManagerStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type Light

type Light struct {
	Id           int32
	Name         string
	Ordinal      int32
	Type         int32
	Capabilities int32
}

func (*Light) MarshalParcel

func (s *Light) MarshalParcel(
	p *parcel.Parcel,
) error

func (*Light) UnmarshalParcel

func (s *Light) UnmarshalParcel(
	p *parcel.Parcel,
) error

type LightState

type LightState struct {
	Color    int32
	PlayerId int32
}

func (*LightState) MarshalParcel

func (s *LightState) MarshalParcel(
	p *parcel.Parcel,
) error

func (*LightState) UnmarshalParcel

func (s *LightState) UnmarshalParcel(
	p *parcel.Parcel,
) error

type LightsManagerProxy

type LightsManagerProxy struct {
	Remote binder.IBinder
}

func NewLightsManagerProxy

func NewLightsManagerProxy(
	remote binder.IBinder,
) *LightsManagerProxy

func (*LightsManagerProxy) AsBinder

func (p *LightsManagerProxy) AsBinder() binder.IBinder

func (*LightsManagerProxy) CloseSession

func (p *LightsManagerProxy) CloseSession(
	ctx context.Context,
	sessionToken binder.IBinder,
) error

func (*LightsManagerProxy) GetLightState

func (p *LightsManagerProxy) GetLightState(
	ctx context.Context,
	lightId int32,
) (LightState, error)

func (*LightsManagerProxy) GetLights

func (p *LightsManagerProxy) GetLights(
	ctx context.Context,
) ([]Light, error)

func (*LightsManagerProxy) OpenSession

func (p *LightsManagerProxy) OpenSession(
	ctx context.Context,
	sessionToken binder.IBinder,
	priority int32,
) error

func (*LightsManagerProxy) SetLightStates

func (p *LightsManagerProxy) SetLightStates(
	ctx context.Context,
	sessionToken binder.IBinder,
	lightIds []int32,
	states []LightState,
) error

type LightsManagerStub

type LightsManagerStub struct {
	Impl      ILightsManager
	Transport binder.VersionAwareTransport
}

LightsManagerStub dispatches incoming binder transactions to a typed ILightsManager implementation.

func (*LightsManagerStub) Descriptor

func (s *LightsManagerStub) Descriptor() string

func (*LightsManagerStub) OnTransaction

func (s *LightsManagerStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

Jump to

Keyboard shortcuts

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