Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: shaque/Cascades-Community-Samples
base: 63c7f95b22
...
head fork: shaque/Cascades-Community-Samples
compare: adffd24156
  • 6 commits
  • 44 files changed
  • 0 commit comments
  • 1 contributor
Showing with 404 additions and 334 deletions.
  1. 0  InvokeClient/.gitignore
  2. +1 −1  InvokeClient/README.md
  3. +5 −0 InvokeClient/arm/.gitignore
  4. +1 −1  InvokeClient/arm/Makefile
  5. +1 −1  InvokeClient/arm/Makefile.Debug
  6. +1 −1  InvokeClient/arm/Makefile.Release
  7. +0 −108 InvokeClient/arm/o.le-v7-g/.moc/moc_app.cpp
  8. BIN  InvokeClient/arm/o.le-v7-g/InvokeClient
  9. BIN  InvokeClient/arm/o.le-v7-g/InvokeClient-1_0_0_1.bar
  10. BIN  InvokeClient/arm/o.le-v7-g/InvokeClient.bar
  11. +1 −1  InvokeClient/arm/o.le-v7/.moc/moc_app.cpp
  12. +5 −0 InvokeClient/x86/.gitignore
  13. +1 −1  InvokeClient/x86/Makefile
  14. +1 −1  InvokeClient/x86/Makefile.Debug
  15. +1 −1  InvokeClient/x86/Makefile.Release
  16. +1 −0  InvokeTarget1/.cproject
  17. +1 −0  InvokeTarget1/README.md
  18. +5 −0 InvokeTarget1/arm/.gitignore
  19. +1 −1  InvokeTarget1/arm/Makefile
  20. +1 −1  InvokeTarget1/arm/Makefile.Debug
  21. +1 −1  InvokeTarget1/arm/Makefile.Release
  22. +5 −0 InvokeTarget1/x86/.gitignore
  23. +1 −1  InvokeTarget1/x86/Makefile
  24. +1 −1  InvokeTarget1/x86/Makefile.Debug
  25. +1 −1  InvokeTarget1/x86/Makefile.Release
  26. +1 −0  InvokeTarget2/.cproject
  27. +1 −1  InvokeTarget2/README.md
  28. +5 −0 InvokeTarget2/arm/.gitignore
  29. +1 −1  InvokeTarget2/arm/Makefile
  30. +1 −1  InvokeTarget2/arm/Makefile.Debug
  31. +1 −1  InvokeTarget2/arm/Makefile.Release
  32. +5 −0 InvokeTarget2/x86/.gitignore
  33. +1 −1  InvokeTarget2/x86/Makefile
  34. +1 −1  InvokeTarget2/x86/Makefile.Debug
  35. +1 −1  InvokeTarget2/x86/Makefile.Release
  36. +0 −3  LocationDiagnostics/.gitignore
  37. +5 −0 LocationDiagnostics/arm/.gitignore
  38. +60 −16 LocationDiagnostics/src/LocationEngine.cpp
  39. +3 −0  LocationDiagnostics/src/LocationEngine.h
  40. +217 −0 LocationDiagnostics/src/RawLocationParser.cpp
  41. +60 −0 LocationDiagnostics/src/RawLocationParser.h
  42. +0 −130 LocationDiagnostics/src/ReplyParser.cpp
  43. +0 −56 LocationDiagnostics/src/ReplyParser.h
  44. +5 −0 LocationDiagnostics/x86/.gitignore
