fuchsia.hardware.light

PROTOCOLS

Light

Defined in fuchsia.hardware.light/light.fidl

GetName

Returns a board specific name for the light. For example, "mute" for a microphone mute indicator light, "bluetooth" for Bluetooth pairing light, etc.

Request

NameType
index uint32

Response

NameType
status zx/status
name string[32]?

GetCount

Returns the total number of physical lights. This will typically be 1 for a simple LED, but may be greater than one for an array of LEDs or a more complicated lighting device. The multiple lights are addressed using "index" parameter in the calls below.

Request

NameType

Response

NameType
count uint32

HasCapability

Returns true if the light with given index

Request

NameType
index uint32
capability Capability

Response

NameType
status zx/status
has bool

GetSimpleValue

Returns the current value (zero or non-zero for simple lights, or 0 - 255 for lights that support brightness). Returns error for RGB lights.

Request

NameType
index uint32

Response

NameType
status zx/status
value uint8

SetSimpleValue

Sets the current value (zero or non-zero for simple lights, or 0 - 255 for lights that support brightness). Returns error for RGB lights.

Request

NameType
index uint32
value uint8

Response

NameType
status zx/status

GetRgbValue

Returns the current RGB value for the light. Returns error for non-RGB lights.

Request

NameType
index uint32

Response

NameType
status zx/status
value Rgb

SetRgbValue

Sets the current RGB value for the light. Returns error for non-RGB lights.

Request

NameType
index uint32
value Rgb

Response

NameType
status zx/status

GetGroupInfo

Returns group info for the light group.

Request

NameType
group_id uint32

Response

NameType
status zx/status
info GroupInfo?

GetGroupCurrentSimpleValue

Returns an array of the current values (bool for on/off). If group_id is invalid, ZX_ERR_INVALID_ARGS will be returned. If the capability 'SIMPLE' is not supported by this group, returns ZX_ERR_NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation.

Request

NameType
group_id uint32

Response

NameType
status zx/status
values vector<bool>?

SetGroupSimpleValue

Sets the current values (bool for on/off) through the values array. If group_id is invalid, ZX_ERR_INVALID_ARGS will be returned. If the capability 'SIMPLE' is not supported by this group, returns ZX_ERR_NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation.

Request

NameType
group_id uint32
values vector<bool>

Response

NameType
status zx/status

GetGroupCurrentBrightnessValue

Returns an array of the current values (0 - 255). If group_id is invalid, ZX_ERR_INVALID_ARGS will be returned. If the capability 'BRIGHTNESS' is not supported by this group, returns ZX_ERR_NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation.

Request

NameType
group_id uint32

Response

NameType
status zx/status
values vector<uint8>?

SetGroupBrightnessValue

Sets the current values (0 - 255) through the values array. If group_id is invalid, ZX_ERR_INVALID_ARGS will be returned. If the capability 'BRIGHTNESS' is not supported by this group, returns ZX_ERR_NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation.

Request

NameType
group_id uint32
values vector<uint8>

Response

NameType
status zx/status

GetGroupCurrentRgbValue

Returns an array of the current RGB values for the light group. If group_id is invalid, ZX_ERR_INVALID_ARGS will be returned. If the capability 'RGB' is not supported by this group, returns ZX_ERR_NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation.

Request

NameType
group_id uint32

Response

NameType
status zx/status
values vector<Rgb>?

SetGroupRgbValue

Sets the current RGB value for the light group. If group_id is invalid, ZX_ERR_INVALID_ARGS will be returned. If the capability 'RGB' is not supported by this group, returns ZX_ERR_NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation.

Request

NameType
group_id uint32
values vector<Rgb>

Response

NameType
status zx/status

STRUCTS

Rgb

Defined in fuchsia.hardware.light/light.fidl

NameTypeDescriptionDefault
red uint8 No default
green uint8 No default
blue uint8 No default

GroupInfo

Defined in fuchsia.hardware.light/light.fidl

NameTypeDescriptionDefault
name string[32] No default
count uint32 No default
capability Capability No default

ENUMS

Capability

Type: uint32

Defined in fuchsia.hardware.light/light.fidl

NameValueDescription
BRIGHTNESS 0

This capability indicates that the light supports setting brightness to a uint8_t value. If this capability is not supported, the light only supports off and on state.

RGB 1

This capability indicates that the light supports setting an RGB value.

SIMPLE 2

No capabilities

CONSTANTS

NameValueTypeDescription
LIGHT_NAME_LEN 32 uint8