Aila_OverrideLightLevels
Override light levels to given values, or revert to normal levels.
Signature
- Objective-C
- Swift
void Aila_OverrideLightLevels(const AilaLightLevels *levels);
typedef struct {
float area;
float spot;
} AilaLightLevels;
func Aila_OverrideLightLevels(_ levels: UnsafePointer<AilaLightLevels>?)
struct AilaLightLevels {
var area: Float
var spot: Float
}
Parameters
levels- Pointer toAilaLightLevelsstruct, orNULL/nilto clear override
Description
Directly controls the intensity of lighting on your Aila hardware. Using this function should be reserved for non-standard use cases, as the nominal lighting levels are optimized for scanning and imaging functions.
Both the illumination LED(s) (area) and aiming LED(s) (spot) may be independently controlled. Because barcode scanning and motion detection depend on tuned lighting intensity, LED override should only be used when Aila_Stop() is in effect (or Aila_Start() has never been called).
The override values cannot be used when Aila_EnableSpeaker() is in effect on Lightning-based Apple devices, as kiosk communications occur through the audio jack.
To clear the current override values, pass NULL/nil to Aila_OverrideLightLevels().
Usage
- Objective-C
- Swift
// Stop scanning first
Aila_Stop();
// Set custom light levels
AilaLightLevels levels;
levels.area = 0.5f; // 50% illumination
levels.spot = 0.8f; // 80% aiming
Aila_OverrideLightLevels(&levels);
// Do custom work with lights on...
// Clear override and return to normal
Aila_OverrideLightLevels(NULL);
Aila_Start();
// Stop scanning first
Aila_Stop()
// Set custom light levels
var levels = AilaLightLevels(area: 0.5, spot: 0.8)
withUnsafePointer(to: &levels) { levelsPtr in
Aila_OverrideLightLevels(levelsPtr)
}
// Do custom work with lights on...
// Clear override and return to normal
Aila_OverrideLightLevels(nil)
Aila_Start()
See Also
- Aila_OverrideLightTimeout - Set lighting duration
- Aila_Stop - Stop scanning