Stay organized with collections
Save and categorize content based on your preferences.
light_state_t Struct Reference
#include <
lights.h
>
The parameters that can be set for a given light.
Not all lights must support all parameters. If you can do something backward-compatible, you should.
Definition at line
145
of file
lights.h
.
Policy used by the framework to manage the light's brightness. Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR.
Definition at line
173
of file
lights.h
.
The color of the LED in ARGB.
Do your best here.
-
If your light can only do red or green, if they ask for blue, you should do green.
-
If you can only do a brightness ramp, then use this formula: unsigned char brightness = ((77*((color>>16)&0x00ff))
-
(150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8;
-
If you can only do on or off, 0 is off, anything else is on.
The high byte should be ignored. Callers will set it to 0xff (which would correspond to 255 alpha).
Definition at line
160
of file
lights.h
.
See the LIGHT_FLASH_* constants
Definition at line
165
of file
lights.h
.
The documentation for this struct was generated from the following file:
-
hardware/libhardware/include/hardware/
lights.h
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2019-10-02 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2019-10-02 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-10-02 UTC."]]