Ubuntu Platform API  3.0.0
A library helping with tight integration into the Ubuntu platform
proximity.h File Reference
#include <ubuntu/visibility.h>
#include <stdint.h>
+ Include dependency graph for proximity.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef UbuntuApplicationSensorsProximityDistance UASProximityDistance
 
typedef void UASProximityEvent
 Opaque type describing an accelerometer reading. More...
 

Enumerations

enum  UbuntuApplicationSensorsProximityDistance {
  U_PROXIMITY_NEAR = 1,
  U_PROXIMITY_FAR = 2
}
 Useful constants when inspecting readings from the proximity sensor. More...
 

Functions

UBUNTU_DLL_PUBLIC uint64_t uas_proximity_event_get_timestamp (UASProximityEvent *event)
 Query the timestamp of the sensor reading. More...
 
UBUNTU_DLL_PUBLIC UASProximityDistance uas_proximity_event_get_distance (UASProximityEvent *event)
 Query the discrete distance as reported by the proximity sensor. More...
 

Typedef Documentation

◆ UASProximityDistance

◆ UASProximityEvent

typedef void UASProximityEvent

Opaque type describing an accelerometer reading.

Definition at line 45 of file proximity.h.

Enumeration Type Documentation

◆ UbuntuApplicationSensorsProximityDistance

Useful constants when inspecting readings from the proximity sensor.

Enumerator
U_PROXIMITY_NEAR 

The reading indicates that something is near the sensor/device.

U_PROXIMITY_FAR 

The reading indicates that something is far away from the sensor/device.

Definition at line 34 of file proximity.h.

Function Documentation

◆ uas_proximity_event_get_distance()

UBUNTU_DLL_PUBLIC UASProximityDistance uas_proximity_event_get_distance ( UASProximityEvent event)

Query the discrete distance as reported by the proximity sensor.

Returns
The discrete distance as reported by the proximity sensor.
Parameters
[in]eventThe reading to be queried.

◆ uas_proximity_event_get_timestamp()

UBUNTU_DLL_PUBLIC uint64_t uas_proximity_event_get_timestamp ( UASProximityEvent event)

Query the timestamp of the sensor reading.

Returns
The timestamp of the sensor reading in [µs], timebase: monotonic clock.
Parameters
[in]eventThe reading to be queried.