LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Service API com.palm.ambientLightSensor/control/

Public methods:


status

Public.

com.palm.ambientLightSensor/control/status

Get status and optionally enable or disable the ambient light sensor.

Syntax:

{
"subscribe": boolean,
"disableALS": boolean
}
Parameters
subscribeSet to true to receive status updates.
disableALSIf subscribe is set to true, set this to true to disable the ambient light sensor.

Returns for a call:

{
"returnValue": boolean,
"current": int,
"average": int,
"disabled": boolean,
"subscribed": boolean
}
Parameters
returnValueIndicates if the call was succesful.
currentCurrent value of the ambient light sensor.
averageAverage value of the ambient light sensor.
disabledTrue if ambient light sensor is disabled.
subscribedTrue if subscribed to receive status updates.

Returns for status updates:

{
"returnValue": boolean,
"current": int,
"region": int
}
Parameters
returnValueIndicates if the call was succesful.
currentCurrent value of the ambient light sensor.
regionA value between 0-4 describing the amount of ambient light:
  • 0: Undefined, when the sensor is disabled.
  • 1: Dark
  • 2: Dim
  • 3: Indoor
  • 4: Outdoor

Examples:

luna-send -n 1 -f luna://com.palm.ambientLightSensor/control/status '{ "subscribe": true, "disableALS": false }'

Example response for a succesful call:

{
"returnValue": true,
"current": 6,
"average": 187,
"disabled": true,
"subscribed": true
}

Example status updates:

{
"returnValue": true,
"current": 184,
"region": 3
}
{
"returnValue": true,
"current": 179,
"region": 3
}
{
"returnValue": true,
"current": 171,
"region": 3
}
{
"returnValue": true,
"current": 66,
"region": 3
}