|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-83630B57-D842-4B60-8AF0-D2965251DE29" xml:lang="en"><title>Retrieving |
|
13 Channel Properties</title><shortdesc>A sensor channel is associated with properties such as channel |
|
14 availability status, data transmission rate, data format and so on. Also, |
|
15 each field in the data type supplied by a sensor channel can have its own |
|
16 properties. The channel properties can be retrieved using the <apiname>CSensrvChannel::GetPropertyL()</apiname> and <apiname>CSensrvChannel::GetAllPropertiesL()</apiname> functions.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
17 <prereq id="GUID-91C43F20-A2FA-4A16-AA10-7BE00EC8E4AF"> <p>Before retrieving |
|
18 channel properties, you must <xref href="GUID-4B709839-8EEF-4AD2-9868-9AF0176B1E5B.dita#GUID-4B709839-8EEF-4AD2-9868-9AF0176B1E5B/GUID-FBBD3A8B-F240-4DC0-B516-3A51FDD86A88">open |
|
19 the sensor channel</xref>.</p> </prereq> |
|
20 <context id="GUID-E36A1CB4-6973-42CF-8935-A3C5DEE2CE34"><p>A channel property |
|
21 is referenced by its property id and an index. The parameters of the <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-1E9D960B-23C4-30DF-A184-7E978AC9AC1B"><apiname>CSensrvChannel::GetPropertyL()</apiname></xref> are |
|
22 listed with their meanings in the following table.</p><table id="GUID-D8B0C588-8648-4CB7-936D-A3CA70E1A49D"> |
|
23 <tgroup cols="2"><colspec colname="col1" colwidth="0.44*"/><colspec colname="col2" colwidth="1.56*"/> |
|
24 <thead> |
|
25 <row> |
|
26 <entry>Parameter</entry> |
|
27 <entry>Meaning</entry> |
|
28 </row> |
|
29 </thead> |
|
30 <tbody> |
|
31 <row> |
|
32 <entry>First parameter</entry> |
|
33 <entry>specifies the id of the property to retrieve.</entry> |
|
34 </row> |
|
35 <row> |
|
36 <entry>Second parameter</entry> |
|
37 <entry>is an index that specifies the property to be retrieved, if there are |
|
38 several properties associated with a particular property id.</entry> |
|
39 </row> |
|
40 <row> |
|
41 <entry>Third parameter</entry> |
|
42 <entry> is a <parmname>TSensrvProperty</parmname> that is passed by reference |
|
43 and populated by <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-1E9D960B-23C4-30DF-A184-7E978AC9AC1B"><apiname>CSensrvChannel::GetPropertyL()</apiname></xref>.</entry> |
|
44 </row> |
|
45 </tbody> |
|
46 </tgroup> |
|
47 </table><p>The following list shows the different possible values of the index |
|
48 :</p><ul> |
|
49 <li><p>When the property id is for a simple property, that is, there is only |
|
50 one property item for the id (for example, <parmname>KSensrvPropIdChannelAccuracy</parmname>), |
|
51 the second parameter must be specified as <parmname>ESensrvSingleProperty</parmname>.</p></li> |
|
52 <li><p>When the given property id has an array of <parmname>TSensrvProperty</parmname> items, |
|
53 the index parameter indicates which item in the array to retrieve. One such |
|
54 case is when you want to retrieve a property of a particular data field that |
|
55 is supplied by the channel. For example, if you want to find out if the X |
|
56 axis of the accelerometer is enabled, you must specify <parmname>KSensrvPropIdAxisActive</parmname> as |
|
57 the property id, and <parmname>TSensrvAccelerometerAxisData::iAxisX </parmname> as |
|
58 the index. For details, see <xref href="GUID-8DCBAA05-9741-48C8-A831-966D37FBC05A.dita">Array |
|
59 Properties</xref>.</p></li> |
|
60 <li><p>When the given property id has an array of <parmname>TSensrvProperty</parmname> items, |
|
61 information about the array can be retrieved by specifying <parmname>ESensrvArrayPropertyInfo</parmname> as |
|
62 the index parameter. For example, when a channel can provide data at discrete |
|
63 data rates, the information for each data rate is stored in a <parmname>TSensrvProperty</parmname> item. |
|
64 You can use <parmname>KSensrvPropIdDataRate</parmname> as the property id |
|
65 and <parmname>ESensrvArrayPropertyInfo</parmname> as the index to retrieve |
|
66 the property item that contains this information. </p></li> |
|
67 </ul></context> |
|
68 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-6-1-8-1-1-6-1-4-1-4-1-6-1-3-3"> |
|
69 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-6-1-8-1-1-6-1-4-1-4-1-6-1-3-3-1"><cmd>Create an instance |
|
70 of <parmname>TSensrvProperty</parmname>.</cmd> |
|
71 <stepxmp><codeblock xml:space="preserve">TSensrvProperty property;</codeblock></stepxmp> |
|
72 <info> <p>Each channel property is encapsulated by the <parmname>TSensrvProperty</parmname> class. |
|
73 Therefore, the details of the retrieved property can be accessed using the |
|
74 functions of the <parmname>TSensrvProperty</parmname> class.</p> </info> |
|
75 </step> |
|
76 <step id="GUID-BB85979A-442C-41AF-B406-C239369C923E"><cmd>Use the <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-1E9D960B-23C4-30DF-A184-7E978AC9AC1B"><apiname>CSensrvChannel::GetPropertyL()</apiname></xref> function |
|
77 to retrieve the property item for a particular property id. For example, to |
|
78 check for the accuracy of a channel, pass the <parmname>KSensrvPropIdChannelAccuracy</parmname> as |
|
79 a property id.</cmd> |
|
80 <stepxmp><codeblock xml:space="preserve">... |
|
81 |
|
82 CSensrvChannel* iSensorChannel; |
|
83 .... |
|
84 iSensorChannel->GetPropertyL( KSensrvPropIdChannelAccuracy, |
|
85 KSensrvItemIndexNone, |
|
86 property ); |
|
87 |
|
88 ....</codeblock></stepxmp> |
|
89 <info><note> You can retrieve all the properties associated with a particular |
|
90 sensor channel using the <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-ABF67AF4-BAC9-3BA3-B558-9AC1B8E0DFDE"><apiname>CSensrvChannel::GetAllPropertiesL()</apiname></xref> function.</note></info> |
|
91 </step> |
|
92 </steps> |
|
93 <postreq id="GUID-459AF9E3-B0EA-4E8F-81AF-726DA3B0E053"><ul> |
|
94 <li>End the session with the sensor channel using the <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-0B8F50A6-2CA1-316A-82AB-AA026005E810"><apiname>CSensrvChannel::CloseChannel()</apiname></xref> function.</li> |
|
95 <li>You can set the required channel properties. For details, see <xref href="GUID-0CA7F22E-59D7-4D65-9D6C-735E4E0F0454.dita">Setting |
|
96 Channel Properties</xref>.</li> |
|
97 </ul></postreq> |
|
98 </taskbody></task> |