File: //usr/share/gtk-doc/html/iio-sensor-proxy/gdbus-net.hadess.SensorProxy.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>net.hadess.SensorProxy: Sensor Proxy Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Sensor Proxy Reference Manual">
<link rel="up" href="ref-dbus.html" title="D-Bus API Reference">
<link rel="prev" href="ref-dbus.html" title="D-Bus API Reference">
<link rel="next" href="gdbus-net.hadess.SensorProxy.Compass.html" title="net.hadess.SensorProxy.Compass">
<meta name="generator" content="GTK-Doc V1.29.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#gdbus-net.hadess.SensorProxy.description" class="shortcut">Description</a></span><span id="nav_properties"> <span class="dim">|</span>
<a href="#gdbus-net.hadess.SensorProxy.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ref-dbus.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ref-dbus.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdbus-net.hadess.SensorProxy.Compass.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdbus-net.hadess.SensorProxy"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdbus-interface-net-hadess-SensorProxy.top_of_page"></a>net.hadess.SensorProxy</span></h2>
<p>net.hadess.SensorProxy — D-Bus proxy to access hardware sensors</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Methods</h2>
<pre class="synopsis">
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ClaimAccelerometer" title="The ClaimAccelerometer() method">ClaimAccelerometer</a> ();
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ReleaseAccelerometer" title="The ReleaseAccelerometer() method">ReleaseAccelerometer</a> ();
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ClaimLight" title="The ClaimLight() method">ClaimLight</a> ();
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ReleaseLight" title="The ReleaseLight() method">ReleaseLight</a> ();
</pre>
</div>
<div class="refsect1">
<a name="id-1.2.3.4"></a><h2>Properties</h2>
<pre class="synopsis">
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-property-net-hadess-SensorProxy.HasAccelerometer" title='The "HasAccelerometer" property'>HasAccelerometer</a> readable b
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-property-net-hadess-SensorProxy.AccelerometerOrientation" title='The "AccelerometerOrientation" property'>AccelerometerOrientation</a> readable s
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-property-net-hadess-SensorProxy.HasAmbientLight" title='The "HasAmbientLight" property'>HasAmbientLight</a> readable b
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-property-net-hadess-SensorProxy.LightLevelUnit" title='The "LightLevelUnit" property'>LightLevelUnit</a> readable s
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-property-net-hadess-SensorProxy.LightLevel" title='The "LightLevel" property'>LightLevel</a> readable d
</pre>
</div>
<div class="refsect1">
<a name="gdbus-interface-net-hadess-SensorProxy"></a><h2>Description</h2>
<p> After checking the availability of the sensor type you want to monitor,
call the <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ClaimAccelerometer" title="The ClaimAccelerometer() method">ClaimAccelerometer()</a> or the
<a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ClaimLight" title="The ClaimLight() method">ClaimLight()</a> method to start updating the properties
from the hardware readings.
</p>
<p> The object path will be "/net/hadess/SensorProxy".
</p>
</div>
<div class="refsect1">
<a name="gdbus-methods-net.hadess.SensorProxy"></a><h2>Method Details</h2>
<div class="refsect2">
<a name="gdbus-method-net-hadess-SensorProxy.ClaimAccelerometer"></a><h3>The ClaimAccelerometer() method</h3>
<pre class="programlisting">
ClaimAccelerometer ();
</pre>
<p> To start receiving accelerometer reading updates from the proxy, the application
must call the <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ClaimAccelerometer" title="The ClaimAccelerometer() method">ClaimAccelerometer()</a> method. It can do so
whether an accelerometer is available or not, updates would then be sent when an
accelerometer appears.
</p>
<p> Applications should call <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ReleaseAccelerometer" title="The ReleaseAccelerometer() method">ReleaseAccelerometer()</a> when
readings are not required anymore. For example, an application that monitors
the orientation of the main screen should stop monitoring for updates when that
screen has been turned off.
</p>
<p> This prevents the sensor proxy from polling the device, thus increasing wake-ups
and reducing battery life.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-method-net-hadess-SensorProxy.ReleaseAccelerometer"></a><h3>The ReleaseAccelerometer() method</h3>
<pre class="programlisting">
ReleaseAccelerometer ();
</pre>
<p> This should be called as soon as readings are not required anymore. Note
that resources are freed up if a monitoring application exits without
calling <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ReleaseAccelerometer" title="The ReleaseAccelerometer() method">ReleaseAccelerometer()</a>, crashes or the sensor disappears.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-method-net-hadess-SensorProxy.ClaimLight"></a><h3>The ClaimLight() method</h3>
<pre class="programlisting">
ClaimLight ();
</pre>
<p> To start receiving ambient light sensor reading updates from the proxy, the
application must call the <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ClaimLight" title="The ClaimLight() method">ClaimLight()</a> method. It can do so
whether an ambient light sensor is available or not, updates would then be sent
when such a sensor appears.
</p>
<p> Applications should call <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ReleaseLight" title="The ReleaseLight() method">ReleaseLight()</a> when readings are
not required anymore. For example, an application that monitors the ambient light
to change the screen brightness should stop monitoring for updates when that screen
has been turned off.
</p>
<p> This prevents the sensor proxy from polling the device, thus increasing wake-ups
and reducing battery life.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-method-net-hadess-SensorProxy.ReleaseLight"></a><h3>The ReleaseLight() method</h3>
<pre class="programlisting">
ReleaseLight ();
</pre>
<p> This should be called as soon as readings are not required anymore. Note
that resources are freed up if a monitoring application exits without
calling <a class="link" href="gdbus-net.hadess.SensorProxy.html#gdbus-method-net-hadess-SensorProxy.ReleaseLight" title="The ReleaseLight() method">ReleaseLight()</a>, crashes or the sensor disappears.
</p>
</div>
</div>
<div class="refsect1">
<a name="gdbus-properties-net.hadess.SensorProxy"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="gdbus-property-net-hadess-SensorProxy.HasAccelerometer"></a><h3>The "HasAccelerometer" property</h3>
<pre class="programlisting">
HasAccelerometer readable b
</pre>
<p> Whether a supported accelerometer is present on the system.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-net-hadess-SensorProxy.AccelerometerOrientation"></a><h3>The "AccelerometerOrientation" property</h3>
<pre class="programlisting">
AccelerometerOrientation readable s
</pre>
<p> The detected orientation of the tablet or laptop.
Possible values are:
- undefined
- normal
- bottom-up
- left-up
- right-up
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-net-hadess-SensorProxy.HasAmbientLight"></a><h3>The "HasAmbientLight" property</h3>
<pre class="programlisting">
HasAmbientLight readable b
</pre>
<p> Whether a supported ambient light sensor is present on the system.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-net-hadess-SensorProxy.LightLevelUnit"></a><h3>The "LightLevelUnit" property</h3>
<pre class="programlisting">
LightLevelUnit readable s
</pre>
<p> The unit used in Ambient Light Sensor readings. It is
one of either "lux" or "vendor".
</p>
<p> Note that different hardware will have different readings in the
same condition, so values should be taken as relative.
</p>
<p> When the unit is "vendor", readings will be a percentage with 100<code class="constant"></code> being the
maximum reading.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdbus-property-net-hadess-SensorProxy.LightLevel"></a><h3>The "LightLevel" property</h3>
<pre class="programlisting">
LightLevel readable d
</pre>
<p> The ambient light sensor reading, in the unit exported in the
"LightLevelUnit" property.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.29.1</div>
</body>
</html>