• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are
5  * met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above
9  *       copyright notice, this list of conditions and the following
10  *       disclaimer in the documentation and/or other materials provided
11  *       with the distribution.
12  *     * Neither the name of The Linux Foundation, nor the names of its
13  *       contributors may be used to endorse or promote products derived
14  *       from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 
30 #ifndef __DATAITEMCONCRETEBASETYPES__
31 #define __DATAITEMCONCRETEBASETYPES__
32 
33 #include <string>
34 #include <cstring>
35 #include <DataItemId.h>
36 #include <IDataItemCore.h>
37 
38 #define MAC_ADDRESS_LENGTH    6
39 // MAC address length in bytes
40 // QMI_LOC_SRN_MAC_ADDR_LENGTH_V02
41 #define SRN_MAC_ADDRESS_LENGTH    6
42 #define WIFI_SUPPLICANT_DEFAULT_STATE    0
43 
44 namespace loc_core
45 {
46 using namespace std;
47 
48 class AirplaneModeDataItemBase : public IDataItemCore  {
49 public:
AirplaneModeDataItemBase(bool mode)50     AirplaneModeDataItemBase(bool mode):
51         mMode(mode),
52         mId(AIRPLANEMODE_DATA_ITEM_ID) {}
~AirplaneModeDataItemBase()53     virtual ~AirplaneModeDataItemBase() {}
getId()54     inline virtual DataItemId getId() { return mId; }
stringify(string &)55     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)56     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
57 // Data members
58     bool mMode;
59 
60 protected:
61     DataItemId mId;
62 };
63 
64 class ENHDataItemBase : public IDataItemCore {
65 public:
ENHDataItemBase(bool enabled)66     ENHDataItemBase(bool enabled) :
67         mEnabled(enabled),
68         mId(ENH_DATA_ITEM_ID) {}
~ENHDataItemBase()69     virtual ~ENHDataItemBase() {}
getId()70     inline virtual DataItemId getId() { return mId; }
stringify(string &)71     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)72     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
73 // Data members
74     bool mEnabled;
75 protected:
76     DataItemId mId;
77 };
78 
79 class GPSStateDataItemBase : public IDataItemCore {
80 public:
GPSStateDataItemBase(bool enabled)81     GPSStateDataItemBase(bool enabled) :
82         mEnabled(enabled),
83         mId(GPSSTATE_DATA_ITEM_ID) {}
~GPSStateDataItemBase()84     virtual ~GPSStateDataItemBase() {}
getId()85     inline virtual DataItemId getId() { return mId; }
stringify(string &)86     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)87     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
88 // Data members
89     bool mEnabled;
90 protected:
91     DataItemId mId;
92 };
93 
94 class NLPStatusDataItemBase : public IDataItemCore {
95 public:
NLPStatusDataItemBase(bool enabled)96     NLPStatusDataItemBase(bool enabled) :
97         mEnabled(enabled),
98         mId(NLPSTATUS_DATA_ITEM_ID) {}
~NLPStatusDataItemBase()99     virtual ~NLPStatusDataItemBase() {}
getId()100     inline virtual DataItemId getId() { return mId; }
stringify(string &)101     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)102     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
103 // Data members
104     bool mEnabled;
105 protected:
106     DataItemId mId;
107 };
108 
109 class WifiHardwareStateDataItemBase : public IDataItemCore {
110 public:
WifiHardwareStateDataItemBase(bool enabled)111     WifiHardwareStateDataItemBase(bool enabled) :
112         mEnabled(enabled),
113         mId(WIFIHARDWARESTATE_DATA_ITEM_ID) {}
~WifiHardwareStateDataItemBase()114     virtual ~WifiHardwareStateDataItemBase() {}
getId()115     inline virtual DataItemId getId() { return mId; }
stringify(string &)116     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)117     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
118 // Data members
119     bool mEnabled;
120 protected:
121     DataItemId mId;
122 };
123 
124 class ScreenStateDataItemBase : public IDataItemCore {
125 public:
ScreenStateDataItemBase(bool state)126     ScreenStateDataItemBase(bool state) :
127         mState(state),
128         mId(SCREEN_STATE_DATA_ITEM_ID) {}
~ScreenStateDataItemBase()129     virtual ~ScreenStateDataItemBase() {}
getId()130     inline virtual DataItemId getId() { return mId; }
stringify(string &)131     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)132     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
133 // Data members
134     bool mState;
135 protected:
136     DataItemId mId;
137 };
138 
139 class PowerConnectStateDataItemBase : public IDataItemCore {
140 public:
PowerConnectStateDataItemBase(bool state)141     PowerConnectStateDataItemBase(bool state) :
142         mState(state),
143         mId(POWER_CONNECTED_STATE_DATA_ITEM_ID) {}
~PowerConnectStateDataItemBase()144     virtual ~PowerConnectStateDataItemBase() {}
getId()145     inline virtual DataItemId getId() { return mId; }
stringify(string &)146     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)147     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
148 // Data members
149     bool mState;
150 protected:
151     DataItemId mId;
152 };
153 
154 class TimeZoneChangeDataItemBase : public IDataItemCore {
155 public:
TimeZoneChangeDataItemBase(int64_t currTimeMillis,int32_t rawOffset,int32_t dstOffset)156     TimeZoneChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) :
157         mCurrTimeMillis (currTimeMillis),
158         mRawOffsetTZ (rawOffset),
159         mDstOffsetTZ (dstOffset),
160         mId(TIMEZONE_CHANGE_DATA_ITEM_ID) {}
~TimeZoneChangeDataItemBase()161     virtual ~TimeZoneChangeDataItemBase() {}
getId()162     inline virtual DataItemId getId() { return mId; }
stringify(string &)163     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)164     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
165 // Data members
166     int64_t mCurrTimeMillis;
167     int32_t mRawOffsetTZ;
168     int32_t mDstOffsetTZ;
169 protected:
170     DataItemId mId;
171 };
172 
173 class TimeChangeDataItemBase : public IDataItemCore {
174 public:
TimeChangeDataItemBase(int64_t currTimeMillis,int32_t rawOffset,int32_t dstOffset)175     TimeChangeDataItemBase(int64_t currTimeMillis, int32_t rawOffset, int32_t dstOffset) :
176         mCurrTimeMillis (currTimeMillis),
177         mRawOffsetTZ (rawOffset),
178         mDstOffsetTZ (dstOffset),
179         mId(TIME_CHANGE_DATA_ITEM_ID) {}
~TimeChangeDataItemBase()180     virtual ~TimeChangeDataItemBase() {}
getId()181     inline virtual DataItemId getId() { return mId; }
stringify(string &)182     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)183     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
184 // Data members
185     int64_t mCurrTimeMillis;
186     int32_t mRawOffsetTZ;
187     int32_t mDstOffsetTZ;
188 protected:
189     DataItemId mId;
190 };
191 
192 class ShutdownStateDataItemBase : public IDataItemCore {
193 public:
ShutdownStateDataItemBase(bool state)194     ShutdownStateDataItemBase(bool state) :
195         mState (state),
196         mId(SHUTDOWN_STATE_DATA_ITEM_ID) {}
~ShutdownStateDataItemBase()197     virtual ~ShutdownStateDataItemBase() {}
getId()198     inline virtual DataItemId getId() { return mId; }
stringify(string &)199     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)200     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
201 // Data members
202     bool mState;
203 protected:
204     DataItemId mId;
205 };
206 
207 class AssistedGpsDataItemBase : public IDataItemCore {
208 public:
AssistedGpsDataItemBase(bool enabled)209     AssistedGpsDataItemBase(bool enabled) :
210         mEnabled(enabled),
211         mId(ASSISTED_GPS_DATA_ITEM_ID) {}
~AssistedGpsDataItemBase()212     virtual ~AssistedGpsDataItemBase() {}
getId()213     inline virtual DataItemId getId() { return mId; }
stringify(string &)214     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)215     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
216 // Data members
217     bool mEnabled;
218 protected:
219     DataItemId mId;
220 };
221 
222 class NetworkInfoDataItemBase : public IDataItemCore {
223 public:
224     enum NetworkType {
225         TYPE_MOBILE,
226         TYPE_WIFI,
227         TYPE_ETHERNET,
228         TYPE_BLUETOOTH,
229         TYPE_MMS,
230         TYPE_SUPL,
231         TYPE_DUN,
232         TYPE_HIPRI,
233         TYPE_WIMAX,
234         TYPE_UNKNOWN,
235     };
NetworkInfoDataItemBase(NetworkType initialType,int32_t type,string typeName,string subTypeName,bool available,bool connected,bool roaming)236     NetworkInfoDataItemBase(
237     NetworkType initialType, int32_t type, string typeName, string subTypeName,
238     bool available, bool connected, bool roaming ):
239             mAllTypes(typeToAllTypes(initialType)),
240             mType(type),
241             mTypeName(typeName),
242             mSubTypeName(subTypeName),
243             mAvailable(available),
244             mConnected(connected),
245             mRoaming(roaming),
246             mId(NETWORKINFO_DATA_ITEM_ID) {}
~NetworkInfoDataItemBase()247     virtual ~NetworkInfoDataItemBase() {}
getId()248     inline virtual DataItemId getId() { return mId; }
stringify(string &)249     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)250     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
getType(void)251     inline virtual NetworkType getType(void) const {
252         return (NetworkType)mType;
253     }
getAllTypes()254     inline uint64_t getAllTypes() { return mAllTypes; }
255     // Data members
256     uint64_t mAllTypes;
257     int32_t mType;
258     string mTypeName;
259     string mSubTypeName;
260     bool mAvailable;
261     bool mConnected;
262     bool mRoaming;
263 protected:
264     DataItemId mId;
typeToAllTypes(NetworkType type)265     inline uint64_t typeToAllTypes(NetworkType type) {
266         return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ?  0 : (1<<type);
267     }
268 };
269 
270 class ServiceStatusDataItemBase : public IDataItemCore {
271 public:
ServiceStatusDataItemBase(int32_t serviceState)272     ServiceStatusDataItemBase(int32_t serviceState) :
273         mServiceState (serviceState),
274         mId(SERVICESTATUS_DATA_ITEM_ID) {}
~ServiceStatusDataItemBase()275     virtual ~ServiceStatusDataItemBase() {}
getId()276     inline virtual DataItemId getId() { return mId; }
stringify(string &)277     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)278     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
279 // Data members
280     int32_t mServiceState;
281 protected:
282     DataItemId mId;
283 };
284 
285 class ModelDataItemBase : public IDataItemCore {
286 public:
ModelDataItemBase(const string & name)287     ModelDataItemBase(const string & name) :
288         mModel (name),
289         mId(MODEL_DATA_ITEM_ID) {}
~ModelDataItemBase()290     virtual ~ModelDataItemBase() {}
getId()291     inline virtual DataItemId getId() { return mId; }
stringify(string &)292     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)293     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
294 // Data members
295     string mModel;
296 protected:
297     DataItemId mId;
298 };
299 
300 class ManufacturerDataItemBase : public IDataItemCore {
301 public:
ManufacturerDataItemBase(const string & name)302     ManufacturerDataItemBase(const string & name) :
303         mManufacturer (name),
304         mId(MANUFACTURER_DATA_ITEM_ID) {}
~ManufacturerDataItemBase()305     virtual ~ManufacturerDataItemBase() {}
getId()306     inline virtual DataItemId getId() { return mId; }
stringify(string &)307     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)308     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
309 // Data members
310     string mManufacturer;
311 protected:
312     DataItemId mId;
313 };
314 
315 class RilServiceInfoDataItemBase : public IDataItemCore {
316 public:
RilServiceInfoDataItemBase()317     inline RilServiceInfoDataItemBase() :
318             mData(nullptr), mId(RILSERVICEINFO_DATA_ITEM_ID) {}
~RilServiceInfoDataItemBase()319     inline virtual ~RilServiceInfoDataItemBase() { if (nullptr != mData) free(mData); }
getId()320     inline virtual DataItemId getId() { return mId; }
stringify(string &)321     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)322     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase & peer)323     inline RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase& peer) :
324             RilServiceInfoDataItemBase() {
325         peer.setPeerData(*this);
326     }
327     inline virtual bool operator==(const RilServiceInfoDataItemBase& other) const {
328         return other.mData == mData;
329     }
setPeerData(RilServiceInfoDataItemBase &)330     inline virtual void setPeerData(RilServiceInfoDataItemBase& /*peer*/) const {}
331     void* mData;
332 protected:
333     DataItemId mId;
334 };
335 
336 class RilCellInfoDataItemBase : public IDataItemCore {
337 public:
RilCellInfoDataItemBase()338     inline RilCellInfoDataItemBase() :
339             mData(nullptr), mId(RILCELLINFO_DATA_ITEM_ID) {}
~RilCellInfoDataItemBase()340     inline virtual ~RilCellInfoDataItemBase() { if (nullptr != mData) free(mData); }
getId()341     inline virtual DataItemId getId() { return mId; }
stringify(string &)342     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)343     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
RilCellInfoDataItemBase(const RilCellInfoDataItemBase & peer)344     inline RilCellInfoDataItemBase(const RilCellInfoDataItemBase& peer) :
345             RilCellInfoDataItemBase() {
346         peer.setPeerData(*this);
347     }
348     inline virtual bool operator==(const RilCellInfoDataItemBase& other) const {
349         return other.mData == mData;
350     }
setPeerData(RilCellInfoDataItemBase &)351     inline virtual void setPeerData(RilCellInfoDataItemBase& /*peer*/) const {}
352     void* mData;
353 protected:
354     DataItemId mId;
355 };
356 
357 class WifiSupplicantStatusDataItemBase : public IDataItemCore {
358 public:
WifiSupplicantStatusDataItemBase()359     WifiSupplicantStatusDataItemBase() :
360         mState((WifiSupplicantState)WIFI_SUPPLICANT_DEFAULT_STATE),
361         mApMacAddressValid(false),
362         mWifiApSsidValid(false),
363         mId(WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID) {
364             memset (&mApMacAddress, 0, sizeof (mApMacAddress));
365             mWifiApSsid.clear();
366         }
~WifiSupplicantStatusDataItemBase()367     virtual ~WifiSupplicantStatusDataItemBase() {}
getId()368     inline virtual DataItemId getId() { return mId; }
stringify(string &)369     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)370     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
371     // Data members
372     typedef enum WifiSupplicantState {
373         DISCONNECTED,
374         INTERFACE_DISABLED,
375         INACTIVE,
376         SCANNING,
377         AUTHENTICATING,
378         ASSOCIATING,
379         ASSOCIATED,
380         FOUR_WAY_HANDSHAKE,
381         GROUP_HANDSHAKE,
382         COMPLETED,
383         DORMANT,
384         UNINITIALIZED,
385         INVALID
386     } WifiSupplicantState;
387     /* Represents whether access point attach state*/
388     WifiSupplicantState mState;
389     /* Represents info on whether ap mac address is valid */
390     bool mApMacAddressValid;
391     /* Represents mac address of the wifi access point*/
392     uint8_t mApMacAddress[MAC_ADDRESS_LENGTH];
393     /* Represents info on whether ap SSID is valid */
394     bool mWifiApSsidValid;
395     /* Represents Wifi SSID string*/
396     string mWifiApSsid;
397 protected:
398     DataItemId mId;
399 };
400 
401 class TacDataItemBase : public IDataItemCore {
402 public:
TacDataItemBase(const string & name)403     TacDataItemBase(const string & name) :
404         mValue (name),
405         mId(TAC_DATA_ITEM_ID) {}
~TacDataItemBase()406     virtual ~TacDataItemBase() {}
getId()407     inline virtual DataItemId getId() { return mId; }
stringify(string &)408     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)409     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
410 // Data members
411     string mValue;
412 protected:
413     DataItemId mId;
414 };
415 
416 class MccmncDataItemBase : public IDataItemCore {
417 public:
MccmncDataItemBase(const string & name)418     MccmncDataItemBase(const string & name) :
419         mValue(name),
420         mId(MCCMNC_DATA_ITEM_ID) {}
~MccmncDataItemBase()421     virtual ~MccmncDataItemBase() {}
getId()422     inline virtual DataItemId getId() { return mId; }
stringify(string &)423     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)424     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
425 // Data members
426     string mValue;
427 protected:
428     DataItemId mId;
429 };
430 
431 class SrnDeviceScanDetailsDataItemBase : public IDataItemCore {
432 public:
SrnDeviceScanDetailsDataItemBase(DataItemId Id)433     SrnDeviceScanDetailsDataItemBase(DataItemId Id) :
434         mValidSrnData(false),
435         mApSrnRssi(-1),
436         mApSrnTimestamp(0),
437         mRequestTimestamp(0),
438         mReceiveTimestamp(0),
439         mErrorCause(-1),
440         mId(Id) {}
~SrnDeviceScanDetailsDataItemBase()441     virtual ~SrnDeviceScanDetailsDataItemBase() {}
getId()442     inline virtual DataItemId getId() { return mId; }
443     // Data members common to all SRN tech types
444     /* Represents info on whether SRN data is valid (no error)*/
445     bool mValidSrnData;
446     /* SRN device RSSI reported */
447     int32_t mApSrnRssi;
448     /* MAC adress of SRN device */
449     uint8_t mApSrnMacAddress[SRN_MAC_ADDRESS_LENGTH];
450     /* UTC timestamp at which the scan was requested.for this SRN device*/
451     int64_t mApSrnTimestamp;
452     /* UTC timestamp at which the scan was started. */
453     int64_t mRequestTimestamp;
454     /* UTC timestamp at which the scan was received.*/
455     int64_t mReceiveTimestamp;
456     /* Reason for the error/failure if SRN details are not valid */
457     int32_t mErrorCause;
458 protected:
459     DataItemId mId;
460 };
461 
462 class BtDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase {
463 
464 public:
BtDeviceScanDetailsDataItemBase()465     BtDeviceScanDetailsDataItemBase() :
466         SrnDeviceScanDetailsDataItemBase(BT_SCAN_DATA_ITEM_ID) {}
~BtDeviceScanDetailsDataItemBase()467     virtual ~BtDeviceScanDetailsDataItemBase() {}
stringify(string &)468     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)469     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
470 };
471 
472 class BtLeDeviceScanDetailsDataItemBase : public SrnDeviceScanDetailsDataItemBase {
473 
474 public:
BtLeDeviceScanDetailsDataItemBase()475     BtLeDeviceScanDetailsDataItemBase() :
476         SrnDeviceScanDetailsDataItemBase(BTLE_SCAN_DATA_ITEM_ID) {}
~BtLeDeviceScanDetailsDataItemBase()477     virtual ~BtLeDeviceScanDetailsDataItemBase() {}
stringify(string &)478     virtual void stringify(string& /*valueStr*/) {}
copy(IDataItemCore *,bool *)479     virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;}
480 };
481 
482 class BatteryLevelDataItemBase : public IDataItemCore {
483 public:
BatteryLevelDataItemBase(uint8_t batteryPct)484     inline BatteryLevelDataItemBase(uint8_t batteryPct) :
485             mBatteryPct(batteryPct), mId(BATTERY_LEVEL_DATA_ITEM_ID) {}
~BatteryLevelDataItemBase()486     inline ~BatteryLevelDataItemBase() {}
getId()487     inline virtual DataItemId getId() { return mId; }
488 // Data members
489     uint8_t mBatteryPct;
490 protected:
491     DataItemId mId;
492 };
493 
494 } // namespace loc_core
495 
496 #endif //__DATAITEMCONCRETEBASETYPES__
497