Merge lp:~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package into lp:platform-api

Proposed by Thomas Voß
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 90
Merged at revision: 86
Proposed branch: lp:~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package
Merge into: lp:platform-api
Prerequisite: lp:~thomas-voss/platform-api/add-package-config
Diff against target: 1938 lines (+646/-518)
21 files modified
CMakeLists.txt (+1/-1)
android/hybris/ubuntu_application_gps_for_hybris.cpp (+50/-50)
debian/changelog (+6/-0)
debian/control (+1/-0)
debian/libplatform-api1-dev.install (+1/-0)
debian/libplatform-api1-hybris.install (+1/-0)
debian/libplatform-api1-hybris.symbols (+11/-17)
debian/rules (+1/-0)
doc/Doxyfile.in (+2/-2)
include/ubuntu/application/CMakeLists.txt (+1/-2)
include/ubuntu/application/sensors/light.h (+1/-1)
include/ubuntu/hardware/gps.h (+226/-174)
src/hybris/CMakeLists.txt (+26/-7)
src/hybris/bridge.h (+202/-0)
src/hybris/hybris_bridge.cpp (+0/-59)
src/hybris/hybris_bridge.h (+0/-148)
src/hybris/tests/CMakeLists.txt (+1/-1)
src/hybris/tests/test_gps_api.cpp (+35/-32)
src/hybris/ubuntu_application_api_hybris.cpp (+1/-23)
src/hybris/ubuntu_application_sensors_hybris.cpp (+1/-1)
src/hybris/ubuntu_platform_hardware_api.cpp (+78/-0)
To merge this branch: bzr merge lp:~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
PS Jenkins bot continuous-integration Approve
Didier Roche-Tolomelli Approve
Ricardo Mendoza (community) Approve
Review via email: mp+169458@code.launchpad.net

This proposal supersedes a proposal from 2013-06-14.

Commit message

* Adjust message signatures.
 * Fix android implementation to account for new structure.
 * Refactored bridge and implementation macros into its own header file.
 * Split out hardware-specifics into its own implementation file.
 * Introduce a subdirectory for the hardware abstraction layer.
 * Adjust doxygen to optimize for C output.

Description of the change

 * Adjust message signatures.
 * Fix android implementation to account for new structure.
 * Refactored bridge and implementation macros into its own header file.
 * Split out hardware-specifics into its own implementation file.
 * Introduce a subdirectory for the hardware abstraction layer.
 * Adjust doxygen to optimize for C output.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:72
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package/+merge/169458/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/platform-api-ci/39/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-amd64-ci/9/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-armhf-ci/9/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-i386-ci/9/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/platform-api-ci/39/rebuild

review: Needs Fixing (continuous-integration)
73. By Thomas Voß

[ Gerry Boland ]
* Add mir suport.
[ Robert Carr ]
* Add mir suport.
[ Ubuntu daily release ]
* Automatic snapshot from revision 69
[ Ricardo Mendoza ]
* Allow remote App Manager to take care of signalling processes.
[ Ubuntu daily release ]
* Automatic snapshot from revision 67

74. By Thomas Voß

Revert accidently changed option for building with hybris.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:74
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package/+merge/169458/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/platform-api-ci/47/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-amd64-ci/17/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-armhf-ci/17/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-i386-ci/17/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/platform-api-ci/47/rebuild

review: Needs Fixing (continuous-integration)
75. By Thomas Voß

 * Remove installation directive for obsolete ubuntu_application_gps.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:75
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package/+merge/169458/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/platform-api-ci/49/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-amd64-ci/19/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-armhf-ci/19/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/platform-api-saucy-i386-ci/19/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/platform-api-ci/49/rebuild

review: Needs Fixing (continuous-integration)
76. By Thomas Voß

Make sure the hardware api is picked up by the debian package.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Mendoza (ricmm) wrote :

1028 +++ src/hybris/bridge.h 2013-06-23 07:06:27 +0000

^ Missing copyright header.

Otherwise LGTM, builds and works as expected.

review: Needs Fixing
77. By Thomas Voß

Add missing copyright header.

Revision history for this message
Ricardo Mendoza (ricmm) wrote :

DONE

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

dpkg-gensymbols: warning: debian/libplatform-api1-hybris/DEBIAN/symbols doesn't match completely debian/libplatform-api1-hybris.symbols
--- debian/libplatform-api1-hybris.symbols (libplatform-api1-hybris_0.18.1daily13.06.25-0ubuntu1_amd64)
+++ dpkg-gensymbolsgDxpna 2013-06-25 19:19:39.687312411 +0000
@@ -1,105 +1,95 @@
-libubuntu_application_api.so.1 libplatform-api1-hybris #MINVER#

Please update the symbols file.

