williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: The channel basic information
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef SENSRVCHANNELINFO_H
|
williamr@2
|
20 |
#define SENSRVCHANNELINFO_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
#include <sensrvtypes.h>
|
williamr@2
|
24 |
/**
|
williamr@2
|
25 |
* The TSensrvChannelInfo class is a data class that holds information about a sensor channel.
|
williamr@2
|
26 |
*
|
williamr@2
|
27 |
* It also provides simple helper methods that allow users to determine if the class is complete
|
williamr@2
|
28 |
* and if one instance of this class matches another.
|
williamr@2
|
29 |
*
|
williamr@2
|
30 |
* @lib sensrvutil.lib
|
williamr@2
|
31 |
* @since S60 5.0
|
williamr@2
|
32 |
*/
|
williamr@2
|
33 |
NONSHARABLE_CLASS( TSensrvChannelInfo )
|
williamr@2
|
34 |
{
|
williamr@2
|
35 |
public:
|
williamr@2
|
36 |
|
williamr@2
|
37 |
/**
|
williamr@2
|
38 |
* Default Constructor
|
williamr@2
|
39 |
*
|
williamr@2
|
40 |
* @since S60 5.0
|
williamr@2
|
41 |
*/
|
williamr@2
|
42 |
IMPORT_C TSensrvChannelInfo();
|
williamr@2
|
43 |
|
williamr@2
|
44 |
/**
|
williamr@2
|
45 |
* Constructor
|
williamr@2
|
46 |
*
|
williamr@2
|
47 |
* This constructor is for use with CSensrvChannelFinder::FindChannelsL(). It sets the ChannelId
|
williamr@2
|
48 |
* and DataItemSize to zero.
|
williamr@2
|
49 |
*
|
williamr@2
|
50 |
* @since S60 5.0
|
williamr@2
|
51 |
* @param aContextType Channel context type. Set to a value from TSensrvContextType.
|
williamr@2
|
52 |
* @param aQuantity Channel quantity. Set to a value from TSensrvQuantity.
|
williamr@2
|
53 |
* @param aChannelType Channel type id. This is a uid.
|
williamr@2
|
54 |
* @param aLocation Channel physical location.
|
williamr@2
|
55 |
* @param aVendorId Channel vendor name.
|
williamr@2
|
56 |
* @param aChannelDataTypeId Channel data type Id. This is a uid.
|
williamr@2
|
57 |
* @see TSensrvContextType
|
williamr@2
|
58 |
* @see TSensrvQuantity
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
IMPORT_C TSensrvChannelInfo( TInt aContextType,
|
williamr@2
|
61 |
TInt aQuantity,
|
williamr@2
|
62 |
TSensrvChannelTypeId aChannelType,
|
williamr@2
|
63 |
const TDesC8& aLocation,
|
williamr@2
|
64 |
const TDesC8& aVendorId,
|
williamr@2
|
65 |
TSensrvChannelDataTypeId aChannelDataTypeId );
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/**
|
williamr@2
|
68 |
* Constructor
|
williamr@2
|
69 |
*
|
williamr@2
|
70 |
* @since S60 5.0
|
williamr@2
|
71 |
* @param aChannelId Channel identifier
|
williamr@2
|
72 |
* @param aContextType Channel context type. Set to a value from TSensrvContextType.
|
williamr@2
|
73 |
* @param aQuantity Channel quantity. Set to a value from TSensrvQuantity.
|
williamr@2
|
74 |
* @param aChannelType Channel type id. This is a uid.
|
williamr@2
|
75 |
* @param aLocation Channel physical location.
|
williamr@2
|
76 |
* @param aVendorId Channel vendor name.
|
williamr@2
|
77 |
* @param aDataItemSize Data item size for channel specific data
|
williamr@2
|
78 |
* @param aChannelDataTypeId Channel data type Id. This is a uid.
|
williamr@2
|
79 |
* @see TSensrvContextType
|
williamr@2
|
80 |
* @see TSensrvQuantity
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
IMPORT_C TSensrvChannelInfo( TSensrvChannelId aChannelId,
|
williamr@2
|
83 |
TInt aContextType,
|
williamr@2
|
84 |
TInt aQuantity,
|
williamr@2
|
85 |
TSensrvChannelTypeId aChannelType,
|
williamr@2
|
86 |
const TDesC8& aLocation,
|
williamr@2
|
87 |
const TDesC8& aVendorId,
|
williamr@2
|
88 |
TInt aDataItemSize,
|
williamr@2
|
89 |
TSensrvChannelDataTypeId aChannelDataTypeId );
|
williamr@2
|
90 |
|
williamr@2
|
91 |
/**
|
williamr@2
|
92 |
* Copy constructor
|
williamr@2
|
93 |
*
|
williamr@2
|
94 |
* @since S60 5.0
|
williamr@2
|
95 |
* @param aChannelInfo Instance to be copied
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
IMPORT_C TSensrvChannelInfo( const TSensrvChannelInfo& aChannelInfo );
|
williamr@2
|
98 |
|
williamr@2
|
99 |
public:
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Checks if this instance matches supplied instance. Fields that are zero or empty are ignored.
|
williamr@2
|
103 |
* Channel Id, Data Item Size and Reserved fields are ignored.
|
williamr@2
|
104 |
*
|
williamr@2
|
105 |
* @since S60 5.0
|
williamr@2
|
106 |
* @param aInfo Instance to be matched against this instance.
|
williamr@2
|
107 |
* @return ETrue if there is a match, otherwise EFalse
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
IMPORT_C TBool IsMatch( const TSensrvChannelInfo &aInfo ) const;
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
* Checks that channel information in this object is complete. Complete means no zero or empty fields.
|
williamr@2
|
113 |
* Channel Id, Data Item Size and the Reserved fields are ignored.
|
williamr@2
|
114 |
*
|
williamr@2
|
115 |
* @since S60 5.0
|
williamr@2
|
116 |
* @return ETrue if channel information is complete.
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
IMPORT_C TBool IsComplete() const;
|
williamr@2
|
119 |
|
williamr@2
|
120 |
public:
|
williamr@2
|
121 |
/**
|
williamr@2
|
122 |
* Channel Identifier
|
williamr@2
|
123 |
*/
|
williamr@2
|
124 |
TSensrvChannelId iChannelId;
|
williamr@2
|
125 |
|
williamr@2
|
126 |
/**
|
williamr@2
|
127 |
* Context type
|
williamr@2
|
128 |
* @see TSensrvContextType
|
williamr@2
|
129 |
*/
|
williamr@2
|
130 |
TInt iContextType;
|
williamr@2
|
131 |
|
williamr@2
|
132 |
/**
|
williamr@2
|
133 |
* Quantity
|
williamr@2
|
134 |
* @see TSensrvQuantity
|
williamr@2
|
135 |
*/
|
williamr@2
|
136 |
TInt iQuantity;
|
williamr@2
|
137 |
|
williamr@2
|
138 |
/**
|
williamr@2
|
139 |
* Channel type identifier
|
williamr@2
|
140 |
*
|
williamr@2
|
141 |
* Identifies the channel type and therefore the content of the channel. This value is a uid and is
|
williamr@2
|
142 |
* unique among all channels. See sensor channel specific header files.
|
williamr@2
|
143 |
*/
|
williamr@2
|
144 |
TSensrvChannelTypeId iChannelType;
|
williamr@2
|
145 |
|
williamr@2
|
146 |
/**
|
williamr@2
|
147 |
* Location of the of the channel. This is a free format string
|
williamr@2
|
148 |
*/
|
williamr@2
|
149 |
TBuf8<KSensrvLocationLength> iLocation;
|
williamr@2
|
150 |
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Vendor name of the channel provider. This is a free format string and is not to be confused with
|
williamr@2
|
153 |
* Vendor Id unique Uid's.
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
TBuf8<KSensrvVendorIdLength> iVendorId;
|
williamr@2
|
156 |
|
williamr@2
|
157 |
/**
|
williamr@2
|
158 |
* Size of the data item delivered by the channel
|
williamr@2
|
159 |
*/
|
williamr@2
|
160 |
TInt iDataItemSize;
|
williamr@2
|
161 |
|
williamr@2
|
162 |
private:
|
williamr@2
|
163 |
TInt iReserved3;
|
williamr@2
|
164 |
|
williamr@2
|
165 |
public:
|
williamr@2
|
166 |
/**
|
williamr@2
|
167 |
* Identifies the channel data type. This value is a uid and is unique among all channels. See sensor
|
williamr@2
|
168 |
* channel specific header files.
|
williamr@2
|
169 |
*/
|
williamr@2
|
170 |
TSensrvChannelDataTypeId iChannelDataTypeId;
|
williamr@2
|
171 |
|
williamr@2
|
172 |
private:
|
williamr@2
|
173 |
TInt iReserved;
|
williamr@2
|
174 |
TInt iReserved2;
|
williamr@2
|
175 |
};
|
williamr@2
|
176 |
|
williamr@2
|
177 |
|
williamr@2
|
178 |
|
williamr@2
|
179 |
#endif // SENSRVCHANNELINFO_H
|