View
0  InvokeClient/.gitignore
No changes.
View
2  InvokeClient/README.md
@@ -1,6 +1,6 @@
# Invoke Client
-Demonstrates the Invocation Framework of BlackBerry 10. This app acts as a client that can invoke target apps registered with the Invocation Framework. Easiest way to take it for a spin is to also download Invoke Target sample application.
+Demonstrates the Invocation Framework of BlackBerry 10. This app acts as a client that can invoke target apps registered with the Invocation Framework. Easiest way to take it for a spin is to also download InvokeTarget1 and InvokeTarget2 samples.
**Feature Summary**
View
5 InvokeClient/arm/.gitignore
@@ -0,0 +1,5 @@
+/o.le-v7
+/o.le-v7-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
2  InvokeClient/arm/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7/InvokeClient
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:22 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Aug 13 11:13:52 2012
# Project: ../InvokeClient.pro
# Template: app
# Command: c:/bbndk/host_10_0_6_1/win32/x86/usr/bin/qmake -spec c:/bbndk/target_10_0_6_384/qnx6/usr/share/qt4/mkspecs/unsupported/blackberry-armv7le-g++ CONFIG+=device -o Makefile ../InvokeClient.pro
View
2  InvokeClient/arm/Makefile.Debug
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7-g/InvokeClient
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:22 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Aug 13 11:13:52 2012
# Project: ../InvokeClient.pro
# Template: app
#############################################################################
View
2  InvokeClient/arm/Makefile.Release
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7/InvokeClient
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:22 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Aug 13 11:13:52 2012
# Project: ../InvokeClient.pro
# Template: app
#############################################################################
View
108 InvokeClient/arm/o.le-v7-g/.moc/moc_app.cpp
@@ -1,108 +0,0 @@
-/****************************************************************************
-** Meta object code from reading C++ file 'app.hpp'
-**
-** Created: Mon Jul 23 17:01:43 2012
-** by: The Qt Meta Object Compiler version 63 (Qt 4.8.0)
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#include "../../../src/app.hpp"
-#if !defined(Q_MOC_OUTPUT_REVISION)
-#error "The header file 'app.hpp' doesn't include <QObject>."
-#elif Q_MOC_OUTPUT_REVISION != 63
-#error "This file was generated using the moc from 4.8.0. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
-#endif
-
-QT_BEGIN_MOC_NAMESPACE
-static const uint qt_meta_data_App[] = {
-
- // content:
- 6, // revision
- 0, // classname
- 0, 0, // classinfo
- 5, 14, // methods
- 0, 0, // properties
- 0, 0, // enums/sets
- 0, 0, // constructors
- 0, // flags
- 0, // signalCount
-
- // slots: signature, parameters, type, tag, flags
- 5, 4, 4, 4, 0x0a,
- 26, 4, 4, 4, 0x0a,
- 46, 4, 4, 4, 0x0a,
-
- // methods: signature, parameters, type, tag, flags
- 111, 72, 4, 4, 0x02,
- 190, 163, 4, 4, 0x02,
-
- 0 // eod
-};
-
-static const char qt_meta_stringdata_App[] = {
- "App\0\0processInvokeReply()\0processQueryReply()\0"
- "handleInvokeButtonClick()\0"
- "targetType,action,mime,uri,data,target\0"
- "invoke(int,QString,QString,QString,QString,QString)\0"
- "targetType,action,mime,uri\0"
- "query(int,QString,QString,QString)\0"
-};
-
-void App::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
-{
- if (_c == QMetaObject::InvokeMetaMethod) {
- Q_ASSERT(staticMetaObject.cast(_o));
- App *_t = static_cast<App *>(_o);
- switch (_id) {
- case 0: _t->processInvokeReply(); break;
- case 1: _t->processQueryReply(); break;
- case 2: _t->handleInvokeButtonClick(); break;
- case 3: _t->invoke((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< const QString(*)>(_a[3])),(*reinterpret_cast< const QString(*)>(_a[4])),(*reinterpret_cast< const QString(*)>(_a[5])),(*reinterpret_cast< const QString(*)>(_a[6]))); break;
- case 4: _t->query((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< const QString(*)>(_a[3])),(*reinterpret_cast< const QString(*)>(_a[4]))); break;
- default: ;
- }
- }
-}
-
-const QMetaObjectExtraData App::staticMetaObjectExtraData = {
- 0, qt_static_metacall
-};
-
-const QMetaObject App::staticMetaObject = {
- { &QObject::staticMetaObject, qt_meta_stringdata_App,
- qt_meta_data_App, &staticMetaObjectExtraData }
-};
-
-#ifdef Q_NO_DATA_RELOCATION
-const QMetaObject &App::getStaticMetaObject() { return staticMetaObject; }
-#endif //Q_NO_DATA_RELOCATION
-
-const QMetaObject *App::metaObject() const
-{
- return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
-}
-
-void *App::qt_metacast(const char *_clname)
-{
- if (!_clname) return 0;
- if (!strcmp(_clname, qt_meta_stringdata_App))
- return static_cast<void*>(const_cast< App*>(this));
- return QObject::qt_metacast(_clname);
-}
-
-int App::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
- _id = QObject::qt_metacall(_c, _id, _a);
- if (_id < 0)
- return _id;
- if (_c == QMetaObject::InvokeMetaMethod) {
- if (_id < 5)
- qt_static_metacall(this, _c, _id, _a);
- _id -= 5;
- }
- return _id;
-}
-QT_END_MOC_NAMESPACE
View
BIN  InvokeClient/arm/o.le-v7-g/InvokeClient
Binary file not shown
View
BIN  InvokeClient/arm/o.le-v7-g/InvokeClient-1_0_0_1.bar
Binary file not shown
View
BIN  InvokeClient/arm/o.le-v7-g/InvokeClient.bar
Binary file not shown
View
2  InvokeClient/arm/o.le-v7/.moc/moc_app.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
** Meta object code from reading C++ file 'app.hpp'
**
-** Created: Mon Jul 30 13:15:47 2012
+** Created: Mon Aug 13 11:14:10 2012
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.0)
**
** WARNING! All changes made in this file will be lost!
View
5 InvokeClient/x86/.gitignore
@@ -0,0 +1,5 @@
+/o
+/o-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
2  InvokeClient/x86/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o/InvokeClient
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:23 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Aug 13 11:13:52 2012
# Project: ../InvokeClient.pro
# Template: app
# Command: c:/bbndk/host_10_0_6_1/win32/x86/usr/bin/qmake -spec c:/bbndk/target_10_0_6_384/qnx6/usr/share/qt4/mkspecs/unsupported/blackberry-x86-g++ CONFIG+=simulator -o Makefile ../InvokeClient.pro
View
2  InvokeClient/x86/Makefile.Debug
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o-g/InvokeClient
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:23 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Aug 13 11:13:52 2012
# Project: ../InvokeClient.pro
# Template: app
#############################################################################
View
2  InvokeClient/x86/Makefile.Release
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o/InvokeClient
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:23 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Mon Aug 13 11:13:52 2012
# Project: ../InvokeClient.pro
# Template: app
#############################################################################
View
1  InvokeTarget1/.cproject
@@ -206,4 +206,5 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
</storageModule>
+ <storageModule moduleId="refreshScope"/>
</cproject>
View
1  InvokeTarget1/README.md
@@ -1,6 +1,7 @@
# Invoke Target 1
Demonstrates the Invocation Framework of BlackBerry 10. This app acts as a Target that can be invoked by InvokeClient.
+NOTE: There is another sample called InvokeTarget2 which is identical to this. If both targets are installed on the device, InvokeClient is able to demo the UX when there are two targets for a target filter.
**Feature Summary**
View
5 InvokeTarget1/arm/.gitignore
@@ -0,0 +1,5 @@
+/o.le-v7
+/o.le-v7-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
2  InvokeTarget1/arm/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7/InvokeTarget1
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:36 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:34:37 2012
# Project: ../InvokeTarget1.pro
# Template: app
# Command: c:/bbndk/host_10_0_6_1/win32/x86/usr/bin/qmake -spec c:/bbndk/target_10_0_6_384/qnx6/usr/share/qt4/mkspecs/unsupported/blackberry-armv7le-g++ CONFIG+=device -o Makefile ../InvokeTarget1.pro
View
2  InvokeTarget1/arm/Makefile.Debug
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7-g/InvokeTarget1
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:36 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:34:37 2012
# Project: ../InvokeTarget1.pro
# Template: app
#############################################################################
View
2  InvokeTarget1/arm/Makefile.Release
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7/InvokeTarget1
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:36 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:34:37 2012
# Project: ../InvokeTarget1.pro
# Template: app
#############################################################################
View
5 InvokeTarget1/x86/.gitignore
@@ -0,0 +1,5 @@
+/o
+/o-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
2  InvokeTarget1/x86/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o/InvokeTarget1
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:37 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:34:37 2012
# Project: ../InvokeTarget1.pro
# Template: app
# Command: c:/bbndk/host_10_0_6_1/win32/x86/usr/bin/qmake -spec c:/bbndk/target_10_0_6_384/qnx6/usr/share/qt4/mkspecs/unsupported/blackberry-x86-g++ CONFIG+=simulator -o Makefile ../InvokeTarget1.pro
View
2  InvokeTarget1/x86/Makefile.Debug
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o-g/InvokeTarget1
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:37 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:34:37 2012
# Project: ../InvokeTarget1.pro
# Template: app
#############################################################################
View
2  InvokeTarget1/x86/Makefile.Release
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o/InvokeTarget1
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:42:37 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:34:37 2012
# Project: ../InvokeTarget1.pro
# Template: app
#############################################################################
View
1  InvokeTarget2/.cproject
@@ -206,4 +206,5 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
</storageModule>
+ <storageModule moduleId="refreshScope"/>
</cproject>
View
2  InvokeTarget2/README.md
@@ -1,7 +1,7 @@
# Invoke Target 2
Demonstrates the Invocation Framework of BlackBerry 10. This app acts as a Target that can be invoked by InvokeClient.
-
+NOTE: There is another sample called InvokeTarget1 which is identical to this. If both targets are installed on the device, InvokeClient is able to demo the UX when there are two targets for a target filter.
**Feature Summary**
- Displays launch type
View
5 InvokeTarget2/arm/.gitignore
@@ -0,0 +1,5 @@
+/o.le-v7
+/o.le-v7-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
2  InvokeTarget2/arm/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7/InvokeTarget2
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:43:12 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:35:59 2012
# Project: ../InvokeTarget2.pro
# Template: app
# Command: c:/bbndk/host_10_0_6_1/win32/x86/usr/bin/qmake -spec c:/bbndk/target_10_0_6_384/qnx6/usr/share/qt4/mkspecs/unsupported/blackberry-armv7le-g++ CONFIG+=device -o Makefile ../InvokeTarget2.pro
View
2  InvokeTarget2/arm/Makefile.Debug
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7-g/InvokeTarget2
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:43:12 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:35:59 2012
# Project: ../InvokeTarget2.pro
# Template: app
#############################################################################
View
2  InvokeTarget2/arm/Makefile.Release
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o.le-v7/InvokeTarget2
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:43:12 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:35:59 2012
# Project: ../InvokeTarget2.pro
# Template: app
#############################################################################
View
5 InvokeTarget2/x86/.gitignore
@@ -0,0 +1,5 @@
+/o
+/o-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
2  InvokeTarget2/x86/Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o/InvokeTarget2
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:43:13 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:36:00 2012
# Project: ../InvokeTarget2.pro
# Template: app
# Command: c:/bbndk/host_10_0_6_1/win32/x86/usr/bin/qmake -spec c:/bbndk/target_10_0_6_384/qnx6/usr/share/qt4/mkspecs/unsupported/blackberry-x86-g++ CONFIG+=simulator -o Makefile ../InvokeTarget2.pro
View
2  InvokeTarget2/x86/Makefile.Debug
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o-g/InvokeTarget2
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:43:13 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:36:00 2012
# Project: ../InvokeTarget2.pro
# Template: app
#############################################################################
View
2  InvokeTarget2/x86/Makefile.Release
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: o/InvokeTarget2
-# Generated by qmake (2.01a) (Qt 4.8.0) on: Fri Aug 3 18:43:13 2012
+# Generated by qmake (2.01a) (Qt 4.8.0) on: Wed Aug 8 10:36:00 2012
# Project: ../InvokeTarget2.pro
# Template: app
#############################################################################
View
3  LocationDiagnostics/.gitignore
@@ -1,3 +0,0 @@
-/.settings
-/arm
-/x86
View
5 LocationDiagnostics/arm/.gitignore
@@ -0,0 +1,5 @@
+/o.le-v7
+/o.le-v7-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release
View
76 LocationDiagnostics/src/LocationEngine.cpp
@@ -87,11 +87,7 @@ void LocationEngine::positionUpdated(const QGeoPositionInfo& pos) {
_locationPage->findChild<QObject*>("qllVerticalAccuracy")->setProperty("text", pos.attribute(QGeoPositionInfo::VerticalAccuracy));
_locationPage->findChild<QObject*>("qllMagneticVariation")->setProperty("text", pos.attribute(QGeoPositionInfo::MagneticVariation));
- logQString("update");
- QVariant replayData = _positionSource->property("replayDat");
-
-
-
+ parseRawData();
}
QGeoPositionInfoSource* LocationEngine::positionSource() {
@@ -106,14 +102,6 @@ void LocationEngine::satellitesInUseUpdated(const QList<QGeoSatelliteInfo>& sate
logQString("satellitesInUseUpdated received.");
}
-bool LocationEngine::isSoundEnabled() {
- return soundEnabled;
-}
-
-void LocationEngine::setSoundEnabled(bool enabled) {
- soundEnabled = enabled;
-}
-
void LocationEngine::satellitesInViewUpdated(const QList<QGeoSatelliteInfo>& satellites) {
logQString("satellitesInViewUpdated received.");
}
@@ -131,9 +119,65 @@ void LocationEngine::resetEngine(QString type) {
logQString(type + " RESET.");
}
+bool LocationEngine::isSoundEnabled() {
+ return soundEnabled;
+}
+
+void LocationEngine::setSoundEnabled(bool enabled) {
+ soundEnabled = enabled;
+}
+
+void LocationEngine::parseRawData() {
+ // Parsing the raw data from the low level Location Manager. Use this only if a field is not accessible via QGeoPositionInfo above.
+ QVariant replyData = _positionSource->property("replyDat");
+ if(!replyData.isValid()){
+ logQString("!!! Invalid replyDat.");
+ //return;
+ }
+
+ RawLocationParser parser(replyData);
+
+ double latitude = parser.latitude();
+ double longitude = parser.longitude();
+ double altitude = parser.altitude();
+ double hAccuracy = parser.horizontalAccuracy();
+ double vAccuracy = parser.verticalAccuracy();
+ double heading = parser.heading();
+ double speed = parser.speed();
+ double ttff = parser.ttff();
+ double gpsWeek = parser.gpsWeek();
+ double gpsTow = parser.gpsTow();
+ double utc = parser.utc();
+ double hdop = parser.hdop();
+ double vdop = parser.vdop();
+ double pdop = parser.pdop();
+ bool propagated = parser.propagated();
+
+ QString method = parser.positionMethod();
+ _locationPage->findChild<QObject*>("qllMethod")->setProperty("text", method);
+
+ logQString("Method: " + method + ", Latitude: " + QString().setNum(latitude) + ", Longitude: " + QString().setNum(longitude) + ", Altitude: " + QString().setNum(altitude) + ", Horizontal Accuracy: " + QString().setNum(hAccuracy) + ", Vertical Accuracy: " + QString().setNum(vAccuracy) + ", Heading: " + QString().setNum(heading) + ", Speed: " + QString().setNum(speed) + ", TTFF: " + QString().setNum(ttff) + ", GPS Week: " + QString().setNum(gpsWeek) + ", GPS TOW: " + QString().setNum(gpsTow) + ", UTC: " + QString().setNum(utc) + ", Horizontal Dilution: " + QString().setNum(hdop) + ", Vertical Dilution: " + QString().setNum(vdop) + ", Positional Dilution: " + QString().setNum(pdop) + ", Propagated: " + QString().setNum(propagated));
+ QString error = parser.error();
+ if(error.length()>3){
+ logQString("!!! [Error] " + error);
+ }
+
+ for (int i = 0; i < parser.numberOfSatellites(); i++) {
+ double id = parser.satelliteId(i);
+ double cno = parser.satelliteCarrierToNoiseRatio(i);
+ bool ephemerisAvailable = parser.satelliteEphemerisAvailable(i);
+ double azimuth = parser.satelliteAzimuth(i);
+ double elevation = parser.satelliteElevation(i);
+ bool tracked = parser.satelliteTracked(i);
+ bool used = parser.satelliteUsed(i);
+ logQString("\t[Satellite " + QString().setNum(i) + "]" + ", ID: " + QString().setNum(id) + ", CNO: " + QString().setNum(cno) + ", Ephemeris Available: " + ephemerisAvailable + ", Azimuth: " + QString().setNum(azimuth) + ", Elevation: " + QString().setNum(elevation) + ", Tracked: " + tracked + ", Used: " + used);
+ }
+}
+
void LocationEngine::logQString(QString msg) {
- QString text = _locationPage->findChild<QObject*>("logs")->property("text").toString();
- _locationPage->findChild<QObject*>("logs")->setProperty("text", text + "\n" + msg);
- cout << "Location Diagnostics: " << msg.toLocal8Bit().constData() << endl;
+ //QString text = _locationPage->findChild<QObject*>("logs")->property("text").toString();
+ //_locationPage->findChild<QObject*>("logs")->setProperty("text", text + "\n" + msg);
+
+ cout << "Location Diagnostics: "<< msg.toLocal8Bit().constData() << endl;
}
View
3  LocationDiagnostics/src/LocationEngine.h
@@ -31,6 +31,8 @@
#include <bb/multimedia/MediaPlayer.hpp>
#include <stdio.h>
+#include<RawLocationParser.h>
+
using namespace std;
using namespace QtMobilitySubset;
using namespace bb::cascades;
@@ -67,6 +69,7 @@ public Q_SLOTS:
void printField( QString & key, QVariant & value );
void dumpRawPositionData( QString & label, QVariantMap & rawDat );
void logQString(QString msg);
+ void parseRawData();
};
#endif /* LOCATIONENGINE_H_ */
View
217 LocationDiagnostics/src/RawLocationParser.cpp
@@ -0,0 +1,217 @@
+/*
+ * RawLocationParser.cpp
+ *
+ * Created on: Jul 18, 2012
+ * Author: shaque
+ */
+
+#include "RawLocationParser.h"
+
+RawLocationParser::RawLocationParser(const QVariant & replyData) :
+ _replyData(replyData) {
+
+}
+
+double RawLocationParser::latitude() {
+ return parseDouble(_replyData, "latitude");
+}
+
+double RawLocationParser::longitude() {
+ return parseDouble(_replyData, "longitude");
+}
+
+double RawLocationParser::altitude() {
+ return parseDouble(_replyData, "altitude");
+}
+
+double RawLocationParser::horizontalAccuracy() {
+ return parseDouble(_replyData, "accuracy");
+}
+
+double RawLocationParser::verticalAccuracy() {
+ return parseDouble(_replyData, "altitudeAccuracy");
+}
+
+double RawLocationParser::heading() {
+ return parseDouble(_replyData, "heading");
+}
+
+double RawLocationParser::speed() {
+ return parseDouble(_replyData, "speed");
+}
+
+double RawLocationParser::ttff() {
+ return parseDouble(_replyData, "ttff");
+}
+
+double RawLocationParser::gpsWeek() {
+ return parseDouble(_replyData, "gpsWeek");
+}
+
+double RawLocationParser::gpsTow() {
+ return parseDouble(_replyData, "gpsTow");
+}
+
+double RawLocationParser::utc() {
+ return parseDouble(_replyData, "utc");
+}
+
+double RawLocationParser::hdop() {
+ return parseDouble(_replyData, "hdop");
+}
+
+double RawLocationParser::vdop() {
+ return parseDouble(_replyData, "vdop");
+}
+
+double RawLocationParser::pdop() {
+ return parseDouble(_replyData, "pdop");
+}
+
+bool RawLocationParser::propagated() {
+ return parseBool(_replyData, "propagated");
+}
+
+QString RawLocationParser::positionMethod() {
+ QString fixType = parseString(_replyData, "fix_type");
+ QString provider = parseString(_replyData, "provider");
+ return fixType + " [" + provider + "]";
+}
+
+QString RawLocationParser::error() {
+ QString err = parseString(_replyData, "err");
+ QString errstr = parseString(_replyData, "errstr");
+ return err + ": " + errstr;
+}
+
+int RawLocationParser::numberOfSatellites() {
+ QVariantList satellites;
+ bool sizeFound = parseList(&satellites, _replyData, "satellites");
+ if (sizeFound == false) {
+ return 0;
+ }
+
+ return satellites.size();
+}
+
+double RawLocationParser::satelliteId(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return qQNaN();
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseDouble(sat, "id");
+}
+
+double RawLocationParser::satelliteCarrierToNoiseRatio(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return qQNaN();
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseDouble(sat, "cno");
+}
+
+bool RawLocationParser::satelliteEphemerisAvailable(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return false;
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseBool(sat, "ephemeris");
+}
+
+double RawLocationParser::satelliteAzimuth(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return qQNaN();
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseDouble(sat, "azimuth");
+}
+
+double RawLocationParser::satelliteElevation(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return qQNaN();
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseDouble(sat, "elevation");
+}
+
+bool RawLocationParser::satelliteTracked(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return false;
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseBool(sat, "tracked");
+}
+
+bool RawLocationParser::satelliteUsed(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return false;
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseBool(sat, "used");
+}
+
+bool RawLocationParser::satelliteAlmanac(int satIndex) {
+ QVariantList satellites;
+ if (parseList(&satellites, _replyData, "satellites") == false) {
+ return false;
+ }
+ QVariant sat = satellites.at(satIndex);
+ return parseBool(sat, "almanac");
+}
+
+double RawLocationParser::parseDouble(const QVariant & replyData, const QString & key) {
+ // replyData is a QVariantMap holding all of the reply parameters
+ QVariantMap positionData = replyData.toMap();
+
+ QVariant val = positionData.value(key);
+ if (val.isValid() && val.canConvert<double>()) {
+ return val.toDouble();
+ }
+
+ return qQNaN();
+}
+
+bool RawLocationParser::parseBool(const QVariant & replyData, const QString & key) {
+ // replyData is a QVariantMap holding all of the reply parameters
+ QVariantMap positionData = replyData.toMap();
+
+ QVariant val = positionData.value(key);
+ if (val.isValid() && val.canConvert<bool>()) {
+ return val.toBool();
+ }
+
+ return false;
+}
+
+QString RawLocationParser::parseString(const QVariant & replyData, const QString & key) {
+ // replyData is a QVariantMap holding all of the reply parameters
+ QVariantMap positionData = replyData.toMap();
+
+ QVariant val = positionData.value(key);
+ if (val.isValid() && val.canConvert<QString>()) {
+ return val.toString();
+ }
+
+ return "";
+}
+
+bool RawLocationParser::parseList(QVariantList *out, const QVariant & replyData, const QString & key) {
+ // replyData is a QVariantMap holding all of the reply parameters
+ QVariantMap positionData = replyData.toMap();
+
+ QVariant val = positionData.value(key);
+ if (val.isValid() && val.canConvert<QVariantList>()) {
+ *out = val.toList();
+ return true;
+ }
+
+ return false;
+}
+
View
60 LocationDiagnostics/src/RawLocationParser.h
@@ -0,0 +1,60 @@
+/*
+ * RawLocationParser.h
+ *
+ * Created on: Jul 18, 2012
+ * Author: shaque
+ */
+
+#ifndef RAWLOCATIONPARSER_H_
+#define RAWLOCATIONPARSER_H_
+
+#include <QtCore/QObject>
+#include <QtCore/qvariant.h>
+#include <qnumeric.h>
+
+/**
+ * A utility class to parse the raw reply from the lower level Location Manager of the OS.
+ */
+class RawLocationParser: public QObject {
+Q_OBJECT
+
+public:
+ RawLocationParser(const QVariant & replyData);
+ double latitude();
+ double longitude();
+ double altitude();
+ double horizontalAccuracy();
+ double verticalAccuracy();
+ double heading();
+ double speed();
+ double ttff();
+ double gpsWeek();
+ double gpsTow();
+ double utc();
+ double hdop();
+ double vdop();
+ double pdop();
+ bool propagated();
+ QString positionMethod();
+ QString error();
+
+ int numberOfSatellites();
+ double satelliteId(int satIndex);
+ double satelliteCarrierToNoiseRatio(int satIndex);
+ bool satelliteEphemerisAvailable(int satIndex);
+ double satelliteAzimuth(int satIndex);
+ double satelliteElevation(int satIndex);
+ bool satelliteTracked(int satIndex);
+ bool satelliteUsed(int satIndex);
+ bool satelliteAlmanac(int satIndex);
+
+private:
+ const QVariant & _replyData;
+ double parseDouble(const QVariant & replyData, const QString & key);
+ bool parseBool(const QVariant & replyData, const QString & key);
+ QString parseString(const QVariant & replyData, const QString & key);
+ bool parseList(QVariantList *out, const QVariant & replyData, const QString & key);
+
+};
+
+#endif /* RAWLOCATIONPARSER_H_ */
View
130 LocationDiagnostics/src/ReplyParser.cpp
@@ -1,130 +0,0 @@
-/*
- * ReplyParser.cpp
- *
- * Created on: Jul 18, 2012
- * Author: shaque
- */
-
-#include "ReplyParser.h"
-
-ReplyParser::ReplyParser(const QVariant & replyData) :
- _replyData(replyData), _satIndex(0) {
-}
-;
-
-bool ReplyParser::latitude(double *lat) {
- return parseDouble(lat, _replyData, "latitude");
-}
-
-bool ReplyParser::longitude(double *lon) {
- return parseDouble(lon, _replyData, "longitude");
-}
-
-bool ReplyParser::altitude(double *alt) {
- return parseDouble(alt, _replyData, "altitude");
-}
-
-bool ReplyParser::horizontalAccuracy(double *acc) {
- return parseDouble(acc, _replyData, "accuracy");
-}
-
-bool ReplyParser::verticalAccuracy(double *acc) {
- return parseDouble(acc, _replyData, "altitudeAccuracy");
-}
-
-bool ReplyParser::heading(double *heading) {
- return parseDouble(heading, _replyData, "heading");
-}
-
-bool ReplyParser::speed(double *speed) {
- return parseDouble(speed, _replyData, "speed");
-}
-
-bool ReplyParser::satellitesSize(int *size) {
- QVariantList satellites;
- bool sizeFound = parseList(&satellites, _replyData, "satellites");
- if (sizeFound == false) {
- return false;
- }
-
- *size = satellites.size();
- return true;
-}
-
-
-bool ReplyParser::satelliteId(double *id) {
- QVariantList satellites;
- if (parseList(&satellites, _replyData, "satellites") == false) {
- return false;
- }
- QVariant sat = satellites.at(_satIndex);
- return parseDouble(id, sat, "id");
-}
-
-bool ReplyParser::satelliteCarrierToNoiseRatio(double *cno) {
- QVariantList satellites;
- if (parseList(&satellites, _replyData, "satellites") == false) {
- return false;
- }
- QVariant sat = satellites.at(_satIndex);
- return parseDouble(cno, sat, "cno");
-}
-
-bool ReplyParser::parseDouble(double *out, const QVariant & replyData,
- const QString & key) {
- // replyData is a QVariantMap holding all of the reply parameters
- QVariantMap positionData = replyData.toMap();
-
- QVariant val = positionData.value(key);
- if (val.isValid() && val.canConvert<double>()) {
- *out = val.toDouble();
- return true;
- }
-
- return false;
-}
-
-bool ReplyParser::parseBool(bool *out, const QVariant & replyData,
- const QString & key) {
- // replyData is a QVariantMap holding all of the reply parameters
- QVariantMap positionData = replyData.toMap();
-
- QVariant val = positionData.value(key);
- if (val.isValid() && val.canConvert<bool>()) {
- *out = val.toBool();
- return true;
- }
-
- return false;
-}
-
-bool ReplyParser::parseString(QString *out, const QVariant & replyData,
- const QString & key) {
- // replyData is a QVariantMap holding all of the reply parameters
- QVariantMap positionData = replyData.toMap();
-
- QVariant val = positionData.value(key);
- if (val.isValid() && val.canConvert<QString>()) {
- *out = val.toString();
- return true;
- }
-
- return false;
-}
-
-bool ReplyParser::parseList(QVariantList *out, const QVariant & replyData,
- const QString & key) {
- // replyData is a QVariantMap holding all of the reply parameters
- QVariantMap positionData = replyData.toMap();
-
- QVariant val = positionData.value(key);
- if (val.isValid() && val.canConvert<QVariantList>()) {
- *out = val.toList();
- return true;
- }
-
- return false;
-}
-
-
-
View
56 LocationDiagnostics/src/ReplyParser.h
@@ -1,56 +0,0 @@
-/*
- * ReplyParser.h
- *
- * Created on: Jul 18, 2012
- * Author: shaque
- */
-
-#ifndef REPLYPARSER_H_
-#define REPLYPARSER_H_
-
-#include <QtCore/QObject>
-#include <QtCore/qvariant.h>
-
-/**
- * A utility class to parse the raw reply from the lower level Location Manager of the OS.
- */
-class ReplyParser: public QObject {
-Q_OBJECT
-
-public:
- ReplyParser(const QVariant & replyData);
- bool latitude(double *lat);
- bool longitude(double *lon);
- bool altitude(double *alt);
- bool horizontalAccuracy(double *acc);
- bool verticalAccuracy(double *acc);
- bool heading(double *heading);
- bool speed(double *speed);
- bool ttff(double *ttff);
- bool gpsWeek(double *gpsWeek);
- bool gpsTow(double *gpsTow);
- bool utc(double *utc);
- bool hdop(double *hdop);
- bool propagated(bool *propagated);
-
- bool satellitesSize(int *size);
-
- bool satelliteId(double *id);
- bool satelliteCarrierToNoiseRatio(double *cno);
- bool satelliteEphemeris(bool *ephemeris);
- bool satelliteAzimuth(double *azimuth);
- bool satelliteElevation(double *elevation);
- bool satelliteTracked(bool *tracked);
- bool satelliteUsed(bool *used);
-
-private:
- const QVariant & _replyData;
- int _satIndex;
- bool parseDouble(double *out, const QVariant & replyData, const QString & key);
- bool parseBool(bool *out, const QVariant & replyData, const QString & key);
- bool parseString(QString *out, const QVariant & replyData, const QString & key);
- bool parseList(QVariantList *out, const QVariant & replyData, const QString & key);
-
-};
-
-#endif /* REPLYPARSER_H_ */
View
5 LocationDiagnostics/x86/.gitignore
@@ -0,0 +1,5 @@
+/o
+/o-g
+/Makefile
+/Makefile.Debug
+/Makefile.Release

No commit comments for this range

Something went wrong with that request. Please try again.