289 === modified file 'debian/libplatform-api1-dev.install'
290 --- debian/libplatform-api1-dev.install 2013-06-25 19:14:28 +0000
291 +++ debian/libplatform-api1-dev.install 2013-06-25 19:14:28 +0000
292 @@ -1,2 +1,3 @@
293 -usr/lib/*/libubuntu_application_api.so
294 +usr/lib/*/libubuntu_application_api.so*
295 +usr/lib/*/libubuntu_platform_hardware_api.so*

Only ".so" should be part of libplatform-api1-dev.install. Please include the ".so.*" ones in libplatform-api1-hybris.install.

review: Needs Fixing
78. By Thomas Voß

 * Adjust installation of so's.

79. By Thomas Voß

[ Didier Roche ]
* minor cosmetic cleanups as we detect the archs we can't build for in
  daily release now.
[ Ubuntu daily release ]
* Automatic snapshot from revision 77
[ Ricardo Mendoza ]
* GCC 4.8 introduces a change for ARM AAPCS calling conventions, this
  breaks ABI for us because the Android library is built with GCC 4.7.
  Revert to building platform-api with GCC 4.7 until we can update the
  Android build. .
[ Ubuntu daily release ]
* Automatic snapshot from revision 75
[ Robert Carr ]
* Add missing mir stub (ua_ui_session_properties_set_remote_pid).
[ Ubuntu daily release ]
* Automatic snapshot from revision 73
[ Ubuntu daily release ]
* debian/*symbols: auto-update new symbols to released version
[ Didier Roche ]
* Add a symbol files with unmangled C++ symbols to track ABI.
[ Dmitrijs Ledkovs ]
* Add a symbol files with unmangled C++ symbols to track ABI.
[ Ubuntu daily release ]
* Automatic snapshot from revision 71

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Please merge trunk again.

Also, the symbol file is still not updated, check https://jenkins.qa.ubuntu.com/job/platform-api-saucy-i386-ci/27/consoleFull

review: Needs Fixing
80. By Thomas Voß

* Split out hal to ease integration of location service.
[ Ricardo Mendoza ]
* Stop the app manager from suspending the shell if there is no valid
  active main stage application running. (LP: #1196696)
[ Ubuntu daily release ]
* Automatic snapshot from revision 81
[ Ricardo Mendoza ]
* Add guards for NULL sensors.
[ Ubuntu daily release ]
* Automatic snapshot from revision 79

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
81. By Thomas Voß

 * Updated the symbols file.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
82. By Thomas Voß

Adjust symbol versions to account for daily release.

83. By Thomas Voß

[ Thomas Voß ]
* * Adjust the cmake setup and get rid of -DUSE_GLES, instead rely on
  automatic detection if the header is available. * Adjust the cmake
  setup to bail out if EGL is not available. * Adjust the cmake setup
  to autogenerate doxygen API documentation.
* * Add a pkgconfig file for the platform API * Adjust installation of
  header files to account for version.
[ Ubuntu daily release ]
* Automatic snapshot from revision 84

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
84. By Thomas Voß

 * Demangled a C++ symbol.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
85. By Thomas Voß

Split out hal to ease integration of location service.

86. By Thomas Voß

Add missing build dependency.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
87. By Thomas Voß

 * Adjust changelog and note down deps that are broken.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I didn't check the version that you Breaks: but on the principle, this looks good :)

Nitpick:
+ gcc-4.7,
You used a tab instead of spaces! :)

review: Approve
88. By Thomas Voß

Fix indentation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
89. By Thomas Voß

Only include symlinks.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
90. By Thomas Voß

Remove Breaks: again.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Good, don't need breaks as it's only changing gps related symbols, which is not yet used by anyone.

Ideally such intrusive change would also bump the so version, but this is fine for now :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-07-03 07:23:59 +0000
3+++ CMakeLists.txt 2013-07-05 16:24:25 +0000
4@@ -80,7 +80,7 @@
5 )
6
7 if(NOT Hybris)
8- message("Notice: libhybris-common.so not found, disabling hybris support")
9+ message(STATUS "Notice: libhybris-common.so not found, disabling hybris support")
10 set(ENABLE_HYBRIS_IMPLEMENTATION OFF)
11 endif()
12
13
14=== modified file 'android/hybris/ubuntu_application_gps_for_hybris.cpp'
15--- android/hybris/ubuntu_application_gps_for_hybris.cpp 2013-02-05 07:46:29 +0000
16+++ android/hybris/ubuntu_application_gps_for_hybris.cpp 2013-07-05 16:24:25 +0000
17@@ -15,7 +15,7 @@
18 *
19 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
20 */
21-#include <ubuntu/application/ubuntu_application_gps.h>
22+#include <ubuntu/hardware/gps.h>
23
24 #include <pthread.h>
25
26@@ -23,12 +23,12 @@
27 #include <hardware/gps.h>
28 #include <hardware_legacy/power.h>
29
30-#define WAKE_LOCK_NAME "UBUNTU_GPS"
31+#define WAKE_LOCK_NAME "U_HARDWARE_GPS"
32
33-struct UbuntuGps_
34+struct UHardwareGps_
35 {
36- UbuntuGps_(UbuntuGpsParams* params);
37- ~UbuntuGps_();
38+ UHardwareGps_(UHardwareGpsParams* params);
39+ ~UHardwareGps_();
40
41 bool init();
42
43@@ -48,28 +48,28 @@
44 const GpsDebugInterface* gps_debug_interface;
45 const AGpsRilInterface* agps_ril_interface;
46
47- UbuntuGpsLocationCallback location_cb;
48- UbuntuGpsStatusCallback status_cb;
49- UbuntuGpsSvStatusCallback sv_status_cb;
50- UbuntuGpsNmeaCallback nmea_cb;
51- UbuntuGpsSetCapabilities set_capabilities_cb;
52- UbuntuGpsRequestUtcTime request_utc_time_cb;
53-
54- UbuntuGpsXtraDownloadRequest xtra_download_request_cb;
55-
56- UbuntuAgpsStatusCallback agps_status_cb;
57-
58- UbuntuGpsNiNotifyCallback gps_ni_notify_cb;
59-
60- UbuntuAgpsRilRequestSetId request_setid_cb;
61- UbuntuAgpsRilRequestRefLoc request_refloc_cb;
62+ UHardwareGpsLocationCallback location_cb;
63+ UHardwareGpsStatusCallback status_cb;
64+ UHardwareGpsSvStatusCallback sv_status_cb;
65+ UHardwareGpsNmeaCallback nmea_cb;
66+ UHardwareGpsSetCapabilities set_capabilities_cb;
67+ UHardwareGpsRequestUtcTime request_utc_time_cb;
68+
69+ UHardwareGpsXtraDownloadRequest xtra_download_request_cb;
70+
71+ UHardwareGpsAGpsStatusCallback agps_status_cb;
72+
73+ UHardwareGpsNiNotifyCallback gps_ni_notify_cb;
74+
75+ UHardwareGpsAGpsRilRequestSetId request_setid_cb;
76+ UHardwareGpsAGpsRilRequestRefLoc request_refloc_cb;
77
78 void* context;
79 };
80
81 namespace
82 {
83-UbuntuGps hybris_gps_instance = NULL;
84+UHardwareGps hybris_gps_instance = NULL;
85 }
86
87 static void location_callback(GpsLocation* location)
88@@ -78,7 +78,7 @@
89 return;
90
91 hybris_gps_instance->location_cb(
92- reinterpret_cast<UbuntuGpsLocation*>(location),
93+ reinterpret_cast<UHardwareGpsLocation*>(location),
94 hybris_gps_instance->context);
95 }
96
97@@ -96,7 +96,7 @@
98 return;
99
100 hybris_gps_instance->sv_status_cb(
101- reinterpret_cast<UbuntuGpsSvStatus*>(sv_status),
102+ reinterpret_cast<UHardwareGpsSvStatus*>(sv_status),
103 hybris_gps_instance->context);
104 }
105
106@@ -202,7 +202,7 @@
107 */
108
109 hybris_gps_instance->agps_status_cb(
110- reinterpret_cast<UbuntuAgpsStatus*>(agps_status), hybris_gps_instance->context);
111+ reinterpret_cast<UHardwareGpsAGpsStatus*>(agps_status), hybris_gps_instance->context);
112 }
113
114 AGpsCallbacks agps_callbacks =
115@@ -215,7 +215,7 @@
116 {
117 if (hybris_gps_instance)
118 hybris_gps_instance->gps_ni_notify_cb(
119- reinterpret_cast<UbuntuGpsNiNotification*>(notification),
120+ reinterpret_cast<UHardwareGpsNiNotification*>(notification),
121 hybris_gps_instance->context);
122 }
123
124@@ -245,7 +245,7 @@
125 };
126
127
128-UbuntuGps_::UbuntuGps_(UbuntuGpsParams* params)
129+UHardwareGps_::UHardwareGps_(UHardwareGpsParams* params)
130 : gps_interface(NULL),
131 gps_xtra_interface(NULL),
132 agps_interface(NULL),
133@@ -294,13 +294,13 @@
134 }
135 }
136
137-UbuntuGps_::~UbuntuGps_()
138+UHardwareGps_::~UHardwareGps_()
139 {
140 if (gps_interface)
141 gps_interface->cleanup();
142 }
143
144-bool UbuntuGps_::init()
145+bool UHardwareGps_::init()
146 {
147 // fail if the main interface fails to initialize
148 if (!gps_interface || gps_interface->init(&gps_callbacks) != 0)
149@@ -320,7 +320,7 @@
150 return true;
151 }
152
153-bool UbuntuGps_::start()
154+bool UHardwareGps_::start()
155 {
156 if (gps_interface)
157 return (gps_interface->start() == 0);
158@@ -328,7 +328,7 @@
159 return false;
160 }
161
162-bool UbuntuGps_::stop()
163+bool UHardwareGps_::stop()
164 {
165 if (gps_interface)
166 return (gps_interface->stop() == 0);
167@@ -336,25 +336,25 @@
168 return false;
169 }
170
171-void UbuntuGps_::inject_time(int64_t time, int64_t time_reference, int uncertainty)
172+void UHardwareGps_::inject_time(int64_t time, int64_t time_reference, int uncertainty)
173 {
174 if (gps_interface)
175 gps_interface->inject_time(time, time_reference, uncertainty);
176 }
177
178-void UbuntuGps_::inject_location(double latitude, double longitude, float accuracy)
179+void UHardwareGps_::inject_location(double latitude, double longitude, float accuracy)
180 {
181 if (gps_interface)
182 gps_interface->inject_location(latitude, longitude, accuracy);
183 }
184
185-void UbuntuGps_::delete_aiding_data(uint16_t flags)
186+void UHardwareGps_::delete_aiding_data(uint16_t flags)
187 {
188 if (gps_interface)
189 gps_interface->delete_aiding_data(flags);
190 }
191
192-bool UbuntuGps_::set_position_mode(uint32_t mode, uint32_t recurrence, uint32_t min_interval,
193+bool UHardwareGps_::set_position_mode(uint32_t mode, uint32_t recurrence, uint32_t min_interval,
194 uint32_t preferred_accuracy, uint32_t preferred_time)
195 {
196 if (gps_interface)
197@@ -364,7 +364,7 @@
198 return false;
199 }
200
201-void UbuntuGps_::inject_xtra_data(char* data, int length)
202+void UHardwareGps_::inject_xtra_data(char* data, int length)
203 {
204 if (gps_xtra_interface)
205 gps_xtra_interface->inject_xtra_data(data, length);
206@@ -373,58 +373,58 @@
207 /////////////////////////////////////////////////////////////////////
208 // Implementation of the C API
209
210-UbuntuGps ubuntu_gps_new(UbuntuGpsParams* params)
211+UHardwareGps u_hardware_gps_new(UHardwareGpsParams* params)
212 {
213 if (hybris_gps_instance != NULL)
214 return NULL;
215
216- UbuntuGps ubuntu_gps = new UbuntuGps_(params);
217- hybris_gps_instance = ubuntu_gps;
218+ UHardwareGps u_hardware_gps = new UHardwareGps_(params);
219+ hybris_gps_instance = u_hardware_gps;
220
221- if (!ubuntu_gps->init())
222+ if (!u_hardware_gps->init())
223 {
224- delete ubuntu_gps;
225- ubuntu_gps = NULL;
226+ delete u_hardware_gps;
227+ u_hardware_gps = NULL;
228 }
229
230- return ubuntu_gps;
231+ return u_hardware_gps;
232 }
233
234-void ubuntu_gps_delete(UbuntuGps handle)
235+void u_hardware_gps_delete(UHardwareGps handle)
236 {
237 delete handle;
238 if (handle == hybris_gps_instance)
239 hybris_gps_instance = NULL;
240 }
241
242-bool ubuntu_gps_start(UbuntuGps self)
243+bool u_hardware_gps_start(UHardwareGps self)
244 {
245 return self->start();
246 }
247
248-bool ubuntu_gps_stop(UbuntuGps self)
249+bool u_hardware_gps_stop(UHardwareGps self)
250 {
251 return self->stop();
252 }
253
254-void ubuntu_gps_inject_time(UbuntuGps self, int64_t time, int64_t time_reference,
255+void u_hardware_gps_inject_time(UHardwareGps self, int64_t time, int64_t time_reference,
256 int uncertainty)
257 {
258 self->inject_time(time, time_reference, uncertainty);
259 }
260
261-void ubuntu_gps_inject_location(UbuntuGps self, double latitude, double longitude,
262+void u_hardware_gps_inject_location(UHardwareGps self, double latitude, double longitude,
263 float accuracy)
264 {
265 self->inject_location(latitude, longitude, accuracy);
266 }
267
268-void ubuntu_gps_delete_aiding_data(UbuntuGps self, uint16_t flags)
269+void u_hardware_gps_delete_aiding_data(UHardwareGps self, uint16_t flags)
270 {
271 self->delete_aiding_data(flags);
272 }
273
274-bool ubuntu_gps_set_position_mode(UbuntuGps self, uint32_t mode, uint32_t recurrence,
275+bool u_hardware_gps_set_position_mode(UHardwareGps self, uint32_t mode, uint32_t recurrence,
276 uint32_t min_interval, uint32_t preferred_accuracy,
277 uint32_t preferred_time)
278 {
279@@ -432,7 +432,7 @@
280 preferred_time);
281 }
282
283-void ubuntu_gps_inject_xtra_data(UbuntuGps self, char* data, int length)
284+void u_hardware_gps_inject_xtra_data(UHardwareGps self, char* data, int length)
285 {
286 self->inject_xtra_data(data, length);
287 }
288
289=== modified file 'debian/changelog'
290--- debian/changelog 2013-07-05 02:01:11 +0000
291+++ debian/changelog 2013-07-05 16:24:25 +0000
292@@ -1,3 +1,9 @@
293+platform-api (0.18.2) UNRELEASED; urgency=low
294+
295+ * Split out hal to ease integration of location service.
296+
297+ -- Thomas Voß <thomas.voss@canonical.com> Thu, 04 Jul 2013 19:09:22 +0200
298+
299 platform-api (0.18.1+13.10.20130705-0ubuntu1) saucy; urgency=low
300
301 [ Thomas Voß ]
302
303=== modified file 'debian/control'
304--- debian/control 2013-07-03 07:23:59 +0000
305+++ debian/control 2013-07-05 16:24:25 +0000
306@@ -7,6 +7,7 @@
307 doxygen,
308 graphviz,
309 libgles2-mesa-dev,
310+ gcc-4.7,
311 g++-4.7,
312 libhybris-dev,
313 Standards-Version: 3.9.4
314
315=== modified file 'debian/libplatform-api1-dev.install'
316--- debian/libplatform-api1-dev.install 2013-06-13 12:04:14 +0000
317+++ debian/libplatform-api1-dev.install 2013-07-05 16:24:25 +0000
318@@ -1,2 +1,3 @@
319 usr/lib/*/libubuntu_application_api.so
320+usr/lib/*/libubuntu_platform_hardware_api.so
321 usr/lib/*/pkgconfig/ubuntu-platform-api.pc
322
323=== modified file 'debian/libplatform-api1-hybris.install'
324--- debian/libplatform-api1-hybris.install 2013-03-20 12:49:06 +0000
325+++ debian/libplatform-api1-hybris.install 2013-07-05 16:24:25 +0000
326@@ -1,1 +1,2 @@
327 usr/lib/*/libubuntu_application_api.so.*
328+usr/lib/*/libubuntu_platform_hardware_api.so.*
329
330=== modified file 'debian/libplatform-api1-hybris.symbols'
331--- debian/libplatform-api1-hybris.symbols 2013-06-21 02:01:18 +0000
332+++ debian/libplatform-api1-hybris.symbols 2013-07-05 16:24:25 +0000
333@@ -1,12 +1,4 @@
334 libubuntu_application_api.so.1 libplatform-api1-hybris #MINVER#
335- (c++)"ua_sensors_light_disable(void*)@Base" 0.18.1daily13.06.21
336- (c++)"ubuntu::hybris::Bridge::path_to_library()@Base" 0.18.1daily13.06.21
337- (c++)"ubuntu::hybris::Bridge::instance()@Base" 0.18.1daily13.06.21
338- (c++)"ubuntu::hybris::Bridge::Bridge()@Base" 0.18.1daily13.06.21
339- (c++)"ubuntu::hybris::Bridge::Bridge()@Base" 0.18.1daily13.06.21
340- (c++)"ubuntu::hybris::Bridge::~Bridge()@Base" 0.18.1daily13.06.21
341- (c++)"ubuntu::hybris::Bridge::~Bridge()@Base" 0.18.1daily13.06.21
342- (c++)"ubuntu::hybris::Bridge::resolve_symbol(char const*) const@Base" 0.18.1daily13.06.21
343 u_application_description_destroy@Base 0.18.1daily13.06.21
344 u_application_description_new@Base 0.18.1daily13.06.21
345 u_application_description_set_application_id@Base 0.18.1daily13.06.21
346@@ -34,6 +26,7 @@
347 ua_sensors_accelerometer_new@Base 0.18.1daily13.06.21
348 ua_sensors_accelerometer_set_reading_cb@Base 0.18.1daily13.06.21
349 ua_sensors_light_enable@Base 0.18.1daily13.06.21
350+ ua_sensors_light_disable@Base 0replaceme
351 ua_sensors_light_get_max_value@Base 0.18.1daily13.06.21
352 ua_sensors_light_get_min_delay@Base 0.18.1daily13.06.21
353 ua_sensors_light_get_min_value@Base 0.18.1daily13.06.21
354@@ -81,15 +74,6 @@
355 uas_light_event_get_timestamp@Base 0.18.1daily13.06.21
356 uas_proximity_event_get_distance@Base 0.18.1daily13.06.21
357 uas_proximity_event_get_timestamp@Base 0.18.1daily13.06.21
358- ubuntu_gps_delete@Base 0.18.1daily13.06.21
359- ubuntu_gps_delete_aiding_data@Base 0.18.1daily13.06.21
360- ubuntu_gps_inject_location@Base 0.18.1daily13.06.21
361- ubuntu_gps_inject_time@Base 0.18.1daily13.06.21
362- ubuntu_gps_inject_xtra_data@Base 0.18.1daily13.06.21
363- ubuntu_gps_new@Base 0.18.1daily13.06.21
364- ubuntu_gps_set_position_mode@Base 0.18.1daily13.06.21
365- ubuntu_gps_start@Base 0.18.1daily13.06.21
366- ubuntu_gps_stop@Base 0.18.1daily13.06.21
367 ubuntu_ui_install_task_controller@Base 0.18.1daily13.06.21
368 ubuntu_ui_report_notification_invisible@Base 0.18.1daily13.06.21
369 ubuntu_ui_report_notification_visible@Base 0.18.1daily13.06.21
370@@ -105,3 +89,13 @@
371 ubuntu_ui_session_unfocus_running_sessions@Base 0.18.1daily13.06.21
372 ubuntu_ui_set_surface_trap@Base 0.18.1daily13.06.21
373 ubuntu_ui_unset_surface_trap@Base 0.18.1daily13.06.21
374+libubuntu_platform_hardware_api.so.1 libplatform-api1-hybris #MINVER#
375+ u_hardware_gps_delete@Base 0replaceme
376+ u_hardware_gps_delete_aiding_data@Base 0replaceme
377+ u_hardware_gps_inject_location@Base 0replaceme
378+ u_hardware_gps_inject_time@Base 0replaceme
379+ u_hardware_gps_inject_xtra_data@Base 0replaceme
380+ u_hardware_gps_new@Base 0replaceme
381+ u_hardware_gps_set_position_mode@Base 0replaceme
382+ u_hardware_gps_start@Base 0replaceme
383+ u_hardware_gps_stop@Base 0replaceme
384
385=== modified file 'debian/rules'
386--- debian/rules 2013-07-04 05:44:27 +0000
387+++ debian/rules 2013-07-05 16:24:25 +0000
388@@ -2,6 +2,7 @@
389
390 DPKG_GENSYMBOLS_CHECK_LEVEL = 4
391
392+export C=gcc-4.7
393 export CXX=g++-4.7
394
395 %:
396
397=== modified file 'doc/Doxyfile.in'
398--- doc/Doxyfile.in 2013-06-11 09:40:30 +0000
399+++ doc/Doxyfile.in 2013-07-05 16:24:25 +0000
400@@ -209,7 +209,7 @@
401 # For instance, some of the names that are used will be different. The list
402 # of all members will be omitted, etc.
403
404-OPTIMIZE_OUTPUT_FOR_C = NO
405+OPTIMIZE_OUTPUT_FOR_C = YES
406
407 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
408 # sources only. Doxygen will then generate output that is more tailored for
409@@ -365,7 +365,7 @@
410 # Private class members and static file members will be hidden unless
411 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
412
413-EXTRACT_ALL = NO
414+EXTRACT_ALL = YES
415
416 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
417 # will be included in the documentation.
418
419=== modified file 'include/ubuntu/application/CMakeLists.txt'
420--- include/ubuntu/application/CMakeLists.txt 2013-06-11 11:05:25 +0000
421+++ include/ubuntu/application/CMakeLists.txt 2013-07-05 16:24:25 +0000
422@@ -7,7 +7,6 @@
423 lifecycle_delegate.h
424 operation_mode.h
425 options.h
426- ubuntu_application_gps.h
427 )
428
429 install(
430@@ -16,4 +15,4 @@
431 )
432
433 add_subdirectory(sensors)
434-add_subdirectory(ui)
435\ No newline at end of file
436+add_subdirectory(ui)
437
438=== modified file 'include/ubuntu/application/sensors/light.h'
439--- include/ubuntu/application/sensors/light.h 2013-05-30 02:03:42 +0000
440+++ include/ubuntu/application/sensors/light.h 2013-07-05 16:24:25 +0000
441@@ -38,7 +38,7 @@
442 UASensorsLight* sensor);
443
444 UStatus
445- ua_sensors_light_enable(
446+ ua_sensors_light_disable(
447 UASensorsLight* sensor);
448
449 uint32_t
450
451=== added directory 'include/ubuntu/hardware'
452=== renamed file 'include/ubuntu/application/ubuntu_application_gps.h' => 'include/ubuntu/hardware/gps.h'
453--- include/ubuntu/application/ubuntu_application_gps.h 2013-05-27 21:49:05 +0000
454+++ include/ubuntu/hardware/gps.h 2013-07-05 16:24:25 +0000
455@@ -14,9 +14,10 @@
456 * along with this program. If not, see <http://www.gnu.org/licenses/>.
457 *
458 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
459+ * Authored by: Thomas Voß <thomas.voss@canonical.com>
460 */
461-#ifndef UBUNTU_APPLICATION_GPS_H_
462-#define UBUNTU_APPLICATION_GPS_H_
463+#ifndef UBUNTU_HARDWARE_GPS_H_
464+#define UBUNTU_HARDWARE_GPS_H_
465
466 #include <stdint.h>
467 #include <stddef.h>
468@@ -25,149 +26,170 @@
469 extern "C" {
470 #endif
471
472-/** \defgroup gps_access Functions and types for accessing location services. */
473+/** \defgroup gps_access Functions and types for accessing GPS H/W. */
474+
475+/**
476+ * Maximum number of SVs for u_hardware_gps_sv_status_callback().
477+ * \ingroup gps_access
478+ */
479+#define U_HARDWARE_GPS_MAX_SVS 32
480
481 /**
482- * Maximum number of SVs for gps_sv_status_callback().
483+ * The status of the GPS hardware.
484 * \ingroup gps_access
485 */
486-#define UBUNTU_GPS_MAX_SVS 32
487-
488 enum
489 {
490 /** GPS status unknown. */
491- UBUNTU_GPS_STATUS_NONE = 0,
492+ U_HARDWARE_GPS_STATUS_NONE = 0,
493 /** GPS has begun navigating. */
494- UBUNTU_GPS_STATUS_SESSION_BEGIN = 1,
495+ U_HARDWARE_GPS_STATUS_SESSION_BEGIN = 1,
496 /** GPS has stopped navigating. */
497- UBUNTU_GPS_STATUS_SESSION_END = 2,
498+ U_HARDWARE_GPS_STATUS_SESSION_END = 2,
499 /** GPS has powered on but is not navigating. */
500- UBUNTU_GPS_STATUS_ENGINE_ON = 3,
501+ U_HARDWARE_GPS_STATUS_ENGINE_ON = 3,
502 /** GPS is powered off. */
503- UBUNTU_GPS_STATUS_ENGINE_OFF = 4
504+ U_HARDWARE_GPS_STATUS_ENGINE_OFF = 4
505 };
506
507-/**
508+/**
509 * Flags for the gps_set_capabilities callback.
510 * \ingroup gps_access
511- * GPS HAL schedules fixes for UBUNTU_GPS_POSITION_RECURRENCE_PERIODIC mode.
512+ * GPS HAL schedules fixes for U_HARDWARE_GPS_POSITION_RECURRENCE_PERIODIC mode.
513 * If this is not set, then the framework will use 1000ms for min_interval
514 * and will start and call start() and stop() to schedule the GPS.
515 */
516-#define UBUNTU_GPS_CAPABILITY_SCHEDULING 0x0000001
517+#define U_HARDWARE_GPS_CAPABILITY_SCHEDULING 0x0000001
518 /** GPS supports MS-Based AGPS mode */
519-#define UBUNTU_GPS_CAPABILITY_MSB 0x0000002
520+#define U_HARDWARE_GPS_CAPABILITY_MSB 0x0000002
521 /** GPS supports MS-Assisted AGPS mode */
522-#define UBUNTU_GPS_CAPABILITY_MSA 0x0000004
523+#define U_HARDWARE_GPS_CAPABILITY_MSA 0x0000004
524 /** GPS supports single-shot fixes */
525-#define UBUNTU_GPS_CAPABILITY_SINGLE_SHOT 0x0000008
526+#define U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT 0x0000008
527 /** GPS supports on demand time injection */
528-#define UBUNTU_GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
529+#define U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
530
531 /**
532- * UbuntuGpsNiNotifyFlags constants
533+ * UHardwareGpsNiNotifyFlags constants
534 * \ingroup gps_access
535 */
536-typedef uint32_t UbuntuGpsNiNotifyFlags;
537+typedef uint32_t UHardwareGpsNiNotifyFlags;
538 /** NI requires notification */
539-#define UBUNTU_GPS_NI_NEED_NOTIFY 0x0001
540+#define U_HARDWARE_GPS_NI_NEED_NOTIFY 0x0001
541 /** NI requires verification */
542-#define UBUNTU_GPS_NI_NEED_VERIFY 0x0002
543+#define U_HARDWARE_GPS_NI_NEED_VERIFY 0x0002
544 /** NI requires privacy override, no notification/minimal trace */
545-#define UBUNTU_GPS_NI_PRIVACY_OVERRIDE 0x0004
546+#define U_HARDWARE_GPS_NI_PRIVACY_OVERRIDE 0x0004
547
548 /**
549 * GPS NI responses, used to define the response in
550 * NI structures
551 * \ingroup gps_access
552 */
553-typedef int UbuntuGpsUserResponseType;
554+typedef int UHardwareGpsUserResponseType;
555+
556 enum
557 {
558- UBUNTU_UBUNTU_GPS_NI_RESPONSE_ACCEPT = 1,
559- UBUNTU_UBUNTU_GPS_NI_RESPONSE_DENY = 2,
560- UBUNTU_UBUNTU_GPS_NI_RESPONSE_NORESP = 3
561+ U_HARDWARE_GPS_NI_RESPONSE_ACCEPT = 1,
562+ U_HARDWARE_GPS_NI_RESPONSE_DENY = 2,
563+ U_HARDWARE_GPS_NI_RESPONSE_NORESP = 3
564 };
565
566 enum
567 {
568- UBUNTU_GPS_NI_TYPE_VOICE = 1,
569- UBUNTU_GPS_NI_TYPE_UMTS_SUPL = 2,
570- UBUNTU_GPS_NI_TYPE_UMTS_CTRL_PLANE = 3
571+ U_HARDWARE_GPS_NI_TYPE_VOICE = 1,
572+ U_HARDWARE_GPS_NI_TYPE_UMTS_SUPL = 2,
573+ U_HARDWARE_GPS_NI_TYPE_UMTS_CTRL_PLANE = 3
574 };
575
576 /**
577 * String length constants
578 * \ingroup gps_access
579 */
580-#define UBUNTU_GPS_NI_SHORT_STRING_MAXLEN 256
581-#define UBUNTU_GPS_NI_LONG_STRING_MAXLEN 2048
582+#define U_HARDWARE_GPS_NI_SHORT_STRING_MAXLEN 256
583+#define U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN 2048
584
585 /**
586 * NI data encoding scheme
587 * \ingroup gps_access
588 */
589-typedef int UbuntuGpsNiEncodingType;
590-enum
591-{
592- UBUNTU_GPS_ENC_NONE = 0,
593- UBUNTU_GPS_ENC_SUPL_GSM_DEFAULT = 1,
594- UBUNTU_GPS_ENC_SUPL_UTF8 = 2,
595- UBUNTU_GPS_ENC_SUPL_UCS2 = 3,
596- UBUNTU_GPS_ENC_UNKNOWN = -1
597-};
598-
599-enum
600-{
601- UBUNTU_AGPS_TYPE_SUPL = 1,
602- UBUNTU_AGPS_TYPE_C2K = 2
603-};
604-
605-
606+typedef int UHardwareGpsNiEncodingType;
607+
608+/**
609+ * Known encoding types for Ni responses
610+ * \ingroup gps_access
611+ */
612+enum
613+{
614+ U_HARDWARE_GPS_ENC_NONE = 0,
615+ U_HARDWARE_GPS_ENC_SUPL_GSM_DEFAULT = 1,
616+ U_HARDWARE_GPS_ENC_SUPL_UTF8 = 2,
617+ U_HARDWARE_GPS_ENC_SUPL_UCS2 = 3,
618+ U_HARDWARE_GPS_ENC_UNKNOWN = -1
619+};
620+
621+/**
622+ * Known AGPS types
623+ * \ingroup gps_access
624+ */
625+enum
626+{
627+ U_HARDWARE_GPS_AGPS_TYPE_SUPL = 1,
628+ U_HARDWARE_GPS_AGPS_TYPE_C2K = 2
629+};
630+
631+/**
632+ * Known positioning modes
633+ * \ingroup gps_access
634+ */
635 enum
636 {
637 /** Mode for running GPS standalone (no assistance). */
638- UBUNTU_GPS_POSITION_MODE_STANDALONE = 0,
639+ U_HARDWARE_GPS_POSITION_MODE_STANDALONE = 0,
640 /** AGPS MS-Based mode. */
641- UBUNTU_GPS_POSITION_MODE_MS_BASED = 1,
642+ U_HARDWARE_GPS_POSITION_MODE_MS_BASED = 1,
643 /** AGPS MS-Assisted mode. */
644- UBUNTU_GPS_POSITION_MODE_MS_ASSISTED = 2
645+ U_HARDWARE_GPS_POSITION_MODE_MS_ASSISTED = 2
646 };
647
648+/**
649+ * Known positioning modes
650+ * \ingroup gps_access
651+ */
652 enum
653 {
654 /** Receive GPS fixes on a recurring basis at a specified period. */
655- UBUNTU_GPS_POSITION_RECURRENCE_PERIODIC = 0,
656+ U_HARDWARE_GPS_POSITION_RECURRENCE_PERIODIC = 0,
657 /** Request a single shot GPS fix. */
658- UBUNTU_GPS_POSITION_RECURRENCE_SINGLE = 1
659+ U_HARDWARE_GPS_POSITION_RECURRENCE_SINGLE = 1
660 };
661
662 enum
663 {
664 /** GPS requests data connection for AGPS. */
665- UBUNTU_GPS_REQUEST_AGPS_DATA_CONN = 1,
666+ U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN = 1,
667 /** GPS releases the AGPS data connection. */
668- UBUNTU_GPS_RELEASE_AGPS_DATA_CONN = 2,
669+ U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN = 2,
670 /** AGPS data connection initiated */
671- UBUNTU_GPS_AGPS_DATA_CONNECTED = 3,
672+ U_HARDWARE_GPS_AGPS_DATA_CONNECTED = 3,
673 /** AGPS data connection completed */
674- UBUNTU_GPS_AGPS_DATA_CONN_DONE = 4,
675+ U_HARDWARE_GPS_AGPS_DATA_CONN_DONE = 4,
676 /** AGPS data connection failed */
677- UBUNTU_GPS_AGPS_DATA_CONN_FAILED = 5
678+ U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED = 5
679 };
680
681-/** UbuntuGpsLocation has valid latitude and longitude. */
682-#define UBUNTU_GPS_LOCATION_HAS_LAT_LONG 0x0001
683-/** UbuntuGpsLocation has valid altitude. */
684-#define UBUNTU_GPS_LOCATION_HAS_ALTITUDE 0x0002
685-/** UbuntuGpsLocation has valid speed. */
686-#define UBUNTU_GPS_LOCATION_HAS_SPEED 0x0004
687-/** UbuntuGpsLocation has valid bearing. */
688-#define UBUNTU_GPS_LOCATION_HAS_BEARING 0x0008
689-/** UbuntuGpsLocation has valid accuracy. */
690-#define UBUNTU_GPS_LOCATION_HAS_ACCURACY 0x0010
691+/** UHardwareGpsLocation has valid latitude and longitude. */
692+#define U_HARDWARE_GPS_LOCATION_HAS_LAT_LONG 0x0001
693+/** UHardwareGpsLocation has valid altitude. */
694+#define U_HARDWARE_GPS_LOCATION_HAS_ALTITUDE 0x0002
695+/** UHardwareGpsLocation has valid speed. */
696+#define U_HARDWARE_GPS_LOCATION_HAS_SPEED 0x0004
697+/** UHardwareGpsLocation has valid bearing. */
698+#define U_HARDWARE_GPS_LOCATION_HAS_BEARING 0x0008
699+/** UHardwareGpsLocation has valid accuracy. */
700+#define U_HARDWARE_GPS_LOCATION_HAS_ACCURACY 0x0010
701
702-typedef struct UbuntuGps_* UbuntuGps;
703+typedef struct UHardwareGps_* UHardwareGps;
704
705 /**
706 * Models a location as reported by the GPS HAL.
707@@ -175,234 +197,264 @@
708 */
709 typedef struct
710 {
711- /** set to sizeof(UbuntuGpsLocation) */
712- size_t size;
713- /** Contains UBUNTU_GPS_LOCATION_* flags bits. */
714- uint16_t flags;
715+ /** set to sizeof(UHardwareGpsLocation) */
716+ size_t size;
717+ /** Contains U_HARDWARE_GPS_LOCATION_* flags bits. */
718+ uint16_t flags;
719 /** Represents latitude in degrees. */
720- double latitude;
721+ double latitude;
722 /** Represents longitude in degrees. */
723- double longitude;
724+ double longitude;
725 /** Represents altitude in meters above the WGS 84 reference
726 * ellipsoid. */
727- double altitude;
728+ double altitude;
729 /** Represents speed in meters per second. */
730- float speed;
731+ float speed;
732 /** Represents heading in degrees. */
733- float bearing;
734+ float bearing;
735 /** Represents expected accuracy in meters. */
736- float accuracy;
737+ float accuracy;
738 /** Timestamp for the location fix, in milliseconds since January 1, 1970 */
739- int64_t timestamp;
740-} UbuntuGpsLocation;
741+ int64_t timestamp;
742+} UHardwareGpsLocation;
743
744-/**
745- * Represents space vehicle (satellite) information.
746+/**
747+ * Represents space vehicle (satellite) information.
748 * \ingroup gps_access
749 */
750 typedef struct {
751- /** set to sizeof(UbuntuGpsSvInfo) */
752- size_t size;
753+ /** set to sizeof(UHardwareGpsSvInfo) */
754+ size_t size;
755 /** Pseudo-random number for the SV. */
756- int prn;
757+ int prn;
758 /** Signal to noise ratio. */
759- float snr;
760+ float snr;
761 /** Elevation of SV in degrees. */
762- float elevation;
763+ float elevation;
764 /** Azimuth of SV in degrees. */
765- float azimuth;
766-} UbuntuGpsSvInfo;
767+ float azimuth;
768+} UHardwareGpsSvInfo;
769
770-/**
771- * Represents SV (Space Vehicle) status.
772+/**
773+ * Represents SV (Space Vehicle) status.
774 * \ingroup gps_access
775 */
776 typedef struct {
777 /** set to sizeof(GpsSvStatus) */
778- size_t size;
779+ size_t size;
780
781 /** Number of SVs currently visible. */
782- int num_svs;
783+ int num_svs;
784
785 /** Contains an array of SV information. */
786- UbuntuGpsSvInfo sv_list[UBUNTU_GPS_MAX_SVS];
787+ UHardwareGpsSvInfo sv_list[U_HARDWARE_GPS_MAX_SVS];
788
789 /** Represents a bit mask indicating which SVs
790 * have ephemeris data.
791 */
792- uint32_t ephemeris_mask;
793+ uint32_t ephemeris_mask;
794
795 /** Represents a bit mask indicating which SVs
796 * have almanac data.
797 */
798- uint32_t almanac_mask;
799+ uint32_t almanac_mask;
800
801 /**
802 * Represents a bit mask indicating which SVs
803 * were used for computing the most recent position fix.
804 */
805- uint32_t used_in_fix_mask;
806-} UbuntuGpsSvStatus;
807+ uint32_t used_in_fix_mask;
808+} UHardwareGpsSvStatus;
809
810-/**
811- * Represents the status of AGPS.
812+/**
813+ * Represents the status of AGPS.
814 * \ingroup gps_access
815 */
816 typedef struct {
817- /** set to sizeof(UbuntuAgpsStatus) */
818+ /** set to sizeof(UHardwareGpsAGpsStatus) */
819 size_t size;
820
821 uint16_t type;
822 uint16_t status;
823 uint32_t ipaddr;
824-} UbuntuAgpsStatus;
825+} UHardwareGpsAGpsStatus;
826
827-/**
828- * Represents an NI request
829+/**
830+ * Represents an NI request
831 * \ingroup gps_access
832 */
833 typedef struct {
834- /** set to sizeof(UbuntuGpsNiNotification) */
835- size_t size;
836+ /** set to sizeof(UHardwareGpsNiNotification) */
837+ size_t size;
838
839 /**
840 * An ID generated by HAL to associate NI notifications and UI
841 * responses
842 */
843- int notification_id;
844+ int notification_id;
845
846 /**
847 * An NI type used to distinguish different categories of NI
848- * events, such as UBUNTU_GPS_NI_TYPE_VOICE, UBUNTU_GPS_NI_TYPE_UMTS_SUPL, ...
849+ * events, such as U_HARDWARE_GPS_NI_TYPE_VOICE, U_HARDWARE_GPS_NI_TYPE_UMTS_SUPL, ...
850 */
851- uint32_t ni_type;
852+ uint32_t ni_type;
853
854 /**
855- * Notification/verification options, combinations of UbuntuGpsNiNotifyFlags constants
856+ * Notification/verification options, combinations of UHardwareGpsNiNotifyFlags constants
857 */
858- UbuntuGpsNiNotifyFlags notify_flags;
859+ UHardwareGpsNiNotifyFlags notify_flags;
860
861 /**
862 * Timeout period to wait for user response.
863 * Set to 0 for no time out limit.
864 */
865- int timeout;
866+ int timeout;
867
868 /**
869 * Default response when time out.
870 */
871- UbuntuGpsUserResponseType default_response;
872+ UHardwareGpsUserResponseType default_response;
873
874 /**
875 * Requestor ID
876 */
877- char requestor_id[UBUNTU_GPS_NI_SHORT_STRING_MAXLEN];
878+ char requestor_id[U_HARDWARE_GPS_NI_SHORT_STRING_MAXLEN];
879
880 /**
881 * Notification message. It can also be used to store client_id in some cases
882 */
883- char text[UBUNTU_GPS_NI_LONG_STRING_MAXLEN];
884-
885- /**
886- * Client name decoding scheme
887- */
888- UbuntuGpsNiEncodingType requestor_id_encoding;
889-
890- /**
891- * Client name decoding scheme
892- */
893- UbuntuGpsNiEncodingType text_encoding;
894+ char text[U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN];
895+
896+ /**
897+ * Client name decoding scheme
898+ */
899+ UHardwareGpsNiEncodingType requestor_id_encoding;
900+
901+ /**
902+ * Client name decoding scheme
903+ */
904+ UHardwareGpsNiEncodingType text_encoding;
905
906 /**
907 * A pointer to extra data. Format:
908 * key_1 = value_1
909 * key_2 = value_2
910 */
911- char extras[UBUNTU_GPS_NI_LONG_STRING_MAXLEN];
912-
913-} UbuntuGpsNiNotification;
914-
915-typedef void (* UbuntuGpsLocationCallback)(UbuntuGpsLocation* location, void* context);
916-typedef void (* UbuntuGpsStatusCallback)(uint16_t status, void* context);
917-typedef void (* UbuntuGpsSvStatusCallback)(UbuntuGpsSvStatus* sv_info, void* context);
918-typedef void (* UbuntuGpsNmeaCallback)(int64_t timestamp, const char* nmea, int length, void* context);
919-typedef void (* UbuntuGpsSetCapabilities)(uint32_t capabilities, void* context);
920-typedef void (* UbuntuGpsRequestUtcTime)(void* context);
921+ char extras[U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN];
922+
923+} UHardwareGpsNiNotification;
924+
925+typedef void (*UHardwareGpsLocationCallback)(UHardwareGpsLocation *location, void *context);
926+typedef void (*UHardwareGpsStatusCallback)(uint16_t status, void *context);
927+typedef void (*UHardwareGpsSvStatusCallback)(UHardwareGpsSvStatus *sv_info, void *context);
928+typedef void (*UHardwareGpsNmeaCallback)(int64_t timestamp, const char *nmea, int length, void *context);
929+typedef void (*UHardwareGpsSetCapabilities)(uint32_t capabilities, void *context);
930+typedef void (*UHardwareGpsRequestUtcTime)(void *context);
931
932 /** Callback to request the client to download XTRA data.
933 * The client should download XTRA data and inject it by calling inject_xtra_data().
934 */
935-typedef void (* UbuntuGpsXtraDownloadRequest)(void* context);
936+typedef void (*UHardwareGpsXtraDownloadRequest)(void *context);
937
938 /** Callback with AGPS status information.
939 */
940-typedef void (* UbuntuAgpsStatusCallback)(UbuntuAgpsStatus* status, void* context);
941+typedef void (*UHardwareGpsAGpsStatusCallback)(UHardwareGpsAGpsStatus *status, void *context);
942
943 /** Callback with NI notification.
944 */
945-typedef void (*UbuntuGpsNiNotifyCallback)(UbuntuGpsNiNotification *notification, void* context);
946+typedef void (*UHardwareGpsNiNotifyCallback)(UHardwareGpsNiNotification *notification, void *context);
947
948 /*
949 Callback for AGPS RIL (Radio Interface Library) set id
950 */
951-typedef void (*UbuntuAgpsRilRequestSetId)(uint32_t flags, void* context);
952-typedef void (*UbuntuAgpsRilRequestRefLoc)(uint32_t flags, void* context);
953+typedef void (*UHardwareGpsAGpsRilRequestSetId)(uint32_t flags, void *context);
954+typedef void (*UHardwareGpsAGpsRilRequestRefLoc)(uint32_t flags, void *context);
955
956 typedef struct
957 {
958
959- UbuntuGpsLocationCallback location_cb;
960- UbuntuGpsStatusCallback status_cb;
961- UbuntuGpsSvStatusCallback sv_status_cb;
962- UbuntuGpsNmeaCallback nmea_cb;
963- UbuntuGpsSetCapabilities set_capabilities_cb;
964- UbuntuGpsRequestUtcTime request_utc_time_cb;
965-
966- UbuntuGpsXtraDownloadRequest xtra_download_request_cb;
967-
968- UbuntuAgpsStatusCallback agps_status_cb;
969-
970- UbuntuGpsNiNotifyCallback gps_ni_notify_cb;
971-
972- UbuntuAgpsRilRequestSetId request_setid_cb;
973- UbuntuAgpsRilRequestRefLoc request_refloc_cb;
974+ UHardwareGpsLocationCallback location_cb;
975+ UHardwareGpsStatusCallback status_cb;
976+ UHardwareGpsSvStatusCallback sv_status_cb;
977+ UHardwareGpsNmeaCallback nmea_cb;
978+ UHardwareGpsSetCapabilities set_capabilities_cb;
979+ UHardwareGpsRequestUtcTime request_utc_time_cb;
980+
981+ UHardwareGpsXtraDownloadRequest xtra_download_request_cb;
982+
983+ UHardwareGpsAGpsStatusCallback agps_status_cb;
984+
985+ UHardwareGpsNiNotifyCallback gps_ni_notify_cb;
986+
987+ UHardwareGpsAGpsRilRequestSetId request_setid_cb;
988+ UHardwareGpsAGpsRilRequestRefLoc request_refloc_cb;
989
990 void* context;
991-} UbuntuGpsParams;
992+} UHardwareGpsParams;
993
994 /*
995 You must create only one instance per process/application.
996 */
997-UbuntuGps ubuntu_gps_new(UbuntuGpsParams* params);
998-void ubuntu_gps_delete(UbuntuGps handle);
999-
1000-bool ubuntu_gps_start(UbuntuGps self);
1001-bool ubuntu_gps_stop(UbuntuGps self);
1002+UHardwareGps
1003+u_hardware_gps_new(UHardwareGpsParams *params);
1004+
1005+void
1006+u_hardware_gps_delete(UHardwareGps handle);
1007+
1008+bool
1009+u_hardware_gps_start(UHardwareGps self);
1010+
1011+bool
1012+u_hardware_gps_stop(UHardwareGps self);
1013
1014 /*
1015 \param time NTP time, in milliseconds since Jan 1st 1970.
1016 \param time_reference time from the internal clock at the moment that NTP time was taken.
1017 \param uncertainty possible deviation in the time supplied (uncertainty) in milliseconds.
1018 */
1019-void ubuntu_gps_inject_time(UbuntuGps self, int64_t time, int64_t time_reference, int uncertainty);
1020-
1021-void ubuntu_gps_inject_location(UbuntuGps self, double latitude, double longitude, float accuracy);
1022-void ubuntu_gps_delete_aiding_data(UbuntuGps self, uint16_t flags);
1023+void
1024+u_hardware_gps_inject_time(
1025+ UHardwareGps self,
1026+ int64_t time,
1027+ int64_t time_reference,
1028+ int uncertainty);
1029+
1030+void
1031+u_hardware_gps_inject_location(
1032+ UHardwareGps self,
1033+ double latitude,
1034+ double longitude,
1035+ float accuracy);
1036+
1037+void
1038+u_hardware_gps_delete_aiding_data(
1039+ UHardwareGps self,
1040+ uint16_t flags);
1041
1042 /*
1043- \param mode One of the UBUNTU_GPS_POSITION_MODE_* values
1044- \param recurrence One of the UBUNTU_GPS_POSITION_RECURRENCE_* values
1045+ \param mode One of the U_HARDWARE_GPS_POSITION_MODE_* values
1046+ \param recurrence One of the U_HARDWARE_GPS_POSITION_RECURRENCE_* values
1047 \param min_interval represents the time between fixes in milliseconds.
1048 \param preferred_accuracy The requested fix accuracy in meters. Can be zero.
1049 \param preferred_time The requested time to first fix in milliseconds. Can be zero.
1050 */
1051-bool ubuntu_gps_set_position_mode(UbuntuGps self, uint32_t mode, uint32_t recurrence,
1052- uint32_t min_interval, uint32_t preferred_accuracy,
1053- uint32_t preferred_time);
1054-void ubuntu_gps_inject_xtra_data(UbuntuGps self, char* data, int length);
1055+bool
1056+u_hardware_gps_set_position_mode(
1057+ UHardwareGps self,
1058+ uint32_t mode,
1059+ uint32_t recurrence,
1060+ uint32_t min_interval,
1061+ uint32_t preferred_accuracy,
1062+ uint32_t preferred_time);
1063+
1064+void
1065+u_hardware_gps_inject_xtra_data(
1066+ UHardwareGps self,
1067+ char* data,
1068+ int length);
1069
1070 #ifdef __cplusplus
1071 }
1072 #endif
1073
1074-#endif // UBUNTU_APPLICATION_GPS_H_
1075+#endif // UBUNTU_HARDWARE_GPS_H_
1076
1077=== modified file 'src/hybris/CMakeLists.txt'
1078--- src/hybris/CMakeLists.txt 2013-06-20 12:23:48 +0000
1079+++ src/hybris/CMakeLists.txt 2013-07-05 16:24:25 +0000
1080@@ -1,14 +1,15 @@
1081-set(SOURCES
1082- hybris_bridge.cpp
1083+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
1084+
1085+add_library(
1086+ ubuntu_application_api SHARED
1087+
1088 ubuntu_application_api_hybris.cpp
1089 ubuntu_application_sensors_hybris.cpp
1090 )
1091
1092-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
1093-
1094 add_library(
1095- ubuntu_application_api SHARED
1096- ${SOURCES}
1097+ ubuntu_platform_hardware_api SHARED
1098+ ubuntu_platform_hardware_api.cpp
1099 )
1100
1101 include_directories(
1102@@ -20,6 +21,11 @@
1103 hybris-common
1104 )
1105
1106+target_link_libraries(
1107+ ubuntu_platform_hardware_api
1108+ hybris-common
1109+)
1110+
1111 set_target_properties(
1112 ubuntu_application_api
1113 PROPERTIES
1114@@ -27,8 +33,21 @@
1115 SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
1116 )
1117
1118+set_target_properties(
1119+ ubuntu_platform_hardware_api
1120+ PROPERTIES
1121+ VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
1122+ SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
1123+)
1124+
1125 install(
1126 TARGETS ubuntu_application_api
1127- ${INSTALL_TARGETS_DEFAULT_ARGS})
1128+ ${INSTALL_TARGETS_DEFAULT_ARGS}
1129+)
1130+
1131+install(
1132+ TARGETS ubuntu_platform_hardware_api
1133+ ${INSTALL_TARGETS_DEFAULT_ARGS}
1134+)
1135
1136 add_subdirectory(tests/)
1137
1138=== added file 'src/hybris/bridge.h'
1139--- src/hybris/bridge.h 1970-01-01 00:00:00 +0000
1140+++ src/hybris/bridge.h 2013-07-05 16:24:25 +0000
1141@@ -0,0 +1,202 @@
1142+/*
1143+ * Copyright (C) 2012 Canonical Ltd
1144+ *
1145+ * This program is free software: you can redistribute it and/or modify
1146+ * it under the terms of the GNU Lesser General Public License version 3 as
1147+ * published by the Free Software Foundation.
1148+ *
1149+ * This program is distributed in the hope that it will be useful,
1150+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1151+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1152+ * GNU Lesser General Public License for more details.
1153+ *
1154+ * You should have received a copy of the GNU Lesser General Public License
1155+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1156+ *
1157+ * Authored by: Thomas Voss <thomas.voss@canonical.com>
1158+ * Ricardo Mendoza <ricardo.mendoza@canonical.com>
1159+ */
1160+#ifndef BRIDGE_H_
1161+#define BRIDGE_H_
1162+
1163+#include <assert.h>
1164+#include <dlfcn.h>
1165+#include <stddef.h>
1166+
1167+#define HIDDEN_SYMBOL __attribute__ ((visibility ("hidden")))
1168+
1169+#ifdef __cplusplus
1170+extern "C" {
1171+#endif
1172+
1173+extern void *android_dlopen(const char *filename, int flag);
1174+extern void *android_dlsym(void *handle, const char *symbol);
1175+
1176+#ifdef __cplusplus
1177+}
1178+#endif
1179+
1180+namespace internal
1181+{
1182+
1183+struct HIDDEN_SYMBOL ToApplication
1184+{
1185+ static const char* path()
1186+ {
1187+ return "/system/lib/libubuntu_application_api.so";
1188+ }
1189+};
1190+
1191+struct HIDDEN_SYMBOL ToHardware
1192+{
1193+ static const char* path()
1194+ {
1195+ return "/system/lib/libubuntu_platform_hardware_api.so";
1196+ }
1197+};
1198+
1199+template<typename Scope = ToApplication>
1200+class HIDDEN_SYMBOL Bridge
1201+{
1202+ public:
1203+ static Bridge<Scope>& instance()
1204+ {
1205+ static Bridge<Scope> bridge;
1206+ return bridge;
1207+ }
1208+
1209+ void* resolve_symbol(const char* symbol) const
1210+ {
1211+ return android_dlsym(lib_handle, symbol);
1212+ }
1213+
1214+ protected:
1215+ Bridge() : lib_handle(android_dlopen(Scope::path(), RTLD_LAZY))
1216+ {
1217+ assert(lib_handle && "Error loading ubuntu_application_api");
1218+ }
1219+
1220+ ~Bridge()
1221+ {
1222+ // TODO android_dlclose(libcamera_handle);
1223+ }
1224+
1225+ void* lib_handle;
1226+};
1227+
1228+}
1229+
1230+#ifdef __cplusplus
1231+extern "C" {
1232+#endif
1233+
1234+/**********************************************************/
1235+/*********** Implementation starts here *******************/
1236+/**********************************************************/
1237+
1238+#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<>::instance().resolve_symbol(sym); }
1239+
1240+#define IMPLEMENT_FUNCTION0(return_type, symbol) \
1241+ return_type symbol() \
1242+ { \
1243+ static return_type (*f)() = NULL; \
1244+ DLSYM(&f, #symbol); \
1245+ return f();}
1246+
1247+#define IMPLEMENT_VOID_FUNCTION0(symbol) \
1248+ void symbol() \
1249+ { \
1250+ static void (*f)() = NULL; \
1251+ DLSYM(&f, #symbol); \
1252+ f();}
1253+
1254+#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
1255+ return_type symbol(arg1 _1) \
1256+ { \
1257+ static return_type (*f)(arg1) = NULL; \
1258+ DLSYM(&f, #symbol); \
1259+ return f(_1); }
1260+
1261+#define IMPLEMENT_SF_FUNCTION1(return_type, symbol, arg1) \
1262+ return_type symbol(arg1 _1) \
1263+ { \
1264+ static return_type (*f)(arg1) __attribute__((pcs("aapcs"))) = NULL; \
1265+ DLSYM(&f, #symbol); \
1266+ return f(_1); }
1267+
1268+
1269+#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1) \
1270+ void symbol(arg1 _1) \
1271+ { \
1272+ static void (*f)(arg1) = NULL; \
1273+ DLSYM(&f, #symbol); \
1274+ f(_1); }
1275+
1276+#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2) \
1277+ return_type symbol(arg1 _1, arg2 _2) \
1278+ { \
1279+ static return_type (*f)(arg1, arg2) = NULL; \
1280+ DLSYM(&f, #symbol); \
1281+ return f(_1, _2); }
1282+
1283+#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2) \
1284+ void symbol(arg1 _1, arg2 _2) \
1285+ { \
1286+ static void (*f)(arg1, arg2) = NULL; \
1287+ DLSYM(&f, #symbol); \
1288+ f(_1, _2); }
1289+
1290+#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3) \
1291+ return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
1292+ { \
1293+ static return_type (*f)(arg1, arg2, arg3) = NULL; \
1294+ DLSYM(&f, #symbol); \
1295+ return f(_1, _2, _3); }
1296+
1297+#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3) \
1298+ void symbol(arg1 _1, arg2 _2, arg3 _3) \
1299+ { \
1300+ static void (*f)(arg1, arg2, arg3) = NULL; \
1301+ DLSYM(&f, #symbol); \
1302+ f(_1, _2, _3); }
1303+
1304+#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
1305+ void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
1306+ { \
1307+ static void (*f)(arg1, arg2, arg3, arg4) = NULL; \
1308+ DLSYM(&f, #symbol); \
1309+ f(_1, _2, _3, _4); }
1310+
1311+#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
1312+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
1313+ { \
1314+ static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
1315+ DLSYM(&f, #symbol); \
1316+ return f(_1, _2, _3, _4); }
1317+
1318+#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
1319+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
1320+ { \
1321+ static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
1322+ DLSYM(&f, #symbol); \
1323+ return f(_1, _2, _3, _4, _5, _6); }
1324+
1325+#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
1326+ void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
1327+ { \
1328+ static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
1329+ DLSYM(&f, #symbol); \
1330+ f(_1, _2, _3, _4, _5, _6, _7); }
1331+
1332+#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
1333+ void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
1334+ { \
1335+ static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
1336+ DLSYM(&f, #symbol); \
1337+ f(_1, _2, _3, _4, _5, _6, _7, _8); }
1338+
1339+#ifdef __cplusplus
1340+}
1341+#endif
1342+
1343+#endif // BRIDGE_H_
1344
1345=== removed file 'src/hybris/hybris_bridge.cpp'
1346--- src/hybris/hybris_bridge.cpp 2013-06-05 22:34:41 +0000
1347+++ src/hybris/hybris_bridge.cpp 1970-01-01 00:00:00 +0000
1348@@ -1,59 +0,0 @@
1349-/*
1350- * Copyright (C) 2013 Canonical Ltd
1351- *
1352- * This program is free software: you can redistribute it and/or modify
1353- * it under the terms of the GNU Lesser General Public License version 3 as
1354- * published by the Free Software Foundation.
1355- *
1356- * This program is distributed in the hope that it will be useful,
1357- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1358- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1359- * GNU Lesser General Public License for more details.
1360- *
1361- * You should have received a copy of the GNU Lesser General Public License
1362- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1363- *
1364- * Authored by: Thomas Voss <thomas.voss@canonical.com>
1365- * Ricardo Mendoza <ricardo.mendoza@canonical.com>
1366- */
1367-
1368-#include "hybris_bridge.h"
1369-
1370-#include <dlfcn.h>
1371-#include <assert.h>
1372-
1373-namespace uh = ubuntu::hybris;
1374-
1375-extern "C" {
1376-
1377-extern void *android_dlopen(const char *filename, int flag);
1378-extern void *android_dlsym(void *handle, const char *symbol);
1379-
1380-}
1381-
1382-const char* uh::Bridge::path_to_library()
1383-{
1384- return "/system/lib/libubuntu_application_api.so";
1385-}
1386-
1387-uh::Bridge& uh::Bridge::instance()
1388-{
1389- static uh::Bridge bridge;
1390- return bridge;
1391-}
1392-
1393-uh::Bridge::Bridge()
1394- : lib_handle(android_dlopen(path_to_library(), RTLD_LAZY))
1395-{
1396- assert(lib_handle && "Error loading ubuntu_application_api");
1397-}
1398-
1399-uh::Bridge::~Bridge()
1400-{
1401- // TODO android_dlclose(libcamera_handle);
1402-}
1403-
1404-void* uh::Bridge::resolve_symbol(const char* symbol) const
1405-{
1406- return android_dlsym(lib_handle, symbol);
1407-}
1408
1409=== removed file 'src/hybris/hybris_bridge.h'
1410--- src/hybris/hybris_bridge.h 2013-06-05 23:44:55 +0000
1411+++ src/hybris/hybris_bridge.h 1970-01-01 00:00:00 +0000
1412@@ -1,148 +0,0 @@
1413-/*
1414- * Copyright (C) 2013 Canonical Ltd
1415- *
1416- * This program is free software: you can redistribute it and/or modify
1417- * it under the terms of the GNU Lesser General Public License version 3 as
1418- * published by the Free Software Foundation.
1419- *
1420- * This program is distributed in the hope that it will be useful,
1421- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1422- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1423- * GNU Lesser General Public License for more details.
1424- *
1425- * You should have received a copy of the GNU Lesser General Public License
1426- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1427- *
1428- * Authored by: Thomas Voss <thomas.voss@canonical.com>
1429- * Ricardo Mendoza <ricardo.mendoza@canonical.com>
1430- */
1431-
1432-#ifndef UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
1433-#define UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
1434-
1435-#include <stddef.h>
1436-
1437-namespace ubuntu
1438-{
1439-namespace hybris
1440-{
1441-
1442-struct Bridge
1443-{
1444- Bridge();
1445- ~Bridge();
1446-
1447- static const char* path_to_library();
1448- static Bridge& instance();
1449-
1450- void* resolve_symbol(const char* symbol) const;
1451-
1452- void* lib_handle;
1453-};
1454-
1455-}
1456-}
1457-
1458-// Sweet and beautiful music.
1459-#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) ubuntu::hybris::Bridge::instance().resolve_symbol(sym); }
1460-
1461-#define IMPLEMENT_FUNCTION0(return_type, symbol) \
1462- return_type symbol() \
1463- { \
1464- static return_type (*f)() = NULL; \
1465- DLSYM(&f, #symbol); \
1466- return f();}
1467-
1468-#define IMPLEMENT_VOID_FUNCTION0(symbol) \
1469- void symbol() \
1470- { \
1471- static void (*f)() = NULL; \
1472- DLSYM(&f, #symbol); \
1473- f();}
1474-
1475-#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
1476- return_type symbol(arg1 _1) \
1477- { \
1478- static return_type (*f)(arg1) = NULL; \
1479- DLSYM(&f, #symbol); \
1480- return f(_1); }
1481-
1482-#define IMPLEMENT_SF_FUNCTION1(return_type, symbol, arg1) \
1483- return_type symbol(arg1 _1) \
1484- { \
1485- static return_type (*f)(arg1) __attribute__((pcs("aapcs"))) = NULL; \
1486- DLSYM(&f, #symbol); \
1487- return f(_1); }
1488-
1489-
1490-#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1) \
1491- void symbol(arg1 _1) \
1492- { \
1493- static void (*f)(arg1) = NULL; \
1494- DLSYM(&f, #symbol); \
1495- f(_1); }
1496-
1497-#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2) \
1498- return_type symbol(arg1 _1, arg2 _2) \
1499- { \
1500- static return_type (*f)(arg1, arg2) = NULL; \
1501- DLSYM(&f, #symbol); \
1502- return f(_1, _2); }
1503-
1504-#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2) \
1505- void symbol(arg1 _1, arg2 _2) \
1506- { \
1507- static void (*f)(arg1, arg2) = NULL; \
1508- DLSYM(&f, #symbol); \
1509- f(_1, _2); }
1510-
1511-#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3) \
1512- return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
1513- { \
1514- static return_type (*f)(arg1, arg2, arg3) = NULL; \
1515- DLSYM(&f, #symbol); \
1516- return f(_1, _2, _3); }
1517-
1518-#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3) \
1519- void symbol(arg1 _1, arg2 _2, arg3 _3) \
1520- { \
1521- static void (*f)(arg1, arg2, arg3) = NULL; \
1522- DLSYM(&f, #symbol); \
1523- f(_1, _2, _3); }
1524-
1525-#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
1526- void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
1527- { \
1528- static void (*f)(arg1, arg2, arg3, arg4) = NULL; \
1529- DLSYM(&f, #symbol); \
1530- f(_1, _2, _3, _4); }
1531-
1532-#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
1533- return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
1534- { \
1535- static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
1536- DLSYM(&f, #symbol); \
1537- return f(_1, _2, _3, _4); }
1538-
1539-#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
1540- return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
1541- { \
1542- static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
1543- DLSYM(&f, #symbol); \
1544- return f(_1, _2, _3, _4, _5, _6); }
1545-
1546-#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
1547- void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
1548- { \
1549- static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
1550- DLSYM(&f, #symbol); \
1551- f(_1, _2, _3, _4, _5, _6, _7); }
1552-
1553-#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
1554- void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
1555- { \
1556- static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
1557- DLSYM(&f, #symbol); \
1558- f(_1, _2, _3, _4, _5, _6, _7, _8); }
1559-
1560-#endif // UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
1561
1562=== modified file 'src/hybris/tests/CMakeLists.txt'
1563--- src/hybris/tests/CMakeLists.txt 2013-06-03 20:54:26 +0000
1564+++ src/hybris/tests/CMakeLists.txt 2013-07-05 16:24:25 +0000
1565@@ -4,7 +4,7 @@
1566 target_link_libraries(test_android_ubuntu_app_api ubuntu_application_api EGL GLESv2)
1567
1568 add_executable(test_android_gps_api test_gps_api.cpp)
1569-target_link_libraries(test_android_gps_api ubuntu_application_api)
1570+target_link_libraries(test_android_gps_api ubuntu_platform_hardware_api)
1571
1572 add_executable(test_android_ubuntu_app_api_multiple_surfaces test_multiple_surfaces_event_delivery.cpp)
1573 target_link_libraries(test_android_ubuntu_app_api_multiple_surfaces ubuntu_application_api EGL GLESv2)
1574
1575=== modified file 'src/hybris/tests/test_gps_api.cpp'
1576--- src/hybris/tests/test_gps_api.cpp 2013-02-05 08:01:14 +0000
1577+++ src/hybris/tests/test_gps_api.cpp 2013-07-05 16:24:25 +0000
1578@@ -15,7 +15,7 @@
1579 *
1580 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
1581 */
1582-#include <ubuntu/application/ubuntu_application_gps.h>
1583+#include <ubuntu/hardware/gps.h>
1584
1585 #include <ctime>
1586 #include <signal.h>
1587@@ -23,6 +23,8 @@
1588 #include <string.h>
1589 #include <unistd.h>
1590
1591+namespace ubuntu
1592+{
1593 class GPSTest
1594 {
1595 public:
1596@@ -32,10 +34,10 @@
1597 bool stop();
1598 void inject_time();
1599
1600- UbuntuGps ubuntu_gps;
1601+ UHardwareGps u_hardware_gps;
1602 };
1603
1604-void gps_location_cb(UbuntuGpsLocation* location, void* context)
1605+void gps_location_cb(UHardwareGpsLocation* location, void* context)
1606 {
1607 printf("gps_location_cb() called.\n");
1608 }
1609@@ -44,26 +46,26 @@
1610 {
1611 switch(status)
1612 {
1613- case UBUNTU_GPS_STATUS_NONE:
1614+ case U_HARDWARE_GPS_STATUS_NONE:
1615 printf("status: None\n");
1616 break;
1617- case UBUNTU_GPS_STATUS_SESSION_BEGIN:
1618+ case U_HARDWARE_GPS_STATUS_SESSION_BEGIN:
1619 printf("status: Session Begin\n");
1620 break;
1621- case UBUNTU_GPS_STATUS_SESSION_END:
1622+ case U_HARDWARE_GPS_STATUS_SESSION_END:
1623 printf("status: Session End\n");
1624 break;
1625- case UBUNTU_GPS_STATUS_ENGINE_ON:
1626+ case U_HARDWARE_GPS_STATUS_ENGINE_ON:
1627 printf("status: Engine On\n");
1628 break;
1629- case UBUNTU_GPS_STATUS_ENGINE_OFF:
1630+ case U_HARDWARE_GPS_STATUS_ENGINE_OFF:
1631 printf("status: Engine Off\n");
1632 default:
1633 break;
1634 };
1635 }
1636
1637-void gps_sb_status_cb(UbuntuGpsSvStatus* sv_info, void* context)
1638+void gps_sb_status_cb(UHardwareGpsSvStatus* sv_info, void* context)
1639 {
1640 printf("gps_sb_status_cb() called, listing %d space vehicles\n", sv_info->num_svs);
1641 }
1642@@ -80,15 +82,15 @@
1643 {
1644 printf("gps_set_cabapilities_cb() -");
1645
1646- if (capabilities & UBUNTU_GPS_CAPABILITY_SCHEDULING)
1647+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_SCHEDULING)
1648 printf(" scheduling");
1649- if (capabilities & UBUNTU_GPS_CAPABILITY_MSB)
1650+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSB)
1651 printf(" MSB");
1652- if (capabilities & UBUNTU_GPS_CAPABILITY_MSA)
1653+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSA)
1654 printf(" MSA");
1655- if (capabilities & UBUNTU_GPS_CAPABILITY_SINGLE_SHOT)
1656+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT)
1657 printf(" 'single shot'");
1658- if (capabilities & UBUNTU_GPS_CAPABILITY_ON_DEMAND_TIME)
1659+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME)
1660 printf(" 'on demand time'");
1661
1662 printf("\n");
1663@@ -105,31 +107,31 @@
1664 printf("gps_xtra_download_request_cb() called.\n");
1665 }
1666
1667-void agps_status_cb(UbuntuAgpsStatus* status, void* context)
1668+void agps_status_cb(UHardwareGpsAGpsStatus* status, void* context)
1669 {
1670 printf("agps status -");
1671
1672- if (status->type == UBUNTU_AGPS_TYPE_SUPL)
1673+ if (status->type == U_HARDWARE_GPS_AGPS_TYPE_SUPL)
1674 printf(" SUPL");
1675 else
1676 printf(" C2K");
1677
1678 switch (status->status)
1679 {
1680- case UBUNTU_GPS_REQUEST_AGPS_DATA_CONN:
1681+ case U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN:
1682 printf(", request AGPS data connection");
1683 break;
1684- case UBUNTU_GPS_RELEASE_AGPS_DATA_CONN:
1685+ case U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN:
1686 printf(", release AGPS data connection");
1687 break;
1688- case UBUNTU_GPS_AGPS_DATA_CONNECTED:
1689+ case U_HARDWARE_GPS_AGPS_DATA_CONNECTED:
1690 printf(", request AGPS data connected");
1691 break;
1692- case UBUNTU_GPS_AGPS_DATA_CONN_DONE:
1693+ case U_HARDWARE_GPS_AGPS_DATA_CONN_DONE:
1694 printf(", AGPS data connection done");
1695 break;
1696 default:
1697- case UBUNTU_GPS_AGPS_DATA_CONN_FAILED:
1698+ case U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED:
1699 printf(", AGPS data connection failed");
1700 break;
1701 }
1702@@ -137,7 +139,7 @@
1703 printf(" ipaddr=%u\n", status->ipaddr);
1704 }
1705
1706-void gps_notify_cb(UbuntuGpsNiNotification *notification, void* context)
1707+void gps_notify_cb(UHardwareGpsNiNotification *notification, void* context)
1708 {
1709 printf("gps_notify_cb() called.\n");
1710 }
1711@@ -153,14 +155,14 @@
1712 }
1713
1714 GPSTest::GPSTest()
1715- : ubuntu_gps(NULL)
1716+ : u_hardware_gps(NULL)
1717 {
1718 }
1719
1720 GPSTest::~GPSTest()
1721 {
1722- if (ubuntu_gps)
1723- ubuntu_gps_delete(ubuntu_gps);
1724+ if (u_hardware_gps)
1725+ u_hardware_gps_delete(u_hardware_gps);
1726 }
1727
1728 void GPSTest::inject_time()
1729@@ -168,7 +170,7 @@
1730 // A real implementation would inject time from some NTP server.
1731 time_t t = time(0);
1732 int64_t time_millis = (int64_t)t * (int64_t)1000;
1733- ubuntu_gps_inject_time(ubuntu_gps,
1734+ u_hardware_gps_inject_time(u_hardware_gps,
1735 time_millis /*NTP time would go here*/,
1736 time_millis /*internal time when that NTP time was taken*/,
1737 10 /* possible deviation, in milliseconds*/);
1738@@ -176,7 +178,7 @@
1739
1740 bool GPSTest::init_and_start()
1741 {
1742- UbuntuGpsParams gps_params;
1743+ UHardwareGpsParams gps_params;
1744
1745 gps_params.location_cb = gps_location_cb;
1746 gps_params.status_cb = gps_status_cb;
1747@@ -191,14 +193,14 @@
1748 gps_params.request_refloc_cb = agps_ril_request_refloc_cb;
1749 gps_params.context = this;
1750
1751- UbuntuGps ubuntu_gps = ubuntu_gps_new(&gps_params);
1752- if (!ubuntu_gps)
1753+ UHardwareGps u_hardware_gps = u_hardware_gps_new(&gps_params);
1754+ if (!u_hardware_gps)
1755 {
1756 printf("GPS creation failed!\n");
1757 return false;
1758 }
1759
1760- bool ok = ubuntu_gps_start(ubuntu_gps);
1761+ bool ok = u_hardware_gps_start(u_hardware_gps);
1762 if (!ok)
1763 {
1764 printf("GPS start up failed!\n");
1765@@ -210,12 +212,13 @@
1766
1767 bool GPSTest::stop()
1768 {
1769- bool ok = ubuntu_gps_stop(ubuntu_gps);
1770+ bool ok = u_hardware_gps_stop(u_hardware_gps);
1771 if (!ok)
1772 printf("failed when stopping GPS!\n");
1773
1774 return ok;
1775 }
1776+}
1777
1778 void wait_for_sigint()
1779 {
1780@@ -232,7 +235,7 @@
1781 int main(int argc, char** argv)
1782 {
1783 int return_value = 0;
1784- GPSTest test;
1785+ ubuntu::GPSTest test;
1786
1787 if (!test.init_and_start())
1788 return 1;
1789
1790=== modified file 'src/hybris/ubuntu_application_api_hybris.cpp'
1791--- src/hybris/ubuntu_application_api_hybris.cpp 2013-06-18 00:05:11 +0000
1792+++ src/hybris/ubuntu_application_api_hybris.cpp 2013-07-05 16:24:25 +0000
1793@@ -19,7 +19,6 @@
1794
1795 #include <private/application/ui/ubuntu_application_ui.h>
1796
1797-#include <ubuntu/application/ubuntu_application_gps.h>
1798 #include <ubuntu/ui/ubuntu_ui_session_service.h>
1799
1800 // C APIs
1801@@ -30,21 +29,12 @@
1802 #include <ubuntu/application/ui/clipboard.h>
1803 #include <ubuntu/application/ui/display.h>
1804
1805-#include <assert.h>
1806-#include <dlfcn.h>
1807-#include <stddef.h>
1808-
1809-#include "hybris_bridge.h"
1810+#include "bridge.h"
1811
1812 #ifdef __cplusplus
1813 extern "C" {
1814 #endif
1815
1816-/**********************************************************/
1817-/*********** Implementation starts here *******************/
1818-/**********************************************************/
1819-
1820-
1821 // Session helpers
1822 IMPLEMENT_FUNCTION0(UAUiSessionProperties*, ua_ui_session_properties_new);
1823 IMPLEMENT_VOID_FUNCTION2(ua_ui_session_properties_set_type, UAUiSessionProperties*, UAUiSessionType);
1824@@ -135,18 +125,6 @@
1825 IMPLEMENT_VOID_FUNCTION0(ubuntu_ui_report_notification_invisible);
1826 IMPLEMENT_VOID_FUNCTION1(ubuntu_ui_install_task_controller, ubuntu_ui_task_controller*);
1827
1828-// GPS
1829-IMPLEMENT_FUNCTION1(UbuntuGps, ubuntu_gps_new, UbuntuGpsParams*);
1830-IMPLEMENT_VOID_FUNCTION1(ubuntu_gps_delete, UbuntuGps);
1831-IMPLEMENT_FUNCTION1(bool, ubuntu_gps_start, UbuntuGps);
1832-IMPLEMENT_FUNCTION1(bool, ubuntu_gps_stop, UbuntuGps);
1833-IMPLEMENT_VOID_FUNCTION4(ubuntu_gps_inject_time, UbuntuGps, int64_t, int64_t, int);
1834-IMPLEMENT_VOID_FUNCTION4(ubuntu_gps_inject_location, UbuntuGps, double, double, float);
1835-IMPLEMENT_VOID_FUNCTION2(ubuntu_gps_delete_aiding_data, UbuntuGps, uint16_t);
1836-IMPLEMENT_FUNCTION6(bool, ubuntu_gps_set_position_mode, UbuntuGps, uint32_t, uint32_t,
1837- uint32_t, uint32_t, uint32_t);
1838-IMPLEMENT_VOID_FUNCTION3(ubuntu_gps_inject_xtra_data, UbuntuGps, char*, int);
1839-
1840 #ifdef __cplusplus
1841 }
1842 #endif
1843
1844=== modified file 'src/hybris/ubuntu_application_sensors_hybris.cpp'
1845--- src/hybris/ubuntu_application_sensors_hybris.cpp 2013-06-05 22:59:25 +0000
1846+++ src/hybris/ubuntu_application_sensors_hybris.cpp 2013-07-05 16:24:25 +0000
1847@@ -21,7 +21,7 @@
1848 #include <ubuntu/application/sensors/proximity.h>
1849 #include <ubuntu/application/sensors/light.h>
1850
1851-#include "hybris_bridge.h"
1852+#include "bridge.h"
1853
1854 // Ubuntu Application Sensors
1855
1856
1857=== added file 'src/hybris/ubuntu_platform_hardware_api.cpp'
1858--- src/hybris/ubuntu_platform_hardware_api.cpp 1970-01-01 00:00:00 +0000
1859+++ src/hybris/ubuntu_platform_hardware_api.cpp 2013-07-05 16:24:25 +0000
1860@@ -0,0 +1,78 @@
1861+/*
1862+ * Copyright (C) 2012 Canonical Ltd
1863+ *
1864+ * This program is free software: you can redistribute it and/or modify
1865+ * it under the terms of the GNU Lesser General Public License version 3 as
1866+ * published by the Free Software Foundation.
1867+ *
1868+ * This program is distributed in the hope that it will be useful,
1869+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1870+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1871+ * GNU Lesser General Public License for more details.
1872+ *
1873+ * You should have received a copy of the GNU Lesser General Public License
1874+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1875+ *
1876+ * Authored by: Thomas Voss <thomas.voss@canonical.com>
1877+ * Ricardo Mendoza <ricardo.mendoza@canonical.com>
1878+ */
1879+
1880+// C APIs
1881+#include <ubuntu/hardware/gps.h>
1882+
1883+#include "bridge.h"
1884+
1885+// Hardware - GPS
1886+IMPLEMENT_FUNCTION1(
1887+UHardwareGps,
1888+u_hardware_gps_new,
1889+UHardwareGpsParams*);
1890+
1891+IMPLEMENT_VOID_FUNCTION1(
1892+u_hardware_gps_delete,
1893+UHardwareGps);
1894+
1895+IMPLEMENT_FUNCTION1(
1896+bool,
1897+u_hardware_gps_start,
1898+UHardwareGps);
1899+
1900+IMPLEMENT_FUNCTION1(
1901+bool,
1902+u_hardware_gps_stop,
1903+UHardwareGps);
1904+
1905+IMPLEMENT_VOID_FUNCTION4(
1906+u_hardware_gps_inject_time,
1907+UHardwareGps,
1908+int64_t,
1909+int64_t,
1910+int);
1911+
1912+IMPLEMENT_VOID_FUNCTION4(
1913+u_hardware_gps_inject_location,
1914+UHardwareGps,
1915+double,
1916+double,
1917+float);
1918+
1919+IMPLEMENT_VOID_FUNCTION2(
1920+u_hardware_gps_delete_aiding_data,
1921+UHardwareGps,
1922+uint16_t);
1923+
1924+IMPLEMENT_FUNCTION6(
1925+bool,
1926+u_hardware_gps_set_position_mode,
1927+UHardwareGps,
1928+uint32_t,
1929+uint32_t,
1930+uint32_t,
1931+uint32_t,
1932+uint32_t);
1933+
1934+IMPLEMENT_VOID_FUNCTION3(
1935+u_hardware_gps_inject_xtra_data,
1936+UHardwareGps,
1937+char*,
1938+int);

Subscribers

People subscribed via source and target branches