Merge lp:~thomas-voss/platform-api/add-documentation-part-1 into lp:platform-api

Proposed by Thomas Voß
Status: Superseded
Proposed branch: lp:~thomas-voss/platform-api/add-documentation-part-1
Merge into: lp:platform-api
Diff against target: 3480 lines (+1496/-741) (has conflicts)
36 files modified
CMakeLists.txt (+1/-1)
android/hybris/ubuntu_application_gps_for_hybris.cpp (+50/-50)
debian/changelog (+9/-0)
debian/libplatform-api1-dev.doc-base (+8/-0)
debian/libplatform-api1-dev.install (+1/-0)
debian/libplatform-api1-hybris.install (+2/-1)
debian/libplatform-api1-hybris.symbols (+19/-17)
doc/CMakeLists.txt (+1/-1)
doc/Doxyfile.in (+12/-12)
doc/mainpage.md (+1/-1)
include/ubuntu/application/CMakeLists.txt (+1/-2)
include/ubuntu/application/archive.h (+280/-108)
include/ubuntu/application/description.h (+55/-17)
include/ubuntu/application/id.h (+31/-9)
include/ubuntu/application/instance.h (+47/-13)
include/ubuntu/application/lifecycle_delegate.h (+86/-14)
include/ubuntu/application/operation_mode.h (+7/-3)
include/ubuntu/application/options.h (+31/-9)
include/ubuntu/application/sensors/accelerometer.h (+62/-4)
include/ubuntu/application/sensors/event/accelerometer.h (+31/-3)
include/ubuntu/application/sensors/event/light.h (+17/-1)
include/ubuntu/application/sensors/event/proximity.h (+27/-5)
include/ubuntu/application/sensors/light.h (+71/-13)
include/ubuntu/application/sensors/proximity.h (+62/-4)
include/ubuntu/hardware/gps.h (+226/-174)
include/ubuntu/status.h (+8/-3)
include/ubuntu/unit.h (+8/-5)
src/hybris/CMakeLists.txt (+26/-7)
src/hybris/bridge.h (+200/-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)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~thomas-voss/platform-api/add-documentation-part-1
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+173159@code.launchpad.net

This proposal has been superseded by a proposal from 2013-07-05.

Commit message

Add first wave of doxygen documentation and make the documentation known to the packaging setup.

Description of the change

Add first wave of doxygen documentation and make the documentation known to the packaging setup.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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

84. By Thomas Voß

Addressing review comments.

85. By Thomas Voß

 Adjust Document:-line.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-07-03 07:23:59 +0000
+++ CMakeLists.txt 2013-07-05 09:17:25 +0000
@@ -80,7 +80,7 @@
80)80)
8181
82if(NOT Hybris)82if(NOT Hybris)
83 message("Notice: libhybris-common.so not found, disabling hybris support")83 message(STATUS "Notice: libhybris-common.so not found, disabling hybris support")
84 set(ENABLE_HYBRIS_IMPLEMENTATION OFF)84 set(ENABLE_HYBRIS_IMPLEMENTATION OFF)
85endif()85endif()
8686
8787
=== modified file 'android/hybris/ubuntu_application_gps_for_hybris.cpp'
--- android/hybris/ubuntu_application_gps_for_hybris.cpp 2013-02-05 07:46:29 +0000
+++ android/hybris/ubuntu_application_gps_for_hybris.cpp 2013-07-05 09:17:25 +0000
@@ -15,7 +15,7 @@
15 *15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 */17 */
18#include <ubuntu/application/ubuntu_application_gps.h>18#include <ubuntu/hardware/gps.h>
1919
20#include <pthread.h>20#include <pthread.h>
2121
@@ -23,12 +23,12 @@
23#include <hardware/gps.h>23#include <hardware/gps.h>
24#include <hardware_legacy/power.h>24#include <hardware_legacy/power.h>
2525
26#define WAKE_LOCK_NAME "UBUNTU_GPS"26#define WAKE_LOCK_NAME "U_HARDWARE_GPS"
2727
28struct UbuntuGps_28struct UHardwareGps_
29{29{
30 UbuntuGps_(UbuntuGpsParams* params);30 UHardwareGps_(UHardwareGpsParams* params);
31 ~UbuntuGps_();31 ~UHardwareGps_();
3232
33 bool init();33 bool init();
3434
@@ -48,28 +48,28 @@
48 const GpsDebugInterface* gps_debug_interface;48 const GpsDebugInterface* gps_debug_interface;
49 const AGpsRilInterface* agps_ril_interface;49 const AGpsRilInterface* agps_ril_interface;
5050
51 UbuntuGpsLocationCallback location_cb;51 UHardwareGpsLocationCallback location_cb;
52 UbuntuGpsStatusCallback status_cb;52 UHardwareGpsStatusCallback status_cb;
53 UbuntuGpsSvStatusCallback sv_status_cb;53 UHardwareGpsSvStatusCallback sv_status_cb;
54 UbuntuGpsNmeaCallback nmea_cb;54 UHardwareGpsNmeaCallback nmea_cb;
55 UbuntuGpsSetCapabilities set_capabilities_cb;55 UHardwareGpsSetCapabilities set_capabilities_cb;
56 UbuntuGpsRequestUtcTime request_utc_time_cb;56 UHardwareGpsRequestUtcTime request_utc_time_cb;
5757
58 UbuntuGpsXtraDownloadRequest xtra_download_request_cb;58 UHardwareGpsXtraDownloadRequest xtra_download_request_cb;
5959
60 UbuntuAgpsStatusCallback agps_status_cb;60 UHardwareGpsAGpsStatusCallback agps_status_cb;
6161
62 UbuntuGpsNiNotifyCallback gps_ni_notify_cb;62 UHardwareGpsNiNotifyCallback gps_ni_notify_cb;
6363
64 UbuntuAgpsRilRequestSetId request_setid_cb;64 UHardwareGpsAGpsRilRequestSetId request_setid_cb;
65 UbuntuAgpsRilRequestRefLoc request_refloc_cb;65 UHardwareGpsAGpsRilRequestRefLoc request_refloc_cb;
6666
67 void* context;67 void* context;
68};68};
6969
70namespace70namespace
71{71{
72UbuntuGps hybris_gps_instance = NULL;72UHardwareGps hybris_gps_instance = NULL;
73}73}
7474
75static void location_callback(GpsLocation* location)75static void location_callback(GpsLocation* location)
@@ -78,7 +78,7 @@
78 return;78 return;
7979
80 hybris_gps_instance->location_cb(80 hybris_gps_instance->location_cb(
81 reinterpret_cast<UbuntuGpsLocation*>(location),81 reinterpret_cast<UHardwareGpsLocation*>(location),
82 hybris_gps_instance->context);82 hybris_gps_instance->context);
83}83}
8484
@@ -96,7 +96,7 @@
96 return;96 return;
9797
98 hybris_gps_instance->sv_status_cb(98 hybris_gps_instance->sv_status_cb(
99 reinterpret_cast<UbuntuGpsSvStatus*>(sv_status),99 reinterpret_cast<UHardwareGpsSvStatus*>(sv_status),
100 hybris_gps_instance->context);100 hybris_gps_instance->context);
101}101}
102102
@@ -202,7 +202,7 @@
202 */202 */
203203
204 hybris_gps_instance->agps_status_cb(204 hybris_gps_instance->agps_status_cb(
205 reinterpret_cast<UbuntuAgpsStatus*>(agps_status), hybris_gps_instance->context);205 reinterpret_cast<UHardwareGpsAGpsStatus*>(agps_status), hybris_gps_instance->context);
206}206}
207207
208AGpsCallbacks agps_callbacks =208AGpsCallbacks agps_callbacks =
@@ -215,7 +215,7 @@
215{215{
216 if (hybris_gps_instance)216 if (hybris_gps_instance)
217 hybris_gps_instance->gps_ni_notify_cb(217 hybris_gps_instance->gps_ni_notify_cb(
218 reinterpret_cast<UbuntuGpsNiNotification*>(notification),218 reinterpret_cast<UHardwareGpsNiNotification*>(notification),
219 hybris_gps_instance->context);219 hybris_gps_instance->context);
220}220}
221221
@@ -245,7 +245,7 @@
245};245};
246246
247247
248UbuntuGps_::UbuntuGps_(UbuntuGpsParams* params)248UHardwareGps_::UHardwareGps_(UHardwareGpsParams* params)
249 : gps_interface(NULL),249 : gps_interface(NULL),
250 gps_xtra_interface(NULL),250 gps_xtra_interface(NULL),
251 agps_interface(NULL),251 agps_interface(NULL),
@@ -294,13 +294,13 @@
294 }294 }
295}295}
296296
297UbuntuGps_::~UbuntuGps_()297UHardwareGps_::~UHardwareGps_()
298{298{
299 if (gps_interface)299 if (gps_interface)
300 gps_interface->cleanup();300 gps_interface->cleanup();
301}301}
302302
303bool UbuntuGps_::init()303bool UHardwareGps_::init()
304{304{
305 // fail if the main interface fails to initialize305 // fail if the main interface fails to initialize
306 if (!gps_interface || gps_interface->init(&gps_callbacks) != 0)306 if (!gps_interface || gps_interface->init(&gps_callbacks) != 0)
@@ -320,7 +320,7 @@
320 return true;320 return true;
321}321}
322322
323bool UbuntuGps_::start()323bool UHardwareGps_::start()
324{324{
325 if (gps_interface)325 if (gps_interface)
326 return (gps_interface->start() == 0);326 return (gps_interface->start() == 0);
@@ -328,7 +328,7 @@
328 return false;328 return false;
329}329}
330330
331bool UbuntuGps_::stop()331bool UHardwareGps_::stop()
332{332{
333 if (gps_interface)333 if (gps_interface)
334 return (gps_interface->stop() == 0);334 return (gps_interface->stop() == 0);
@@ -336,25 +336,25 @@
336 return false;336 return false;
337}337}
338338
339void UbuntuGps_::inject_time(int64_t time, int64_t time_reference, int uncertainty)339void UHardwareGps_::inject_time(int64_t time, int64_t time_reference, int uncertainty)
340{340{
341 if (gps_interface)341 if (gps_interface)
342 gps_interface->inject_time(time, time_reference, uncertainty);342 gps_interface->inject_time(time, time_reference, uncertainty);
343}343}
344344
345void UbuntuGps_::inject_location(double latitude, double longitude, float accuracy)345void UHardwareGps_::inject_location(double latitude, double longitude, float accuracy)
346{346{
347 if (gps_interface)347 if (gps_interface)
348 gps_interface->inject_location(latitude, longitude, accuracy);348 gps_interface->inject_location(latitude, longitude, accuracy);
349}349}
350350
351void UbuntuGps_::delete_aiding_data(uint16_t flags)351void UHardwareGps_::delete_aiding_data(uint16_t flags)
352{352{
353 if (gps_interface)353 if (gps_interface)
354 gps_interface->delete_aiding_data(flags);354 gps_interface->delete_aiding_data(flags);
355}355}
356356
357bool UbuntuGps_::set_position_mode(uint32_t mode, uint32_t recurrence, uint32_t min_interval,357bool UHardwareGps_::set_position_mode(uint32_t mode, uint32_t recurrence, uint32_t min_interval,
358 uint32_t preferred_accuracy, uint32_t preferred_time)358 uint32_t preferred_accuracy, uint32_t preferred_time)
359{359{
360 if (gps_interface)360 if (gps_interface)
@@ -364,7 +364,7 @@
364 return false;364 return false;
365}365}
366366
367void UbuntuGps_::inject_xtra_data(char* data, int length)367void UHardwareGps_::inject_xtra_data(char* data, int length)
368{368{
369 if (gps_xtra_interface)369 if (gps_xtra_interface)
370 gps_xtra_interface->inject_xtra_data(data, length);370 gps_xtra_interface->inject_xtra_data(data, length);
@@ -373,58 +373,58 @@
373/////////////////////////////////////////////////////////////////////373/////////////////////////////////////////////////////////////////////
374// Implementation of the C API374// Implementation of the C API
375375
376UbuntuGps ubuntu_gps_new(UbuntuGpsParams* params)376UHardwareGps u_hardware_gps_new(UHardwareGpsParams* params)
377{377{
378 if (hybris_gps_instance != NULL)378 if (hybris_gps_instance != NULL)
379 return NULL;379 return NULL;
380380
381 UbuntuGps ubuntu_gps = new UbuntuGps_(params);381 UHardwareGps u_hardware_gps = new UHardwareGps_(params);
382 hybris_gps_instance = ubuntu_gps;382 hybris_gps_instance = u_hardware_gps;
383383
384 if (!ubuntu_gps->init())384 if (!u_hardware_gps->init())
385 {385 {
386 delete ubuntu_gps;386 delete u_hardware_gps;
387 ubuntu_gps = NULL;387 u_hardware_gps = NULL;
388 }388 }
389389
390 return ubuntu_gps;390 return u_hardware_gps;
391}391}
392392
393void ubuntu_gps_delete(UbuntuGps handle)393void u_hardware_gps_delete(UHardwareGps handle)
394{394{
395 delete handle;395 delete handle;
396 if (handle == hybris_gps_instance)396 if (handle == hybris_gps_instance)
397 hybris_gps_instance = NULL;397 hybris_gps_instance = NULL;
398}398}
399399
400bool ubuntu_gps_start(UbuntuGps self)400bool u_hardware_gps_start(UHardwareGps self)
401{401{
402 return self->start();402 return self->start();
403}403}
404404
405bool ubuntu_gps_stop(UbuntuGps self)405bool u_hardware_gps_stop(UHardwareGps self)
406{406{
407 return self->stop();407 return self->stop();
408}408}
409409
410void ubuntu_gps_inject_time(UbuntuGps self, int64_t time, int64_t time_reference,410void u_hardware_gps_inject_time(UHardwareGps self, int64_t time, int64_t time_reference,
411 int uncertainty)411 int uncertainty)
412{412{
413 self->inject_time(time, time_reference, uncertainty);413 self->inject_time(time, time_reference, uncertainty);
414}414}
415415
416void ubuntu_gps_inject_location(UbuntuGps self, double latitude, double longitude,416void u_hardware_gps_inject_location(UHardwareGps self, double latitude, double longitude,
417 float accuracy)417 float accuracy)
418{418{
419 self->inject_location(latitude, longitude, accuracy);419 self->inject_location(latitude, longitude, accuracy);
420}420}
421421
422void ubuntu_gps_delete_aiding_data(UbuntuGps self, uint16_t flags)422void u_hardware_gps_delete_aiding_data(UHardwareGps self, uint16_t flags)
423{423{
424 self->delete_aiding_data(flags);424 self->delete_aiding_data(flags);
425}425}
426426
427bool ubuntu_gps_set_position_mode(UbuntuGps self, uint32_t mode, uint32_t recurrence,427bool u_hardware_gps_set_position_mode(UHardwareGps self, uint32_t mode, uint32_t recurrence,
428 uint32_t min_interval, uint32_t preferred_accuracy,428 uint32_t min_interval, uint32_t preferred_accuracy,
429 uint32_t preferred_time)429 uint32_t preferred_time)
430{430{
@@ -432,7 +432,7 @@
432 preferred_time);432 preferred_time);
433}433}
434434
435void ubuntu_gps_inject_xtra_data(UbuntuGps self, char* data, int length)435void u_hardware_gps_inject_xtra_data(UHardwareGps self, char* data, int length)
436{436{
437 self->inject_xtra_data(data, length);437 self->inject_xtra_data(data, length);
438}438}
439439
=== modified file 'debian/changelog'
--- debian/changelog 2013-07-05 02:01:11 +0000
+++ debian/changelog 2013-07-05 09:17:25 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1platform-api (0.18.1+13.10.20130705-0ubuntu1) saucy; urgency=low2platform-api (0.18.1+13.10.20130705-0ubuntu1) saucy; urgency=low
23
3 [ Thomas Voß ]4 [ Thomas Voß ]
@@ -13,6 +14,14 @@
1314
14 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 05 Jul 2013 02:01:10 +000015 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 05 Jul 2013 02:01:10 +0000
1516
17=======
18platform-api (0.18.1+13.10.20130703-0ubuntu2) UNRELEASED; urgency=low
19
20 * Split out hal to ease integration of location service.
21
22 -- Thomas Voß <tvoss@x220> Thu, 04 Jul 2013 19:09:22 +0200
23
24>>>>>>> MERGE-SOURCE
16platform-api (0.18.1+13.10.20130703-0ubuntu1) saucy; urgency=low25platform-api (0.18.1+13.10.20130703-0ubuntu1) saucy; urgency=low
1726
18 [ Ricardo Mendoza ]27 [ Ricardo Mendoza ]
1928
=== added file 'debian/libplatform-api1-dev.doc-base'
--- debian/libplatform-api1-dev.doc-base 1970-01-01 00:00:00 +0000
+++ debian/libplatform-api1-dev.doc-base 2013-07-05 09:17:25 +0000
@@ -0,0 +1,8 @@
1Document: Ubuntu Platform API
2Title: Ubuntu Platform API Reference Documentation
3Author: Thomas Voß
4Abstract: This is the reference documentation for the Ubuntu Platform API
5Section: Debian
6Format: HTML
7Index: /usr/share/doc/ubuntu-platform-api/html/index.html
8Files: /usr/share/doc/ubuntu-platform-api/html/*.html
0\ No newline at end of file9\ No newline at end of file
110
=== modified file 'debian/libplatform-api1-dev.install'
--- debian/libplatform-api1-dev.install 2013-06-13 12:04:14 +0000
+++ debian/libplatform-api1-dev.install 2013-07-05 09:17:25 +0000
@@ -1,2 +1,3 @@
1usr/lib/*/libubuntu_application_api.so1usr/lib/*/libubuntu_application_api.so
2usr/lib/*/libubuntu_platform_hardware_api.so
2usr/lib/*/pkgconfig/ubuntu-platform-api.pc3usr/lib/*/pkgconfig/ubuntu-platform-api.pc
34
=== modified file 'debian/libplatform-api1-hybris.install'
--- debian/libplatform-api1-hybris.install 2013-03-20 12:49:06 +0000
+++ debian/libplatform-api1-hybris.install 2013-07-05 09:17:25 +0000
@@ -1,1 +1,2 @@
1usr/lib/*/libubuntu_application_api.so.*1usr/lib/*/libubuntu_application_api.so*
2usr/lib/*/libubuntu_platform_hardware_api.so*
2\ No newline at end of file3\ No newline at end of file
34
=== modified file 'debian/libplatform-api1-hybris.symbols'
--- debian/libplatform-api1-hybris.symbols 2013-06-21 02:01:18 +0000
+++ debian/libplatform-api1-hybris.symbols 2013-07-05 09:17:25 +0000
@@ -1,12 +1,9 @@
1libubuntu_application_api.so.1 libplatform-api1-hybris #MINVER#1libubuntu_application_api.so.1 libplatform-api1-hybris #MINVER#
2 (c++)"ua_sensors_light_disable(void*)@Base" 0.18.1daily13.06.212 _Z24ua_sensors_light_disablePv@Base 0.18.1daily13.06.21
3 (c++)"ubuntu::hybris::Bridge::path_to_library()@Base" 0.18.1daily13.06.213 _ZGVZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
4 (c++)"ubuntu::hybris::Bridge::instance()@Base" 0.18.1daily13.06.214 _ZN8internal6BridgeINS_13ToApplicationEED1Ev@Base 0.18.1+13.10.20130703-0ubuntu2
5 (c++)"ubuntu::hybris::Bridge::Bridge()@Base" 0.18.1daily13.06.215 _ZN8internal6BridgeINS_13ToApplicationEED2Ev@Base 0.18.1+13.10.20130703-0ubuntu2
6 (c++)"ubuntu::hybris::Bridge::Bridge()@Base" 0.18.1daily13.06.216 _ZZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
7 (c++)"ubuntu::hybris::Bridge::~Bridge()@Base" 0.18.1daily13.06.21
8 (c++)"ubuntu::hybris::Bridge::~Bridge()@Base" 0.18.1daily13.06.21
9 (c++)"ubuntu::hybris::Bridge::resolve_symbol(char const*) const@Base" 0.18.1daily13.06.21
10 u_application_description_destroy@Base 0.18.1daily13.06.217 u_application_description_destroy@Base 0.18.1daily13.06.21
11 u_application_description_new@Base 0.18.1daily13.06.218 u_application_description_new@Base 0.18.1daily13.06.21
12 u_application_description_set_application_id@Base 0.18.1daily13.06.219 u_application_description_set_application_id@Base 0.18.1daily13.06.21
@@ -81,15 +78,6 @@
81 uas_light_event_get_timestamp@Base 0.18.1daily13.06.2178 uas_light_event_get_timestamp@Base 0.18.1daily13.06.21
82 uas_proximity_event_get_distance@Base 0.18.1daily13.06.2179 uas_proximity_event_get_distance@Base 0.18.1daily13.06.21
83 uas_proximity_event_get_timestamp@Base 0.18.1daily13.06.2180 uas_proximity_event_get_timestamp@Base 0.18.1daily13.06.21
84 ubuntu_gps_delete@Base 0.18.1daily13.06.21
85 ubuntu_gps_delete_aiding_data@Base 0.18.1daily13.06.21
86 ubuntu_gps_inject_location@Base 0.18.1daily13.06.21
87 ubuntu_gps_inject_time@Base 0.18.1daily13.06.21
88 ubuntu_gps_inject_xtra_data@Base 0.18.1daily13.06.21
89 ubuntu_gps_new@Base 0.18.1daily13.06.21
90 ubuntu_gps_set_position_mode@Base 0.18.1daily13.06.21
91 ubuntu_gps_start@Base 0.18.1daily13.06.21
92 ubuntu_gps_stop@Base 0.18.1daily13.06.21
93 ubuntu_ui_install_task_controller@Base 0.18.1daily13.06.2181 ubuntu_ui_install_task_controller@Base 0.18.1daily13.06.21
94 ubuntu_ui_report_notification_invisible@Base 0.18.1daily13.06.2182 ubuntu_ui_report_notification_invisible@Base 0.18.1daily13.06.21
95 ubuntu_ui_report_notification_visible@Base 0.18.1daily13.06.2183 ubuntu_ui_report_notification_visible@Base 0.18.1daily13.06.21
@@ -105,3 +93,17 @@
105 ubuntu_ui_session_unfocus_running_sessions@Base 0.18.1daily13.06.2193 ubuntu_ui_session_unfocus_running_sessions@Base 0.18.1daily13.06.21
106 ubuntu_ui_set_surface_trap@Base 0.18.1daily13.06.2194 ubuntu_ui_set_surface_trap@Base 0.18.1daily13.06.21
107 ubuntu_ui_unset_surface_trap@Base 0.18.1daily13.06.2195 ubuntu_ui_unset_surface_trap@Base 0.18.1daily13.06.21
96libubuntu_platform_hardware_api.so.1 libplatform-api1-hybris #MINVER#
97 _ZGVZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
98 _ZN8internal6BridgeINS_13ToApplicationEED1Ev@Base 0.18.1+13.10.20130703-0ubuntu2
99 _ZN8internal6BridgeINS_13ToApplicationEED2Ev@Base 0.18.1+13.10.20130703-0ubuntu2
100 _ZZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
101 u_hardware_gps_delete@Base 0.18.1+13.10.20130703-0ubuntu2
102 u_hardware_gps_delete_aiding_data@Base 0.18.1+13.10.20130703-0ubuntu2
103 u_hardware_gps_inject_location@Base 0.18.1+13.10.20130703-0ubuntu2
104 u_hardware_gps_inject_time@Base 0.18.1+13.10.20130703-0ubuntu2
105 u_hardware_gps_inject_xtra_data@Base 0.18.1+13.10.20130703-0ubuntu2
106 u_hardware_gps_new@Base 0.18.1+13.10.20130703-0ubuntu2
107 u_hardware_gps_set_position_mode@Base 0.18.1+13.10.20130703-0ubuntu2
108 u_hardware_gps_start@Base 0.18.1+13.10.20130703-0ubuntu2
109 u_hardware_gps_stop@Base 0.18.1+13.10.20130703-0ubuntu2
108110
=== modified file 'doc/CMakeLists.txt'
--- doc/CMakeLists.txt 2013-06-11 09:40:30 +0000
+++ doc/CMakeLists.txt 2013-07-05 09:17:25 +0000
@@ -26,5 +26,5 @@
26 COMMENT "Generating API documentation with Doxygen" VERBATIM)26 COMMENT "Generating API documentation with Doxygen" VERBATIM)
27 install(27 install(
28 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html28 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
29 DESTINATION share/ubuntu-platform-api/doc)29 DESTINATION share/doc/ubuntu-platform-api)
30endif(DOXYGEN_FOUND)30endif(DOXYGEN_FOUND)
31\ No newline at end of file31\ No newline at end of file
3232
=== modified file 'doc/Doxyfile.in'
--- doc/Doxyfile.in 2013-06-11 09:40:30 +0000
+++ doc/Doxyfile.in 2013-07-05 09:17:25 +0000
@@ -26,7 +26,7 @@
26# identify the project. Note that if you do not use Doxywizard you need26# identify the project. Note that if you do not use Doxywizard you need
27# to put quotes around the project name if it contains spaces.27# to put quotes around the project name if it contains spaces.
2828
29PROJECT_NAME = @CMAKE_PROJECT_NAME@29PROJECT_NAME = "Ubuntu Platform API"
3030
31# The PROJECT_NUMBER tag can be used to enter a project or revision number.31# The PROJECT_NUMBER tag can be used to enter a project or revision number.
32# This could be handy for archiving the generated documentation or32# This could be handy for archiving the generated documentation or
@@ -38,7 +38,7 @@
38# for a project that appears at the top of each page and should give viewer38# for a project that appears at the top of each page and should give viewer
39# a quick idea about the purpose of the project. Keep the description short.39# a quick idea about the purpose of the project. Keep the description short.
4040
41PROJECT_BRIEF =41PROJECT_BRIEF = "A library helping with tight integration into the Ubuntu platform"
4242
43# With the PROJECT_LOGO tag one can specify an logo or icon that is43# With the PROJECT_LOGO tag one can specify an logo or icon that is
44# included in the documentation. The maximum height of the logo should not44# included in the documentation. The maximum height of the logo should not
@@ -209,7 +209,7 @@
209# For instance, some of the names that are used will be different. The list209# For instance, some of the names that are used will be different. The list
210# of all members will be omitted, etc.210# of all members will be omitted, etc.
211211
212OPTIMIZE_OUTPUT_FOR_C = NO212OPTIMIZE_OUTPUT_FOR_C = YES
213213
214# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java214# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
215# sources only. Doxygen will then generate output that is more tailored for215# sources only. Doxygen will then generate output that is more tailored for
@@ -365,7 +365,7 @@
365# Private class members and static file members will be hidden unless365# Private class members and static file members will be hidden unless
366# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES366# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
367367
368EXTRACT_ALL = NO368EXTRACT_ALL = YES
369369
370# If the EXTRACT_PRIVATE tag is set to YES all private members of a class370# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
371# will be included in the documentation.371# will be included in the documentation.
@@ -668,7 +668,7 @@
668# directories like "/usr/src/myproject". Separate the files or directories668# directories like "/usr/src/myproject". Separate the files or directories
669# with spaces.669# with spaces.
670670
671INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../include671INPUT = @CMAKE_CURRENT_SOURCE_DIR@ @CMAKE_CURRENT_SOURCE_DIR@/../include
672672
673# This tag can be used to specify the character encoding of the source files673# This tag can be used to specify the character encoding of the source files
674# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is674# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -728,7 +728,7 @@
728# directories that contain example code fragments that are included (see728# directories that contain example code fragments that are included (see
729# the \include command).729# the \include command).
730730
731EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../examples731EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../src
732732
733# If the value of the EXAMPLE_PATH tag contains directories, you can use the733# If the value of the EXAMPLE_PATH tag contains directories, you can use the
734# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp734# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -791,7 +791,7 @@
791# This can be useful if you have a project on for instance GitHub and want reuse791# This can be useful if you have a project on for instance GitHub and want reuse
792# the introduction page also for the doxygen output.792# the introduction page also for the doxygen output.
793793
794USE_MDFILE_AS_MAINPAGE =794USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/mainpage.md
795795
796#---------------------------------------------------------------------------796#---------------------------------------------------------------------------
797# configuration options related to source browsing797# configuration options related to source browsing
@@ -807,7 +807,7 @@
807# Setting the INLINE_SOURCES tag to YES will include the body807# Setting the INLINE_SOURCES tag to YES will include the body
808# of functions and classes directly in the documentation.808# of functions and classes directly in the documentation.
809809
810INLINE_SOURCES = YES810INLINE_SOURCES = NO
811811
812# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct812# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
813# doxygen to hide any special comment blocks from generated source code813# doxygen to hide any special comment blocks from generated source code
@@ -975,7 +975,7 @@
975# documentation will contain sections that can be hidden and shown after the975# documentation will contain sections that can be hidden and shown after the
976# page has loaded.976# page has loaded.
977977
978HTML_DYNAMIC_SECTIONS = NO978HTML_DYNAMIC_SECTIONS = YES
979979
980# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of980# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
981# entries shown in the various tree structured indices initially; the user981# entries shown in the various tree structured indices initially; the user
@@ -1145,7 +1145,7 @@
1145# navigation tree you can set this option to NO if you already set1145# navigation tree you can set this option to NO if you already set
1146# GENERATE_TREEVIEW to YES.1146# GENERATE_TREEVIEW to YES.
11471147
1148DISABLE_INDEX = NO1148DISABLE_INDEX = YES
11491149
1150# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index1150# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1151# structure should be generated to display hierarchical information.1151# structure should be generated to display hierarchical information.
@@ -1157,7 +1157,7 @@
1157# Since the tree basically has the same information as the tab index you1157# Since the tree basically has the same information as the tab index you
1158# could consider to set DISABLE_INDEX to NO when enabling this option.1158# could consider to set DISABLE_INDEX to NO when enabling this option.
11591159
1160GENERATE_TREEVIEW = NO1160GENERATE_TREEVIEW = YES
11611161
1162# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values1162# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
1163# (range [0,1..20]) that doxygen will group on one line in the generated HTML1163# (range [0,1..20]) that doxygen will group on one line in the generated HTML
@@ -1434,7 +1434,7 @@
1434# If the GENERATE_MAN tag is set to YES (the default) Doxygen will1434# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
1435# generate man pages1435# generate man pages
14361436
1437GENERATE_MAN = NO1437GENERATE_MAN = YES
14381438
1439# The MAN_OUTPUT tag is used to specify where the man pages will be put.1439# The MAN_OUTPUT tag is used to specify where the man pages will be put.
1440# If a relative path is entered the value of OUTPUT_DIRECTORY will be1440# If a relative path is entered the value of OUTPUT_DIRECTORY will be
14411441
=== modified file 'doc/mainpage.md'
--- doc/mainpage.md 2013-02-14 16:25:13 +0000
+++ doc/mainpage.md 2013-07-05 09:17:25 +0000
@@ -1,4 +1,4 @@
1Ubuntu Platform API {#mainpage}1Ubuntu Platform API {#mainpage}
2===================2===================
33
4The Ubuntu platform API Implements access to the Ubuntu platform and4The Ubuntu platform API Implements access to the Ubuntu platform and
55
=== modified file 'include/ubuntu/application/CMakeLists.txt'
--- include/ubuntu/application/CMakeLists.txt 2013-06-11 11:05:25 +0000
+++ include/ubuntu/application/CMakeLists.txt 2013-07-05 09:17:25 +0000
@@ -7,7 +7,6 @@
7 lifecycle_delegate.h7 lifecycle_delegate.h
8 operation_mode.h8 operation_mode.h
9 options.h9 options.h
10 ubuntu_application_gps.h
11)10)
1211
13install(12install(
@@ -16,4 +15,4 @@
16)15)
1716
18add_subdirectory(sensors)17add_subdirectory(sensors)
19add_subdirectory(ui)
20\ No newline at end of file18\ No newline at end of file
19add_subdirectory(ui)
2120
=== modified file 'include/ubuntu/application/archive.h'
--- include/ubuntu/application/archive.h 2013-06-03 20:54:26 +0000
+++ include/ubuntu/application/archive.h 2013-07-05 09:17:25 +0000
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_ARCHIVE_H_20#ifndef UBUNTU_APPLICATION_ARCHIVE_H_
@@ -26,139 +26,311 @@
2626
27struct UApplicationArchive;27struct UApplicationArchive;
2828
29/**
30 * \brief Creates a new archive, ownership is transferred to caller.
31 * \ingroup application_support
32 * \sa u_application_archive_destroy
33 * \returns A new archive instance or NULL if not enough memory is available.
34 */
29UApplicationArchive*35UApplicationArchive*
30u_application_archive_new();36u_application_archive_new();
3137
38/**
39 * \brief Destroys the given archive instance and releases all resources held by the instance.
40 * \ingroup application_support
41 * \param[in] archive The instance to be destroyed.
42 * \post All resources held by the instance are released. The result of any operation invoked on the destroyed instance are undefined.
43 */
32void44void
33u_application_archive_destroy(45u_application_archive_destroy(
34 UApplicationArchive *archive);46 UApplicationArchive *archive);
3547
36UStatus48/**
37u_application_archive_write(49 * \brief Writes a signed 8-bit integer to the supplied archive
38 UApplicationArchive *archive,50 * \ingroup application_support
39 int8_t c);51 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
4052 * \param[in] archive The archive to write to.
41UStatus53 * \param[in] c The signed 8-bit integer to write to the archive.
42u_application_archive_write(54 */
43 UApplicationArchive *archive,55UStatus
44 uint8_t c);56u_application_archive_write(
4557 UApplicationArchive *archive,
46UStatus58 int8_t c);
47u_application_archive_write(59
48 UApplicationArchive *archive,60/**
49 int16_t s);61 * \brief Writes an unsigned 8-bit integer to the supplied archive
5062 * \ingroup application_support
51UStatus63 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
52u_application_archive_write(64 * \param[in] archive The archive to write to.
53 UApplicationArchive *archive,65 * \param[in] c The unsigned 8-bit integer to write to the archive.
54 uint16_t s);66 */
5567UStatus
56UStatus68u_application_archive_write(
57u_application_archive_write(69 UApplicationArchive *archive,
58 UApplicationArchive *archive,70 uint8_t c);
59 int32_t s);71
6072/**
61UStatus73 * \brief Writes a signed 16-bit integer to the supplied archive
62u_application_archive_write(74 * \ingroup application_support
63 UApplicationArchive *archive,75 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
64 uint32_t s);76 * \param[in] archive The archive to write to.
6577 * \param[in] s The signed 16-bit integer to write to the archive.
66UStatus78 */
67u_application_archive_write(79UStatus
68 UApplicationArchive *archive,80u_application_archive_write(
69 int64_t s);81 UApplicationArchive *archive,
7082 int16_t s);
71UStatus83
72u_application_archive_write(84/**
73 UApplicationArchive *archive,85 * \brief Writes an unsigned 16-bit integer to the supplied archive
74 uint64_t s);86 * \ingroup application_support
7587 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
88 * \param[in] archive The archive to write to.
89 * \param[in] s The unsigned 16-bit integer to write to the archive.
90 */
91UStatus
92u_application_archive_write(
93 UApplicationArchive *archive,
94 uint16_t s);
95
96/**
97 * \brief Writes a signed 32-bit integer to the supplied archive
98 * \ingroup application_support
99 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
100 * \param[in] archive The archive to write to.
101 * \param[in] s The signed 32-bit integer to write to the archive.
102 */
103UStatus
104u_application_archive_write(
105 UApplicationArchive *archive,
106 int32_t s);
107
108/**
109 * \brief Writes an unsigned 32-bit integer to the supplied archive
110 * \ingroup application_support
111 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
112 * \param[in] archive The archive to write to.
113 * \param[in] s The unsigned 32-bit integer to write to the archive.
114 */
115UStatus
116u_application_archive_write(
117 UApplicationArchive *archive,
118 uint32_t s);
119
120/**
121 * \brief Writes a signed 64-bit integer to the supplied archive
122 * \ingroup application_support
123 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
124 * \param[in] archive The archive to write to.
125 * \param[in] s The signed 64-bit integer to write to the archive.
126 */
127UStatus
128u_application_archive_write(
129 UApplicationArchive *archive,
130 int64_t s);
131
132/**
133 * \brief Writes an unsigned 64-bit integer to the supplied archive
134 * \ingroup application_support
135 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
136 * \param[in] archive The archive to write to.
137 * \param[in] s The unsigned 64-bit integer to write to the archive.
138 */
139UStatus
140u_application_archive_write(
141 UApplicationArchive *archive,
142 uint64_t s);
143
144/**
145 * \brief Writes a string of characters to the supplied archive
146 * \ingroup application_support
147 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
148 * \param[in] archive The archive to write to.
149 * \param[in] s The string to write.
150 * \param[in] size The number of characters to write to the archive.
151 */
76UStatus152UStatus
77u_application_archive_write_stringn(153u_application_archive_write_stringn(
78 UApplicationArchive *archive,154 UApplicationArchive *archive,
79 const char *s,155 const char *s,
80 size_t size);156 size_t size);
81157
158/**
159 * \brief Writes a string of wide characters to the supplied archive
160 * \ingroup application_support
161 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
162 * \param[in] archive The archive to write to.
163 * \param[in] s The string to write.
164 * \param[in] size The number of characters to write to the archive.
165 */
82UStatus166UStatus
83u_application_archive_write_wstringn(167u_application_archive_write_wstringn(
84 UApplicationArchive *archive,168 UApplicationArchive *archive,
85 const wchar_t *s,169 const wchar_t *s,
86 size_t size);170 size_t size);
87171
172/**
173 * \brief Writes a blob of binary data to the supplied archive
174 * \ingroup application_support
175 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
176 * \param[in] archive The archive to write to.
177 * \param[in] data The binary blob to write.
178 * \param[in] size The size of the blob.
179 */
88UStatus180UStatus
89u_application_archive_write_bytes(181u_application_archive_write_bytes(
90 UApplicationArchive *archive,182 UApplicationArchive *archive,
91 const intptr_t *data,183 const intptr_t *data,
92 size_t size);184 size_t size);
93185
94UStatus186UStatus
95u_application_archive_write_begin_blockn(187u_application_archive_write_begin_blockn(
96 UApplicationArchive* archive,188 UApplicationArchive* archive,
97 const char *name,189 const char *name,
98 size_t size);190 size_t size);
99191
100UStatus192UStatus
101u_application_archive_write_end_blockn(193u_application_archive_write_end_blockn(
102 UApplicationArchive* archive,194 UApplicationArchive* archive,
103 const char *name,195 const char *name,
104 size_t size);196 size_t size);
105197
106UStatus198/**
107u_application_archive_read(199 * \brief Reads a signed 8-bit integer from the supplied archive
108 const UApplicationArchive *archive,200 * \ingroup application_support
109 int8_t *c);201 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
110202 * \param[in] archive The archive to read from.
111UStatus203 * \param[out] c Pointer to memory that receives the signed 8-bit integer.
112u_application_archive_read(204 */
113 const UApplicationArchive *archive,205UStatus
114 uint8_t *c);206u_application_archive_read(
115207 const UApplicationArchive *archive,
116UStatus208 int8_t *c);
117u_application_archive_read(209
118 const UApplicationArchive *archive,210/**
119 int16_t *s);211 * \brief Reads an unsigned 8-bit integer from the supplied archive
120212 * \ingroup application_support
121UStatus213 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
122u_application_archive_read(214 * \param[in] archive The archive to read from.
123 const UApplicationArchive *archive,215 * \param[out] c Pointer to memory that receives the unsigned 8-bit integer.
124 uint16_t *s);216 */
125217UStatus
126UStatus218u_application_archive_read(
127u_application_archive_read(219 const UApplicationArchive *archive,
128 const UApplicationArchive *archive,220 uint8_t *c);
129 int32_t *s);221
130222/**
131UStatus223 * \brief Reads a signed 16-bit integer from the supplied archive
132u_application_archive_read(224 * \ingroup application_support
133 const UApplicationArchive *archive,225 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
134 uint32_t *s);226 * \param[in] archive The archive to read from.
135227 * \param[out] s Pointer to memory that receives the signed 16-bit integer.
136UStatus228 */
137u_application_archive_read(229UStatus
138 const UApplicationArchive *archive,230u_application_archive_read(
139 int64_t *s);231 const UApplicationArchive *archive,
140232 int16_t *s);
141UStatus233
142u_application_archive_read(234/**
143 const UApplicationArchive *archive,235 * \brief Reads an unsigned 16-bit integer from the supplied archive
144 uint64_t *s);236 * \ingroup application_support
145237 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
238 * \param[in] archive The archive to read from.
239 * \param[out] s Pointer to memory that receives the unsigned 16-bit integer.
240 */
241UStatus
242u_application_archive_read(
243 const UApplicationArchive *archive,
244 uint16_t *s);
245
246/**
247 * \brief Reads a signed 32-bit integer from the supplied archive
248 * \ingroup application_support
249 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
250 * \param[in] archive The archive to read from.
251 * \param[out] s Pointer to memory that receives the signed 32-bit integer.
252 */
253UStatus
254u_application_archive_read(
255 const UApplicationArchive *archive,
256 int32_t *s);
257
258/**
259 * \brief Reads an unsigned 32-bit integer from the supplied archive
260 * \ingroup application_support
261 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
262 * \param[in] archive The archive to read from.
263 * \param[out] s Pointer to memory that receives the unsigned 32-bit integer.
264 */
265UStatus
266u_application_archive_read(
267 const UApplicationArchive *archive,
268 uint32_t *s);
269
270/**
271 * \brief Reads a signed 64-bit integer from the supplied archive
272 * \ingroup application_support
273 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
274 * \param[in] archive The archive to read from.
275 * \param[out] s Pointer to memory that receives the signed 64-bit integer.
276 */
277UStatus
278u_application_archive_read(
279 const UApplicationArchive *archive,
280 int64_t *s);
281
282/**
283 * \brief Reads an unsigned 64-bit integer from the supplied archive
284 * \ingroup application_support
285 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
286 * \param[in] archive The archive to read from.
287 * \param[out] s Pointer to memory that receives the unsigned 64-bit integer.
288 */
289UStatus
290u_application_archive_read(
291 const UApplicationArchive *archive,
292 uint64_t *s);
293
294/**
295 * \brief Reads a string of characters from the supplied archive
296 * \ingroup application_support
297 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
298 * \param[in] archive The archive to read from.
299 * \param[out] s Pointer to memory that receives the string.
300 * \param[out] size Pointer to memory that receives the size of the string.
301 */
146UStatus302UStatus
147u_application_archive_read_stringn(303u_application_archive_read_stringn(
148 const UApplicationArchive *archive,304 const UApplicationArchive *archive,
149 const char **s,305 const char **s,
150 size_t *size);306 size_t *size);
151307
308/**
309 * \brief Reads a string of wide characters from the supplied archive
310 * \ingroup application_support
311 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
312 * \param[in] archive The archive to read from.
313 * \param[out] s Pointer to memory that receives the wide string.
314 * \param[out] size Pointer to memory that receives the size of the string.
315 */
152UStatus316UStatus
153u_application_archive_read_wstringn(317u_application_archive_read_wstringn(
154 UApplicationArchive *archive,318 UApplicationArchive *archive,
155 const wchar_t *s,319 const wchar_t *s,
156 size_t size);320 size_t size);
157321
322/**
323 * \brief Reads a blob of binary data from the supplied archive
324 * \ingroup application_support
325 * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
326 * \param[in] archive The archive to read from.
327 * \param[out] data Pointer to memory that receives the binary data.
328 * \param[out] size Pointer to memory that receives the size of the blob.
329 */
158UStatus330UStatus
159u_application_archive_read_bytes(331u_application_archive_read_bytes(
160 UApplicationArchive *archive,332 UApplicationArchive *archive,
161 const intptr_t *data,333 const intptr_t *data,
162 size_t size);334 size_t size);
163335
164#endif /* UBUNTU_APPLICATION_ARCHIVE_H_ */336#endif /* UBUNTU_APPLICATION_ARCHIVE_H_ */
165337
=== modified file 'include/ubuntu/application/description.h'
--- include/ubuntu/application/description.h 2013-05-27 22:14:00 +0000
+++ include/ubuntu/application/description.h 2013-07-05 09:17:25 +0000
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_DESCRIPTION_H_20#ifndef UBUNTU_APPLICATION_DESCRIPTION_H_
@@ -27,33 +27,71 @@
27extern "C" {27extern "C" {
28#endif28#endif
2929
30 /**
31 * \brief Encapsulates properties of an application instance.
32 * \ingroup application_support
33 */
30 typedef void UApplicationDescription;34 typedef void UApplicationDescription;
31 35
36 /**
37 * \brief Creates a new instance of application description.
38 * \ingroup application_support
39 * \returns A new application description instance or NULL if not enough memory is available.
40 */
32 UApplicationDescription*41 UApplicationDescription*
33 u_application_description_new();42 u_application_description_new();
34 43
44 /**
45 * \brief Destroys an instance of application description and releases all resources.
46 * \ingroup application_support
47 * \param[in] desc The instance to be destroyed.
48 */
35 void49 void
36 u_application_description_destroy(50 u_application_description_destroy(
37 UApplicationDescription *desc);51 UApplicationDescription *desc);
38 52
53 /**
54 * \brief Sets the application id contained in the description instance.
55 * \ingroup application_support
56 * \param[in] desc The application description instance, must not be NULL.
57 * \param[in] id The new application id, must not be NULL.
58 */
39 void59 void
40 u_application_description_set_application_id(60 u_application_description_set_application_id(
41 UApplicationDescription *desc,61 UApplicationDescription *desc,
42 UApplicationId *id);62 UApplicationId *id);
43 63
44 UApplicationId* 64 /**
65 * \brief Queries the application id contained in the description instance.
66 * \ingroup application_support
67 * \returns The app id contained in the instance.
68 * \param[in] desc The application description instance, must not be NULL.
69 */
70 UApplicationId*
45 u_application_description_get_application_id(71 u_application_description_get_application_id(
46 UApplicationDescription *desc);72 UApplicationDescription *desc);
47 73
74 /**
75 * \brief Sets the application lifecycle delegate
76 * \ingroup application_support
77 * \param[in] desc The application description instance, must not be NULL.
78 * \param[in] lifecycle_delegate The new lifecycle delegate, must not be NULL.
79 */
48 void80 void
49 u_application_description_set_application_lifecycle_delegate(81 u_application_description_set_application_lifecycle_delegate(
50 UApplicationDescription *desc,82 UApplicationDescription *desc,
51 UApplicationLifecycleDelegate *lifecycle_delegate);83 UApplicationLifecycleDelegate *lifecycle_delegate);
52 84
53 UApplicationLifecycleDelegate* 85 /**
86 * \brief Queries the application lifecycle delegate
87 * \ingroup application_support
88 * \returns The application lifecycle delegate contained in the description instance.
89 * \param[in] desc The application description instance, must not be NULL.
90 */
91 UApplicationLifecycleDelegate*
54 u_application_description_get_application_lifecycle_delegate(92 u_application_description_get_application_lifecycle_delegate(
55 UApplicationDescription *desc);93 UApplicationDescription *desc);
56 94
57#ifdef __cplusplus95#ifdef __cplusplus
58}96}
59#endif97#endif
6098
=== modified file 'include/ubuntu/application/id.h'
--- include/ubuntu/application/id.h 2013-06-04 22:08:07 +0000
+++ include/ubuntu/application/id.h 2013-07-05 09:17:25 +0000
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_ID_H_20#ifndef UBUNTU_APPLICATION_ID_H_
@@ -26,21 +26,43 @@
26extern "C" {26extern "C" {
27#endif27#endif
2828
29 /**
30 * \brief An opaque type describing an application ID.
31 * \ingroup application_support
32 */
29 typedef void UApplicationId;33 typedef void UApplicationId;
30 34
35 /**
36 * \brief Creates a new application ID from an existing string.
37 * \ingroup application_support
38 * \param[in] string The string containing the application ID.
39 * \param[in] size The size of the string.
40 */
31 UApplicationId*41 UApplicationId*
32 u_application_id_new_from_stringn(42 u_application_id_new_from_stringn(
33 const char *string, 43 const char *string,
34 size_t size);44 size_t size);
35 45
46 /**
47 * \brief Destroy the supplied application ID instance.
48 * \ingroup application_support
49 * \param[in] id The instance to be destroyed.
50 */
36 void51 void
37 u_application_id_destroy(UApplicationId *id);52 u_application_id_destroy(UApplicationId *id);
38 53
54 /**
55 * \brief Compares two application ID instances.
56 * \ingroup application_support
57 * \returns -1 iff lhs < rhs, 0 iff lhs == rhs, 1 iff lhs > rhs.
58 * \param[in] lhs The left-hand-side id to be compared.
59 * \param[in] rhs The right-hand-side id to be compared.
60 */
39 int61 int
40 u_application_id_compare(62 u_application_id_compare(
41 UApplicationId *lhs,63 UApplicationId *lhs,
42 UApplicationId *rhs);64 UApplicationId *rhs);
43 65
44#ifdef __cplusplus66#ifdef __cplusplus
45}67}
46#endif68#endif
4769
=== modified file 'include/ubuntu/application/instance.h'
--- include/ubuntu/application/instance.h 2013-05-27 22:14:00 +0000
+++ include/ubuntu/application/instance.h 2013-07-05 09:17:25 +0000
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_INSTANCE_H_20#ifndef UBUNTU_APPLICATION_INSTANCE_H_
@@ -27,31 +27,65 @@
27extern "C" {27extern "C" {
28#endif28#endif
2929
30 /** \defgroup application_support Functions and types to support application development. */
31
32 /**
33 * \brief Opaque type describing an application instance.
34 * \ingroup application_support
35 * An application instance encapsulates the event loop of an app.
36 */
30 typedef void UApplicationInstance;37 typedef void UApplicationInstance;
31 38
39 /**
40 * \brief Creates a new application instance with a reference count of 1.
41 * \ingroup application_support
42 * \returns A new application instance or NULL in case of low-memory.
43 * \param[in] desc A description object, must not be NULL.
44 * \param[in] options An options object, must not be NULL.
45 */
32 UApplicationInstance*46 UApplicationInstance*
33 u_application_instance_new_from_description_with_options(47 u_application_instance_new_from_description_with_options(
34 UApplicationDescription *desc,48 UApplicationDescription *desc,
35 UApplicationOptions *options);49 UApplicationOptions *options);
36 50
51 /**
52 * \brief Increments the reference count of an application instance.
53 * \ingroup application_support
54 * \param[in] instance The instance to increment the reference count for.
55 */
37 void56 void
38 u_application_instance_ref(57 u_application_instance_ref(
39 UApplicationInstance *instance);58 UApplicationInstance *instance);
40 59
60 /**
61 * \brief Decrements the reference count of an application instance and releases all resources held by the object if the reference count reaches 0.
62 * \ingroup application_support
63 * \param[in] instance The instance to decrement the reference count for.
64 */
41 void65 void
42 u_application_instance_unref(66 u_application_instance_unref(
43 UApplicationInstance *instance);67 UApplicationInstance *instance);
44 68
69 /**
70 * \brief Destroys the application instance and releases all its resources.
71 * \ingroup application_support
72 * \param[in] instance The instance to be destroyed.
73 */
45 void74 void
46 u_application_instance_destroy(75 u_application_instance_destroy(
47 UApplicationInstance *instance);76 UApplicationInstance *instance);
48 77
78 /**
79 * \brief Executes the event loop of the application instance
80 * \ingroup application_support
81 * \param[in] instance The instance to be executed.
82 */
49 void83 void
50 u_application_instance_run(84 u_application_instance_run(
51 UApplicationInstance *instance);85 UApplicationInstance *instance);
5286
53#ifdef __cplusplus87#ifdef __cplusplus
54}88}
55#endif89#endif
56 90
57#endif /* UBUNTU_APPLICATION_INSTANCE_H_ */91#endif /* UBUNTU_APPLICATION_INSTANCE_H_ */
5892
=== modified file 'include/ubuntu/application/lifecycle_delegate.h'
--- include/ubuntu/application/lifecycle_delegate.h 2013-05-27 21:49:05 +0000
+++ include/ubuntu/application/lifecycle_delegate.h 2013-07-05 09:17:25 +0000
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_20#ifndef UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_
@@ -26,55 +26,127 @@
26#ifdef __cplusplus26#ifdef __cplusplus
27extern "C" {27extern "C" {
28#endif28#endif
29 29
30 /**
31 * \brief Prototype for the callback that is invoked whenever the app has been resumed.
32 * \ingroup application_support
33 * \param[in] options Application instance options
34 * \param[in] context The callback context as specified by the application
35 */
30 typedef void (*u_on_application_resumed)(const UApplicationOptions *options, void *context);36 typedef void (*u_on_application_resumed)(const UApplicationOptions *options, void *context);
37 /**
38 * \brief Prototype for the callback that is invoked whenever the app is about to be stopped.
39 * Applications can serialize their state to the supplied archive.
40 * \ingroup application_support
41 */
31 typedef void (*u_on_application_about_to_stop)(UApplicationArchive *archive, void *context);42 typedef void (*u_on_application_about_to_stop)(UApplicationArchive *archive, void *context);
32 43
44 /**
45 * \brief Opaque type encapsulating all app-specific callback functions.
46 * \ingroup application_support
47 */
33 typedef void UApplicationLifecycleDelegate;48 typedef void UApplicationLifecycleDelegate;
34 49
50 /**
51 * \brief Creates a new instance of the lifecycle delegate with an initial refernce count of 1.
52 * \ingroup application_support
53 * \returns A new instance of the lifecycle delegate or NULL if no memory is available.
54 */
35 UApplicationLifecycleDelegate*55 UApplicationLifecycleDelegate*
36 u_application_lifecycle_delegate_new();56 u_application_lifecycle_delegate_new();
37 57
58 /**
59 * \brief Destroys an instance of the lifecycle delegate and releases all of its resources.
60 * \ingroup application_support
61 * \param[in] delegate The instance to be destroyed.
62 */
38 void63 void
39 u_application_lifecycle_delegate_destroy(64 u_application_lifecycle_delegate_destroy(
40 UApplicationLifecycleDelegate *delegate);65 UApplicationLifecycleDelegate *delegate);
41 66
67 /**
68 * \brief Increments the reference count of the supplied lifecycle delegate.
69 * \ingroup application_support
70 * \param[in] delegate The lifecycle delegate to increment the reference count for.
71 */
42 void72 void
43 u_application_lifecycle_delegate_ref(73 u_application_lifecycle_delegate_ref(
44 UApplicationLifecycleDelegate *delegate);74 UApplicationLifecycleDelegate *delegate);
45 75
76 /**
77 * \brief Decrements the reference count of the supplied lifecycle delegate and destroys it if the count reaches 0.
78 * \ingroup application_support
79 * \param[in] delegate The lifecycle delegate to decrement the reference count for.
80 */
46 void81 void
47 u_application_lifecycle_delegate_unref(82 u_application_lifecycle_delegate_unref(
48 UApplicationLifecycleDelegate *delegate);83 UApplicationLifecycleDelegate *delegate);
49 84
85 /**
86 * \brief Sets the resumed cb for the supplied delegate.
87 * \ingroup application_support
88 * \param[in] delegate The lifecycle delegate to adjust the cb for.
89 * \param[in] cb The new callback to be invoked whenever the app resumes.
90 */
50 void91 void
51 u_application_lifecycle_delegate_set_application_resumed_cb(92 u_application_lifecycle_delegate_set_application_resumed_cb(
52 UApplicationLifecycleDelegate *delegate,93 UApplicationLifecycleDelegate *delegate,
53 u_on_application_resumed cb);94 u_on_application_resumed cb);
54 95
96 /**
97 * \brief Queries the resumed cb from the supplied delegate.
98 * \ingroup application_support
99 * \returns The callback to be invoked whenever the app resumes.
100 * \param[in] delegate The lifecycle delegate to query the callback from.
101 */
55 u_on_application_resumed102 u_on_application_resumed
56 u_application_lifecycle_delegate_get_application_resumed_cb(103 u_application_lifecycle_delegate_get_application_resumed_cb(
57 UApplicationLifecycleDelegate *delegate);104 UApplicationLifecycleDelegate *delegate);
58 105
106 /**
107 * \brief Sets the about-to-stop cb for the supplied delegate.
108 * \ingroup application_support
109 * \param[in] delegate The lifecycle delegate to adjust the cb for.
110 * \param[in] cb The new callback to be invoked whenever the app is about to be stopped..
111 */
59 void112 void
60 u_application_lifecycle_delegate_set_application_about_to_stop_cb(113 u_application_lifecycle_delegate_set_application_about_to_stop_cb(
61 UApplicationLifecycleDelegate *delegate,114 UApplicationLifecycleDelegate *delegate,
62 u_on_application_about_to_stop cb);115 u_on_application_about_to_stop cb);
63 116
117 /**
118 * \brief Queries the about-to-be-stopped cb from the supplied delegate.
119 * \ingroup application_support
120 * \returns The callback to be invoked whenever the app is about to be stopped.
121 * \param[in] delegate The lifecycle delegate to query the callback from.
122 */
64 u_on_application_about_to_stop123 u_on_application_about_to_stop
65 u_application_lifecycle_delegate_get_application_about_to_stop_cb(124 u_application_lifecycle_delegate_get_application_about_to_stop_cb(
66 UApplicationLifecycleDelegate *delegate);125 UApplicationLifecycleDelegate *delegate);
67 126
127 /**
128 * \brief Sets the cb context for the supplied delegate.
129 * \ingroup application_support
130 * \param[in] delegate The lifecycle delegate to adjust the context for.
131 * \param[in] context The new cb context.
132 */
68 void133 void
69 u_application_lifecycle_delegate_set_context(134 u_application_lifecycle_delegate_set_context(
70 UApplicationLifecycleDelegate *delegate,135 UApplicationLifecycleDelegate *delegate,
71 void *context);136 void *context);
72 137
138 /**
139 * \brief Queries the cb context from the supplied delegate.
140 * \ingroup application_support
141 * \returns The context that is passed to callbacks of this delegate.
142 * \param[in] delegate The lifecycle delegate to query the context from.
143 * \param[in] context Unused.
144 */
73 void*145 void*
74 u_application_lifecycle_delegate_get_context(146 u_application_lifecycle_delegate_get_context(
75 UApplicationLifecycleDelegate *delegate,147 UApplicationLifecycleDelegate *delegate,
76 void *context);148 void *context);
77 149
78#ifdef __cplusplus150#ifdef __cplusplus
79}151}
80#endif152#endif
81153
=== modified file 'include/ubuntu/application/operation_mode.h'
--- include/ubuntu/application/operation_mode.h 2013-05-27 21:49:05 +0000
+++ include/ubuntu/application/operation_mode.h 2013-07-05 09:17:25 +0000
@@ -14,16 +14,20 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_OPERATION_MODE_H_20#ifndef UBUNTU_APPLICATION_OPERATION_MODE_H_
21#define UBUNTU_APPLICATION_OPERATION_MODE_H_21#define UBUNTU_APPLICATION_OPERATION_MODE_H_
2222
23/**
24 * \brief Describes the different operational modes that an
25 * application can run in.
26 */
23typedef enum27typedef enum
24{28{
25 U_APPLICATION_FOREGROUND_APP,29 U_APPLICATION_FOREGROUND_APP,
26 U_APPLICATION_BACKGROUND_SERVICE30 U_APPLICATION_BACKGROUND_SERVICE
27} UApplicationOperationMode;31} UApplicationOperationMode;
2832
29#endif /* UBUNTU_APPLICATION_OPERATION_MODE_H_ */33#endif /* UBUNTU_APPLICATION_OPERATION_MODE_H_ */
3034
=== modified file 'include/ubuntu/application/options.h'
--- include/ubuntu/application/options.h 2013-05-27 22:14:00 +0000
+++ include/ubuntu/application/options.h 2013-07-05 09:17:25 +0000
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com> 17 * Thomas Voß <thomas.voss@canonical.com>
18 */18 */
1919
20#ifndef UBUNTU_APPLICATION_OPTIONS_H_20#ifndef UBUNTU_APPLICATION_OPTIONS_H_
@@ -26,21 +26,43 @@
26extern "C" {26extern "C" {
27#endif27#endif
2828
29 /**
30 * \brief Encapsulates options as passed to the application.
31 * \ingroup application_support
32 */
29 typedef void UApplicationOptions;33 typedef void UApplicationOptions;
30 34
35 /**
36 * \brief Parses options from the command line.
37 * \ingroup application_support
38 * \returns An options instance if parsing was successful, or 0 otheriwse.
39 * \param[in] argc Number of arguments.
40 * \param[in] argv Arguments.
41 */
31 UApplicationOptions*42 UApplicationOptions*
32 u_application_options_new_from_cmd_line(43 u_application_options_new_from_cmd_line(
33 int argc, 44 int argc,
34 char** argv);45 char** argv);
35 46
47 /**
48 * \brief Destroys the options object and releases all resources.
49 * \ingroup application_support
50 * \param[in] options The object to be destroyed.
51 */
36 void52 void
37 u_application_options_destroy(53 u_application_options_destroy(
38 UApplicationOptions *options);54 UApplicationOptions *options);
39 55
56 /**
57 * \brief Queries the operation mode from the supplied options object.
58 * \ingroup application_support
59 * \returns The operation mode as stored in the options object.
60 * \param[in] options The options object to be queried.
61 */
40 UApplicationOperationMode62 UApplicationOperationMode
41 u_application_options_get_operation_mode(63 u_application_options_get_operation_mode(
42 UApplicationOptions *options);64 UApplicationOptions *options);
43 65
44#ifdef __cplusplus66#ifdef __cplusplus
45}67}
46#endif68#endif
4769
=== modified file 'include/ubuntu/application/sensors/accelerometer.h'
--- include/ubuntu/application/sensors/accelerometer.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/application/sensors/accelerometer.h 2013-07-05 09:17:25 +0000
@@ -26,36 +26,94 @@
26extern "C" {26extern "C" {
27#endif27#endif
2828
29 /**
30 * \brief Opaque type that models the accelerometer.
31 * \ingroup sensor_access
32 */
29 typedef void UASensorsAccelerometer;33 typedef void UASensorsAccelerometer;
34
35 /**
36 * \brief Callback type used by applications to subscribe to accelerometer events.
37 * \ingroup sensor_access
38 */
30 typedef void (*on_accelerometer_event_cb)(UASAccelerometerEvent* event,39 typedef void (*on_accelerometer_event_cb)(UASAccelerometerEvent* event,
31 void* context);40 void* context);
3241
42 /**
43 * \brief Create a new object for accessing the accelerometer.
44 * \ingroup sensor_access
45 * \returns A new instance or NULL in case of errors.
46 */
33 UASensorsAccelerometer*47 UASensorsAccelerometer*
34 ua_sensors_accelerometer_new(); 48 ua_sensors_accelerometer_new();
3549
50 /**
51 * \brief Enables the supplied accelerometer.
52 * \ingroup sensor_access
53 * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
54 * \param[in] sensor The sensor instance to be enabled.
55 */
36 UStatus56 UStatus
37 ua_sensors_accelerometer_enable(57 ua_sensors_accelerometer_enable(
38 UASensorsAccelerometer* sensor);58 UASensorsAccelerometer* sensor);
3959
60 /**
61 * \brief Disables the supplied accelerometer.
62 * \ingroup sensor_access
63 * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
64 * \param[in] sensor The sensor instance to be disabled.
65 */
40 UStatus66 UStatus
41 ua_sensors_accelerometer_disable(67 ua_sensors_accelerometer_disable(
42 UASensorsAccelerometer* sensor);68 UASensorsAccelerometer* sensor);
4369
70 /**
71 * \brief Queries the minimum delay between two readings for the supplied sensor.
72 * \ingroup sensor_access
73 * \returns The minimum delay between two readings in [ms].
74 * \param[in] sensor The sensor instance to be queried.
75 */
44 uint32_t76 uint32_t
45 ua_sensors_accelerometer_get_min_delay(77 ua_sensors_accelerometer_get_min_delay(
46 UASensorsAccelerometer* sensor);78 UASensorsAccelerometer* sensor);
47 79
80 /**
81 * \brief Queries the minimum value that can be reported by the sensor.
82 * \ingroup sensor_access
83 * \returns The minimum value that can be reported by the sensor.
84 * \param[in] sensor The sensor instance to be queried.
85 */
48 float86 float
49 ua_sensors_accelerometer_get_min_value(87 ua_sensors_accelerometer_get_min_value(
50 UASensorsAccelerometer* sensor);88 UASensorsAccelerometer* sensor);
51 89
90 /**
91 * \brief Queries the maximum value that can be reported by the sensor.
92 * \ingroup sensor_access
93 * \returns The maximum value that can be reported by the sensor.
94 * \param[in] sensor The sensor instance to be queried.
95 */
52 float96 float
53 ua_sensors_accelerometer_get_max_value(97 ua_sensors_accelerometer_get_max_value(
54 UASensorsAccelerometer* sensor);98 UASensorsAccelerometer* sensor);
55 99
100 /**
101 * \brief Queries the numeric resolution supported by the sensor
102 * \ingroup sensor_access
103 * \returns The numeric resolution supported by the sensor.
104 * \param[in] sensor The sensor instance to be queried.
105 */
56 float106 float
57 ua_sensors_accelerometer_get_resolution(107 ua_sensors_accelerometer_get_resolution(
58 UASensorsAccelerometer* sensor);108 UASensorsAccelerometer* sensor);
109
110 /**
111 * \brief Set the callback to be invoked whenever a new sensor reading is available.
112 * \ingroup sensor_access
113 * \param[in] sensor The sensor instance to associate the callback with.
114 * \param[in] cb The callback to be invoked.
115 * \param[in] ctx The context supplied to the callback invocation.
116 */
59 void117 void
60 ua_sensors_accelerometer_set_reading_cb(118 ua_sensors_accelerometer_set_reading_cb(
61 UASensorsAccelerometer* sensor,119 UASensorsAccelerometer* sensor,
62120
=== modified file 'include/ubuntu/application/sensors/event/accelerometer.h'
--- include/ubuntu/application/sensors/event/accelerometer.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/application/sensors/event/accelerometer.h 2013-07-05 09:17:25 +0000
@@ -25,20 +25,48 @@
25extern "C" {25extern "C" {
26#endif26#endif
2727
28 /**
29 * \brief Opaque type describing an accelerometer reading.
30 * \ingroup sensor_access
31 */
28 typedef void UASAccelerometerEvent;32 typedef void UASAccelerometerEvent;
2933
34 /**
35 * \brief Query the timestamp of the sensor reading.
36 * \ingroup sensor_access
37 * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock.
38 * \param[in] event The reading to be queried.
39 */
30 uint64_t40 uint64_t
31 uas_accelerometer_event_get_timestamp(41 uas_accelerometer_event_get_timestamp(
32 UASAccelerometerEvent* event);42 UASAccelerometerEvent* event);
33 43
44 /**
45 * \brief Query the acceleration in x-axis direction.
46 * \ingroup sensor_access
47 * \returns The acceleration in x-axis direction.
48 * \param[in] event The reading to be queried.
49 */
34 float50 float
35 uas_accelerometer_event_get_acceleration_x(51 uas_accelerometer_event_get_acceleration_x(
36 UASAccelerometerEvent* event);52 UASAccelerometerEvent* event);
37 53
54 /**
55 * \brief Query the acceleration in y-axis direction.
56 * \ingroup sensor_access
57 * \returns The acceleration in y-axis direction.
58 * \param[in] event The reading to be queried.
59 */
38 float60 float
39 uas_accelerometer_event_get_acceleration_y(61 uas_accelerometer_event_get_acceleration_y(
40 UASAccelerometerEvent* event);62 UASAccelerometerEvent* event);
41 63
64 /**
65 * \brief Query the acceleration in z-axis direction.
66 * \ingroup sensor_access
67 * \returns The acceleration in z-axis direction.
68 * \param[in] event The reading to be queried.
69 */
42 float70 float
43 uas_accelerometer_event_get_acceleration_z(71 uas_accelerometer_event_get_acceleration_z(
44 UASAccelerometerEvent* event);72 UASAccelerometerEvent* event);
4573
=== modified file 'include/ubuntu/application/sensors/event/light.h'
--- include/ubuntu/application/sensors/event/light.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/application/sensors/event/light.h 2013-07-05 09:17:25 +0000
@@ -25,12 +25,28 @@
25extern "C" {25extern "C" {
26#endif26#endif
2727
28 /**
29 * \brief Opaque type describing an ambient light sensor reading.
30 * \ingroup sensor_access
31 */
28 typedef void UASLightEvent;32 typedef void UASLightEvent;
2933
34 /**
35 * \brief Query the timestamp of the sensor reading.
36 * \ingroup sensor_access
37 * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock.
38 * \param[in] event The reading to be queried.
39 */
30 uint64_t40 uint64_t
31 uas_light_event_get_timestamp(41 uas_light_event_get_timestamp(
32 UASLightEvent* event);42 UASLightEvent* event);
33 43
44 /**
45 * \brief Query the value measured by the ambient light sensor.
46 * \ingroup sensor_access
47 * \returns The ambient light level.
48 * \param[in] event The reading to be queried.
49 */
34 float50 float
35 uas_light_event_get_light(51 uas_light_event_get_light(
36 UASLightEvent* event);52 UASLightEvent* event);
3753
=== modified file 'include/ubuntu/application/sensors/event/proximity.h'
--- include/ubuntu/application/sensors/event/proximity.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/application/sensors/event/proximity.h 2013-07-05 09:17:25 +0000
@@ -25,17 +25,39 @@
25extern "C" {25extern "C" {
26#endif26#endif
2727
28 /**
29 * \brief Useful constants when inspecting readings from the proximity sensor.
30 * \ingroup sensor_access
31 */
28 typedef enum {32 typedef enum {
29 U_PROXIMITY_NEAR = 1,33 U_PROXIMITY_NEAR = 1, /**< The reading indicates that something is near the sensor/device. */
30 U_PROXIMITY_FAR = 234 U_PROXIMITY_FAR = 2 /**< The reading indicates that something is far away from the sensor/device. */
31 } UASProximityDistance;35 } UbuntuApplicationSensorsProximityDistance;
3236
37 typedef UbuntuApplicationSensorsProximityDistance UASProximityDistance;
38
39 /**
40 * \brief Opaque type describing an accelerometer reading.
41 * \ingroup sensor_access
42 */
33 typedef void UASProximityEvent;43 typedef void UASProximityEvent;
3444
45 /**
46 * \brief Query the timestamp of the sensor reading.
47 * \ingroup sensor_access
48 * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock.
49 * \param[in] event The reading to be queried.
50 */
35 uint64_t51 uint64_t
36 uas_proximity_event_get_timestamp(52 uas_proximity_event_get_timestamp(
37 UASProximityEvent* event);53 UASProximityEvent* event);
38 54
55 /**
56 * \brief Query the discrete distance as reported by the proximity sensor.
57 * \ingroup sensor_access
58 * \returns The discrete distance as reported by the proximity sensor.
59 * \param[in] event The reading to be queried.
60 */
39 UASProximityDistance61 UASProximityDistance
40 uas_proximity_event_get_distance(62 uas_proximity_event_get_distance(
41 UASProximityEvent* event);63 UASProximityEvent* event);
4264
=== modified file 'include/ubuntu/application/sensors/light.h'
--- include/ubuntu/application/sensors/light.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/application/sensors/light.h 2013-07-05 09:17:25 +0000
@@ -26,36 +26,94 @@
26extern "C" {26extern "C" {
27#endif27#endif
2828
29 /**
30 * \brief Opaque type that models the ambient light sensor.
31 * \ingroup sensor_access
32 */
29 typedef void UASensorsLight;33 typedef void UASensorsLight;
34
35 /**
36 * \brief Callback type used by applications to subscribe to ambient light sensor events.
37 * \ingroup sensor_access
38 */
30 typedef void (*on_light_event_cb)(UASLightEvent* event,39 typedef void (*on_light_event_cb)(UASLightEvent* event,
31 void* context);40 void* context);
3241
42 /**
43 * \brief Create a new object for accessing the ambient light sensor.
44 * \ingroup sensor_access
45 * \returns A new instance or NULL in case of errors.
46 */
33 UASensorsLight*47 UASensorsLight*
34 ua_sensors_light_new(); 48 ua_sensors_light_new();
3549
36 UStatus50 /**
37 ua_sensors_light_enable(51 * \brief Enables the supplied ambient light sensor.
38 UASensorsLight* sensor);52 * \ingroup sensor_access
3953 * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
40 UStatus54 * \param[in] sensor The sensor instance to be enabled.
41 ua_sensors_light_enable(55 */
42 UASensorsLight* sensor);56 UStatus
4357 ua_sensors_light_enable(
58 UASensorsLight* sensor);
59
60 /**
61 * \brief Disables the supplied ambient light sensor.
62 * \ingroup sensor_access
63 * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
64 * \param[in] sensor The sensor instance to be disabled.
65 */
66 UStatus
67 ua_sensors_light_enable(
68 UASensorsLight* sensor);
69
70 /**
71 * \brief Queries the minimum delay between two readings for the supplied sensor.
72 * \ingroup sensor_access
73 * \returns The minimum delay between two readings in [ms].
74 * \param[in] sensor The sensor instance to be queried.
75 */
44 uint32_t76 uint32_t
45 ua_sensors_light_get_min_delay(77 ua_sensors_light_get_min_delay(
46 UASensorsLight* sensor);78 UASensorsLight* sensor);
47 79
80 /**
81 * \brief Queries the minimum value that can be reported by the sensor.
82 * \ingroup sensor_access
83 * \returns The minimum value that can be reported by the sensor.
84 * \param[in] sensor The sensor instance to be queried.
85 */
48 float86 float
49 ua_sensors_light_get_min_value(87 ua_sensors_light_get_min_value(
50 UASensorsLight* sensor);88 UASensorsLight* sensor);
51 89
90 /**
91 * \brief Queries the maximum value that can be reported by the sensor.
92 * \ingroup sensor_access
93 * \returns The maximum value that can be reported by the sensor.
94 * \param[in] sensor The sensor instance to be queried.
95 */
52 float96 float
53 ua_sensors_light_get_max_value(97 ua_sensors_light_get_max_value(
54 UASensorsLight* sensor);98 UASensorsLight* sensor);
55 99
100 /**
101 * \brief Queries the numeric resolution supported by the sensor
102 * \ingroup sensor_access
103 * \returns The numeric resolution supported by the sensor.
104 * \param[in] sensor The sensor instance to be queried.
105 */
56 float106 float
57 ua_sensors_light_get_resolution(107 ua_sensors_light_get_resolution(
58 UASensorsLight* sensor);108 UASensorsLight* sensor);
109
110 /**
111 * \brief Set the callback to be invoked whenever a new sensor reading is available.
112 * \ingroup sensor_access
113 * \param[in] sensor The sensor instance to associate the callback with.
114 * \param[in] cb The callback to be invoked.
115 * \param[in] ctx The context supplied to the callback invocation.
116 */
59 void117 void
60 ua_sensors_light_set_reading_cb(118 ua_sensors_light_set_reading_cb(
61 UASensorsLight* sensor,119 UASensorsLight* sensor,
62120
=== modified file 'include/ubuntu/application/sensors/proximity.h'
--- include/ubuntu/application/sensors/proximity.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/application/sensors/proximity.h 2013-07-05 09:17:25 +0000
@@ -26,36 +26,94 @@
26extern "C" {26extern "C" {
27#endif27#endif
2828
29 /**
30 * \brief Opaque type that models the proximity sensor.
31 * \ingroup sensor_access
32 */
29 typedef void UASensorsProximity;33 typedef void UASensorsProximity;
34
35 /**
36 * \brief Callback type used by applications to subscribe to proximity sensor events.
37 * \ingroup sensor_access
38 */
30 typedef void (*on_proximity_event_cb)(UASProximityEvent* event,39 typedef void (*on_proximity_event_cb)(UASProximityEvent* event,
31 void* context);40 void* context);
3241
42 /**
43 * \brief Create a new object for accessing the proximity sensor.
44 * \ingroup sensor_access
45 * \returns A new instance or NULL in case of errors.
46 */
33 UASensorsProximity*47 UASensorsProximity*
34 ua_sensors_proximity_new(); 48 ua_sensors_proximity_new();
3549
50 /**
51 * \brief Enables the supplied proximity sensor.
52 * \ingroup sensor_access
53 * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
54 * \param[in] sensor The sensor instance to be enabled.
55 */
36 UStatus56 UStatus
37 ua_sensors_proximity_enable(57 ua_sensors_proximity_enable(
38 UASensorsProximity* sensor);58 UASensorsProximity* sensor);
3959
60 /**
61 * \brief Disables the supplied proximity sensor.
62 * \ingroup sensor_access
63 * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
64 * \param[in] sensor The sensor instance to be disabled.
65 */
40 UStatus66 UStatus
41 ua_sensors_proximity_disable(67 ua_sensors_proximity_disable(
42 UASensorsProximity* sensor);68 UASensorsProximity* sensor);
4369
70 /**
71 * \brief Queries the minimum delay between two readings for the supplied sensor.
72 * \ingroup sensor_access
73 * \returns The minimum delay between two readings in [ms].
74 * \param[in] sensor The sensor instance to be queried.
75 */
44 uint32_t76 uint32_t
45 ua_sensors_proximity_get_min_delay(77 ua_sensors_proximity_get_min_delay(
46 UASensorsProximity* sensor);78 UASensorsProximity* sensor);
47 79
80 /**
81 * \brief Queries the minimum value that can be reported by the sensor.
82 * \ingroup sensor_access
83 * \returns The minimum value that can be reported by the sensor.
84 * \param[in] sensor The sensor instance to be queried.
85 */
48 float86 float
49 ua_sensors_proximity_get_min_value(87 ua_sensors_proximity_get_min_value(
50 UASensorsProximity* sensor);88 UASensorsProximity* sensor);
51 89
90 /**
91 * \brief Queries the maximum value that can be reported by the sensor.
92 * \ingroup sensor_access
93 * \returns The maximum value that can be reported by the sensor.
94 * \param[in] sensor The sensor instance to be queried.
95 */
52 float96 float
53 ua_sensors_proximity_get_max_value(97 ua_sensors_proximity_get_max_value(
54 UASensorsProximity* sensor);98 UASensorsProximity* sensor);
55 99
100 /**
101 * \brief Queries the numeric resolution supported by the sensor
102 * \ingroup sensor_access
103 * \returns The numeric resolution supported by the sensor.
104 * \param[in] sensor The sensor instance to be queried.
105 */
56 float106 float
57 ua_sensors_proximity_get_resolution(107 ua_sensors_proximity_get_resolution(
58 UASensorsProximity* sensor);108 UASensorsProximity* sensor);
109
110 /**
111 * \brief Set the callback to be invoked whenever a new sensor reading is available.
112 * \ingroup sensor_access
113 * \param[in] sensor The sensor instance to associate the callback with.
114 * \param[in] cb The callback to be invoked.
115 * \param[in] ctx The context supplied to the callback invocation.
116 */
59 void117 void
60 ua_sensors_proximity_set_reading_cb(118 ua_sensors_proximity_set_reading_cb(
61 UASensorsProximity* sensor,119 UASensorsProximity* sensor,
62120
=== added directory 'include/ubuntu/hardware'
=== renamed file 'include/ubuntu/application/ubuntu_application_gps.h' => 'include/ubuntu/hardware/gps.h'
--- include/ubuntu/application/ubuntu_application_gps.h 2013-05-27 21:49:05 +0000
+++ include/ubuntu/hardware/gps.h 2013-07-05 09:17:25 +0000
@@ -14,9 +14,10 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */18 */
18#ifndef UBUNTU_APPLICATION_GPS_H_19#ifndef UBUNTU_HARDWARE_GPS_H_
19#define UBUNTU_APPLICATION_GPS_H_20#define UBUNTU_HARDWARE_GPS_H_
2021
21#include <stdint.h>22#include <stdint.h>
22#include <stddef.h>23#include <stddef.h>
@@ -25,149 +26,170 @@
25extern "C" {26extern "C" {
26#endif27#endif
2728
28/** \defgroup gps_access Functions and types for accessing location services. */29/** \defgroup gps_access Functions and types for accessing GPS H/W. */
30
31/**
32 * Maximum number of SVs for u_hardware_gps_sv_status_callback().
33 * \ingroup gps_access
34 */
35#define U_HARDWARE_GPS_MAX_SVS 32
2936
30/** 37/**
31 * Maximum number of SVs for gps_sv_status_callback(). 38 * The status of the GPS hardware.
32 * \ingroup gps_access39 * \ingroup gps_access
33 */40 */
34#define UBUNTU_GPS_MAX_SVS 32
35
36enum41enum
37{42{
38 /** GPS status unknown. */43 /** GPS status unknown. */
39 UBUNTU_GPS_STATUS_NONE = 0,44 U_HARDWARE_GPS_STATUS_NONE = 0,
40 /** GPS has begun navigating. */45 /** GPS has begun navigating. */
41 UBUNTU_GPS_STATUS_SESSION_BEGIN = 1,46 U_HARDWARE_GPS_STATUS_SESSION_BEGIN = 1,
42 /** GPS has stopped navigating. */47 /** GPS has stopped navigating. */
43 UBUNTU_GPS_STATUS_SESSION_END = 2,48 U_HARDWARE_GPS_STATUS_SESSION_END = 2,
44 /** GPS has powered on but is not navigating. */49 /** GPS has powered on but is not navigating. */
45 UBUNTU_GPS_STATUS_ENGINE_ON = 3,50 U_HARDWARE_GPS_STATUS_ENGINE_ON = 3,
46 /** GPS is powered off. */51 /** GPS is powered off. */
47 UBUNTU_GPS_STATUS_ENGINE_OFF = 452 U_HARDWARE_GPS_STATUS_ENGINE_OFF = 4
48};53};
4954
50/** 55/**
51 * Flags for the gps_set_capabilities callback.56 * Flags for the gps_set_capabilities callback.
52 * \ingroup gps_access57 * \ingroup gps_access
53 * GPS HAL schedules fixes for UBUNTU_GPS_POSITION_RECURRENCE_PERIODIC mode.58 * GPS HAL schedules fixes for U_HARDWARE_GPS_POSITION_RECURRENCE_PERIODIC mode.
54 * If this is not set, then the framework will use 1000ms for min_interval59 * If this is not set, then the framework will use 1000ms for min_interval
55 * and will start and call start() and stop() to schedule the GPS.60 * and will start and call start() and stop() to schedule the GPS.
56 */61 */
57#define UBUNTU_GPS_CAPABILITY_SCHEDULING 0x000000162#define U_HARDWARE_GPS_CAPABILITY_SCHEDULING 0x0000001
58/** GPS supports MS-Based AGPS mode */63/** GPS supports MS-Based AGPS mode */
59#define UBUNTU_GPS_CAPABILITY_MSB 0x000000264#define U_HARDWARE_GPS_CAPABILITY_MSB 0x0000002
60/** GPS supports MS-Assisted AGPS mode */65/** GPS supports MS-Assisted AGPS mode */
61#define UBUNTU_GPS_CAPABILITY_MSA 0x000000466#define U_HARDWARE_GPS_CAPABILITY_MSA 0x0000004
62/** GPS supports single-shot fixes */67/** GPS supports single-shot fixes */
63#define UBUNTU_GPS_CAPABILITY_SINGLE_SHOT 0x000000868#define U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT 0x0000008
64/** GPS supports on demand time injection */69/** GPS supports on demand time injection */
65#define UBUNTU_GPS_CAPABILITY_ON_DEMAND_TIME 0x000001070#define U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
6671
67/**72/**
68 * UbuntuGpsNiNotifyFlags constants73 * UHardwareGpsNiNotifyFlags constants
69 * \ingroup gps_access74 * \ingroup gps_access
70 */75 */
71typedef uint32_t UbuntuGpsNiNotifyFlags;76typedef uint32_t UHardwareGpsNiNotifyFlags;
72/** NI requires notification */77/** NI requires notification */
73#define UBUNTU_GPS_NI_NEED_NOTIFY 0x000178#define U_HARDWARE_GPS_NI_NEED_NOTIFY 0x0001
74/** NI requires verification */79/** NI requires verification */
75#define UBUNTU_GPS_NI_NEED_VERIFY 0x000280#define U_HARDWARE_GPS_NI_NEED_VERIFY 0x0002
76/** NI requires privacy override, no notification/minimal trace */81/** NI requires privacy override, no notification/minimal trace */
77#define UBUNTU_GPS_NI_PRIVACY_OVERRIDE 0x000482#define U_HARDWARE_GPS_NI_PRIVACY_OVERRIDE 0x0004
7883
79/**84/**
80 * GPS NI responses, used to define the response in85 * GPS NI responses, used to define the response in
81 * NI structures86 * NI structures
82 * \ingroup gps_access87 * \ingroup gps_access
83 */88 */
84typedef int UbuntuGpsUserResponseType;89typedef int UHardwareGpsUserResponseType;
90
85enum91enum
86{92{
87 UBUNTU_UBUNTU_GPS_NI_RESPONSE_ACCEPT = 1,93 U_HARDWARE_GPS_NI_RESPONSE_ACCEPT = 1,
88 UBUNTU_UBUNTU_GPS_NI_RESPONSE_DENY = 2,94 U_HARDWARE_GPS_NI_RESPONSE_DENY = 2,
89 UBUNTU_UBUNTU_GPS_NI_RESPONSE_NORESP = 395 U_HARDWARE_GPS_NI_RESPONSE_NORESP = 3
90};96};
9197
92enum98enum
93{99{
94 UBUNTU_GPS_NI_TYPE_VOICE = 1,100 U_HARDWARE_GPS_NI_TYPE_VOICE = 1,
95 UBUNTU_GPS_NI_TYPE_UMTS_SUPL = 2,101 U_HARDWARE_GPS_NI_TYPE_UMTS_SUPL = 2,
96 UBUNTU_GPS_NI_TYPE_UMTS_CTRL_PLANE = 3102 U_HARDWARE_GPS_NI_TYPE_UMTS_CTRL_PLANE = 3
97};103};
98104
99/**105/**
100 * String length constants106 * String length constants
101 * \ingroup gps_access107 * \ingroup gps_access
102 */108 */
103#define UBUNTU_GPS_NI_SHORT_STRING_MAXLEN 256109#define U_HARDWARE_GPS_NI_SHORT_STRING_MAXLEN 256
104#define UBUNTU_GPS_NI_LONG_STRING_MAXLEN 2048110#define U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN 2048
105111
106/**112/**
107 * NI data encoding scheme113 * NI data encoding scheme
108 * \ingroup gps_access114 * \ingroup gps_access
109 */115 */
110typedef int UbuntuGpsNiEncodingType;116typedef int UHardwareGpsNiEncodingType;
111enum117
112{118/**
113 UBUNTU_GPS_ENC_NONE = 0,119 * Known encoding types for Ni responses
114 UBUNTU_GPS_ENC_SUPL_GSM_DEFAULT = 1,120 * \ingroup gps_access
115 UBUNTU_GPS_ENC_SUPL_UTF8 = 2,121 */
116 UBUNTU_GPS_ENC_SUPL_UCS2 = 3,122enum
117 UBUNTU_GPS_ENC_UNKNOWN = -1123{
118};124 U_HARDWARE_GPS_ENC_NONE = 0,
119125 U_HARDWARE_GPS_ENC_SUPL_GSM_DEFAULT = 1,
120enum126 U_HARDWARE_GPS_ENC_SUPL_UTF8 = 2,
121{127 U_HARDWARE_GPS_ENC_SUPL_UCS2 = 3,
122 UBUNTU_AGPS_TYPE_SUPL = 1,128 U_HARDWARE_GPS_ENC_UNKNOWN = -1
123 UBUNTU_AGPS_TYPE_C2K = 2129};
124};130
125131/**
126132 * Known AGPS types
133 * \ingroup gps_access
134 */
135enum
136{
137 U_HARDWARE_GPS_AGPS_TYPE_SUPL = 1,
138 U_HARDWARE_GPS_AGPS_TYPE_C2K = 2
139};
140
141/**
142 * Known positioning modes
143 * \ingroup gps_access
144 */
127enum145enum
128{146{
129 /** Mode for running GPS standalone (no assistance). */147 /** Mode for running GPS standalone (no assistance). */
130 UBUNTU_GPS_POSITION_MODE_STANDALONE = 0,148 U_HARDWARE_GPS_POSITION_MODE_STANDALONE = 0,
131 /** AGPS MS-Based mode. */149 /** AGPS MS-Based mode. */
132 UBUNTU_GPS_POSITION_MODE_MS_BASED = 1,150 U_HARDWARE_GPS_POSITION_MODE_MS_BASED = 1,
133 /** AGPS MS-Assisted mode. */151 /** AGPS MS-Assisted mode. */
134 UBUNTU_GPS_POSITION_MODE_MS_ASSISTED = 2152 U_HARDWARE_GPS_POSITION_MODE_MS_ASSISTED = 2
135};153};
136154
155/**
156 * Known positioning modes
157 * \ingroup gps_access
158 */
137enum159enum
138{160{
139 /** Receive GPS fixes on a recurring basis at a specified period. */161 /** Receive GPS fixes on a recurring basis at a specified period. */
140 UBUNTU_GPS_POSITION_RECURRENCE_PERIODIC = 0,162 U_HARDWARE_GPS_POSITION_RECURRENCE_PERIODIC = 0,
141 /** Request a single shot GPS fix. */163 /** Request a single shot GPS fix. */
142 UBUNTU_GPS_POSITION_RECURRENCE_SINGLE = 1164 U_HARDWARE_GPS_POSITION_RECURRENCE_SINGLE = 1
143};165};
144166
145enum167enum
146{168{
147 /** GPS requests data connection for AGPS. */169 /** GPS requests data connection for AGPS. */
148 UBUNTU_GPS_REQUEST_AGPS_DATA_CONN = 1,170 U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN = 1,
149 /** GPS releases the AGPS data connection. */171 /** GPS releases the AGPS data connection. */
150 UBUNTU_GPS_RELEASE_AGPS_DATA_CONN = 2,172 U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN = 2,
151 /** AGPS data connection initiated */173 /** AGPS data connection initiated */
152 UBUNTU_GPS_AGPS_DATA_CONNECTED = 3,174 U_HARDWARE_GPS_AGPS_DATA_CONNECTED = 3,
153 /** AGPS data connection completed */175 /** AGPS data connection completed */
154 UBUNTU_GPS_AGPS_DATA_CONN_DONE = 4,176 U_HARDWARE_GPS_AGPS_DATA_CONN_DONE = 4,
155 /** AGPS data connection failed */177 /** AGPS data connection failed */
156 UBUNTU_GPS_AGPS_DATA_CONN_FAILED = 5178 U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED = 5
157};179};
158180
159/** UbuntuGpsLocation has valid latitude and longitude. */181/** UHardwareGpsLocation has valid latitude and longitude. */
160#define UBUNTU_GPS_LOCATION_HAS_LAT_LONG 0x0001182#define U_HARDWARE_GPS_LOCATION_HAS_LAT_LONG 0x0001
161/** UbuntuGpsLocation has valid altitude. */183/** UHardwareGpsLocation has valid altitude. */
162#define UBUNTU_GPS_LOCATION_HAS_ALTITUDE 0x0002184#define U_HARDWARE_GPS_LOCATION_HAS_ALTITUDE 0x0002
163/** UbuntuGpsLocation has valid speed. */185/** UHardwareGpsLocation has valid speed. */
164#define UBUNTU_GPS_LOCATION_HAS_SPEED 0x0004186#define U_HARDWARE_GPS_LOCATION_HAS_SPEED 0x0004
165/** UbuntuGpsLocation has valid bearing. */187/** UHardwareGpsLocation has valid bearing. */
166#define UBUNTU_GPS_LOCATION_HAS_BEARING 0x0008188#define U_HARDWARE_GPS_LOCATION_HAS_BEARING 0x0008
167/** UbuntuGpsLocation has valid accuracy. */189/** UHardwareGpsLocation has valid accuracy. */
168#define UBUNTU_GPS_LOCATION_HAS_ACCURACY 0x0010190#define U_HARDWARE_GPS_LOCATION_HAS_ACCURACY 0x0010
169191
170typedef struct UbuntuGps_* UbuntuGps;192typedef struct UHardwareGps_* UHardwareGps;
171193
172/**194/**
173 * Models a location as reported by the GPS HAL.195 * Models a location as reported by the GPS HAL.
@@ -175,234 +197,264 @@
175 */197 */
176typedef struct198typedef struct
177{199{
178 /** set to sizeof(UbuntuGpsLocation) */200 /** set to sizeof(UHardwareGpsLocation) */
179 size_t size;201 size_t size;
180 /** Contains UBUNTU_GPS_LOCATION_* flags bits. */202 /** Contains U_HARDWARE_GPS_LOCATION_* flags bits. */
181 uint16_t flags;203 uint16_t flags;
182 /** Represents latitude in degrees. */204 /** Represents latitude in degrees. */
183 double latitude;205 double latitude;
184 /** Represents longitude in degrees. */206 /** Represents longitude in degrees. */
185 double longitude;207 double longitude;
186 /** Represents altitude in meters above the WGS 84 reference208 /** Represents altitude in meters above the WGS 84 reference
187 * ellipsoid. */209 * ellipsoid. */
188 double altitude;210 double altitude;
189 /** Represents speed in meters per second. */211 /** Represents speed in meters per second. */
190 float speed;212 float speed;
191 /** Represents heading in degrees. */213 /** Represents heading in degrees. */
192 float bearing;214 float bearing;
193 /** Represents expected accuracy in meters. */215 /** Represents expected accuracy in meters. */
194 float accuracy;216 float accuracy;
195 /** Timestamp for the location fix, in milliseconds since January 1, 1970 */217 /** Timestamp for the location fix, in milliseconds since January 1, 1970 */
196 int64_t timestamp;218 int64_t timestamp;
197} UbuntuGpsLocation;219} UHardwareGpsLocation;
198220
199/** 221/**
200 * Represents space vehicle (satellite) information. 222 * Represents space vehicle (satellite) information.
201 * \ingroup gps_access223 * \ingroup gps_access
202 */224 */
203typedef struct {225typedef struct {
204 /** set to sizeof(UbuntuGpsSvInfo) */226 /** set to sizeof(UHardwareGpsSvInfo) */
205 size_t size;227 size_t size;
206 /** Pseudo-random number for the SV. */228 /** Pseudo-random number for the SV. */
207 int prn;229 int prn;
208 /** Signal to noise ratio. */230 /** Signal to noise ratio. */
209 float snr;231 float snr;
210 /** Elevation of SV in degrees. */232 /** Elevation of SV in degrees. */
211 float elevation;233 float elevation;
212 /** Azimuth of SV in degrees. */234 /** Azimuth of SV in degrees. */
213 float azimuth;235 float azimuth;
214} UbuntuGpsSvInfo;236} UHardwareGpsSvInfo;
215237
216/** 238/**
217 * Represents SV (Space Vehicle) status. 239 * Represents SV (Space Vehicle) status.
218 * \ingroup gps_access240 * \ingroup gps_access
219 */241 */
220typedef struct {242typedef struct {
221 /** set to sizeof(GpsSvStatus) */243 /** set to sizeof(GpsSvStatus) */
222 size_t size;244 size_t size;
223245
224 /** Number of SVs currently visible. */246 /** Number of SVs currently visible. */
225 int num_svs;247 int num_svs;
226248
227 /** Contains an array of SV information. */249 /** Contains an array of SV information. */
228 UbuntuGpsSvInfo sv_list[UBUNTU_GPS_MAX_SVS];250 UHardwareGpsSvInfo sv_list[U_HARDWARE_GPS_MAX_SVS];
229251
230 /** Represents a bit mask indicating which SVs252 /** Represents a bit mask indicating which SVs
231 * have ephemeris data.253 * have ephemeris data.
232 */254 */
233 uint32_t ephemeris_mask;255 uint32_t ephemeris_mask;
234256
235 /** Represents a bit mask indicating which SVs257 /** Represents a bit mask indicating which SVs
236 * have almanac data.258 * have almanac data.
237 */259 */
238 uint32_t almanac_mask;260 uint32_t almanac_mask;
239261
240 /**262 /**
241 * Represents a bit mask indicating which SVs263 * Represents a bit mask indicating which SVs
242 * were used for computing the most recent position fix.264 * were used for computing the most recent position fix.
243 */265 */
244 uint32_t used_in_fix_mask;266 uint32_t used_in_fix_mask;
245} UbuntuGpsSvStatus;267} UHardwareGpsSvStatus;
246268
247/** 269/**
248 * Represents the status of AGPS. 270 * Represents the status of AGPS.
249 * \ingroup gps_access271 * \ingroup gps_access
250 */272 */
251typedef struct {273typedef struct {
252 /** set to sizeof(UbuntuAgpsStatus) */274 /** set to sizeof(UHardwareGpsAGpsStatus) */
253 size_t size;275 size_t size;
254276
255 uint16_t type;277 uint16_t type;
256 uint16_t status;278 uint16_t status;
257 uint32_t ipaddr;279 uint32_t ipaddr;
258} UbuntuAgpsStatus;280} UHardwareGpsAGpsStatus;
259281
260/** 282/**
261 * Represents an NI request 283 * Represents an NI request
262 * \ingroup gps_access284 * \ingroup gps_access
263 */285 */
264typedef struct {286typedef struct {
265 /** set to sizeof(UbuntuGpsNiNotification) */287 /** set to sizeof(UHardwareGpsNiNotification) */
266 size_t size;288 size_t size;
267289
268 /**290 /**
269 * An ID generated by HAL to associate NI notifications and UI291 * An ID generated by HAL to associate NI notifications and UI
270 * responses292 * responses
271 */293 */
272 int notification_id;294 int notification_id;
273295
274 /**296 /**
275 * An NI type used to distinguish different categories of NI297 * An NI type used to distinguish different categories of NI
276 * events, such as UBUNTU_GPS_NI_TYPE_VOICE, UBUNTU_GPS_NI_TYPE_UMTS_SUPL, ...298 * events, such as U_HARDWARE_GPS_NI_TYPE_VOICE, U_HARDWARE_GPS_NI_TYPE_UMTS_SUPL, ...
277 */299 */
278 uint32_t ni_type;300 uint32_t ni_type;
279301
280 /**302 /**
281 * Notification/verification options, combinations of UbuntuGpsNiNotifyFlags constants303 * Notification/verification options, combinations of UHardwareGpsNiNotifyFlags constants
282 */304 */
283 UbuntuGpsNiNotifyFlags notify_flags;305 UHardwareGpsNiNotifyFlags notify_flags;
284306
285 /**307 /**
286 * Timeout period to wait for user response.308 * Timeout period to wait for user response.
287 * Set to 0 for no time out limit.309 * Set to 0 for no time out limit.
288 */310 */
289 int timeout;311 int timeout;
290312
291 /**313 /**
292 * Default response when time out.314 * Default response when time out.
293 */315 */
294 UbuntuGpsUserResponseType default_response;316 UHardwareGpsUserResponseType default_response;
295317
296 /**318 /**
297 * Requestor ID319 * Requestor ID
298 */320 */
299 char requestor_id[UBUNTU_GPS_NI_SHORT_STRING_MAXLEN];321 char requestor_id[U_HARDWARE_GPS_NI_SHORT_STRING_MAXLEN];
300322
301 /**323 /**
302 * Notification message. It can also be used to store client_id in some cases324 * Notification message. It can also be used to store client_id in some cases
303 */325 */
304 char text[UBUNTU_GPS_NI_LONG_STRING_MAXLEN];326 char text[U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN];
305327
306 /**328 /**
307 * Client name decoding scheme329 * Client name decoding scheme
308 */330 */
309 UbuntuGpsNiEncodingType requestor_id_encoding;331 UHardwareGpsNiEncodingType requestor_id_encoding;
310332
311 /**333 /**
312 * Client name decoding scheme334 * Client name decoding scheme
313 */335 */
314 UbuntuGpsNiEncodingType text_encoding;336 UHardwareGpsNiEncodingType text_encoding;
315337
316 /**338 /**
317 * A pointer to extra data. Format:339 * A pointer to extra data. Format:
318 * key_1 = value_1340 * key_1 = value_1
319 * key_2 = value_2341 * key_2 = value_2
320 */342 */
321 char extras[UBUNTU_GPS_NI_LONG_STRING_MAXLEN];343 char extras[U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN];
322344
323} UbuntuGpsNiNotification;345} UHardwareGpsNiNotification;
324346
325typedef void (* UbuntuGpsLocationCallback)(UbuntuGpsLocation* location, void* context);347typedef void (*UHardwareGpsLocationCallback)(UHardwareGpsLocation *location, void *context);
326typedef void (* UbuntuGpsStatusCallback)(uint16_t status, void* context);348typedef void (*UHardwareGpsStatusCallback)(uint16_t status, void *context);
327typedef void (* UbuntuGpsSvStatusCallback)(UbuntuGpsSvStatus* sv_info, void* context);349typedef void (*UHardwareGpsSvStatusCallback)(UHardwareGpsSvStatus *sv_info, void *context);
328typedef void (* UbuntuGpsNmeaCallback)(int64_t timestamp, const char* nmea, int length, void* context);350typedef void (*UHardwareGpsNmeaCallback)(int64_t timestamp, const char *nmea, int length, void *context);
329typedef void (* UbuntuGpsSetCapabilities)(uint32_t capabilities, void* context);351typedef void (*UHardwareGpsSetCapabilities)(uint32_t capabilities, void *context);
330typedef void (* UbuntuGpsRequestUtcTime)(void* context);352typedef void (*UHardwareGpsRequestUtcTime)(void *context);
331353
332/** Callback to request the client to download XTRA data.354/** Callback to request the client to download XTRA data.
333 * The client should download XTRA data and inject it by calling inject_xtra_data().355 * The client should download XTRA data and inject it by calling inject_xtra_data().
334 */356 */
335typedef void (* UbuntuGpsXtraDownloadRequest)(void* context);357typedef void (*UHardwareGpsXtraDownloadRequest)(void *context);
336358
337/** Callback with AGPS status information.359/** Callback with AGPS status information.
338 */360 */
339typedef void (* UbuntuAgpsStatusCallback)(UbuntuAgpsStatus* status, void* context);361typedef void (*UHardwareGpsAGpsStatusCallback)(UHardwareGpsAGpsStatus *status, void *context);
340362
341/** Callback with NI notification.363/** Callback with NI notification.
342 */364 */
343typedef void (*UbuntuGpsNiNotifyCallback)(UbuntuGpsNiNotification *notification, void* context);365typedef void (*UHardwareGpsNiNotifyCallback)(UHardwareGpsNiNotification *notification, void *context);
344366
345/*367/*
346 Callback for AGPS RIL (Radio Interface Library) set id368 Callback for AGPS RIL (Radio Interface Library) set id
347*/369*/
348typedef void (*UbuntuAgpsRilRequestSetId)(uint32_t flags, void* context);370typedef void (*UHardwareGpsAGpsRilRequestSetId)(uint32_t flags, void *context);
349typedef void (*UbuntuAgpsRilRequestRefLoc)(uint32_t flags, void* context);371typedef void (*UHardwareGpsAGpsRilRequestRefLoc)(uint32_t flags, void *context);
350372
351typedef struct373typedef struct
352{374{
353375
354 UbuntuGpsLocationCallback location_cb;376 UHardwareGpsLocationCallback location_cb;
355 UbuntuGpsStatusCallback status_cb;377 UHardwareGpsStatusCallback status_cb;
356 UbuntuGpsSvStatusCallback sv_status_cb;378 UHardwareGpsSvStatusCallback sv_status_cb;
357 UbuntuGpsNmeaCallback nmea_cb;379 UHardwareGpsNmeaCallback nmea_cb;
358 UbuntuGpsSetCapabilities set_capabilities_cb;380 UHardwareGpsSetCapabilities set_capabilities_cb;
359 UbuntuGpsRequestUtcTime request_utc_time_cb;381 UHardwareGpsRequestUtcTime request_utc_time_cb;
360382
361 UbuntuGpsXtraDownloadRequest xtra_download_request_cb;383 UHardwareGpsXtraDownloadRequest xtra_download_request_cb;
362384
363 UbuntuAgpsStatusCallback agps_status_cb;385 UHardwareGpsAGpsStatusCallback agps_status_cb;
364386
365 UbuntuGpsNiNotifyCallback gps_ni_notify_cb;387 UHardwareGpsNiNotifyCallback gps_ni_notify_cb;
366388
367 UbuntuAgpsRilRequestSetId request_setid_cb;389 UHardwareGpsAGpsRilRequestSetId request_setid_cb;
368 UbuntuAgpsRilRequestRefLoc request_refloc_cb;390 UHardwareGpsAGpsRilRequestRefLoc request_refloc_cb;
369391
370 void* context;392 void* context;
371} UbuntuGpsParams;393} UHardwareGpsParams;
372394
373/*395/*
374 You must create only one instance per process/application.396 You must create only one instance per process/application.
375*/397*/
376UbuntuGps ubuntu_gps_new(UbuntuGpsParams* params);398UHardwareGps
377void ubuntu_gps_delete(UbuntuGps handle);399u_hardware_gps_new(UHardwareGpsParams *params);
378400
379bool ubuntu_gps_start(UbuntuGps self);401void
380bool ubuntu_gps_stop(UbuntuGps self);402u_hardware_gps_delete(UHardwareGps handle);
403
404bool
405u_hardware_gps_start(UHardwareGps self);
406
407bool
408u_hardware_gps_stop(UHardwareGps self);
381409
382/*410/*
383 \param time NTP time, in milliseconds since Jan 1st 1970.411 \param time NTP time, in milliseconds since Jan 1st 1970.
384 \param time_reference time from the internal clock at the moment that NTP time was taken.412 \param time_reference time from the internal clock at the moment that NTP time was taken.
385 \param uncertainty possible deviation in the time supplied (uncertainty) in milliseconds.413 \param uncertainty possible deviation in the time supplied (uncertainty) in milliseconds.
386 */414 */
387void ubuntu_gps_inject_time(UbuntuGps self, int64_t time, int64_t time_reference, int uncertainty);415void
388416u_hardware_gps_inject_time(
389void ubuntu_gps_inject_location(UbuntuGps self, double latitude, double longitude, float accuracy);417 UHardwareGps self,
390void ubuntu_gps_delete_aiding_data(UbuntuGps self, uint16_t flags);418 int64_t time,
419 int64_t time_reference,
420 int uncertainty);
421
422void
423u_hardware_gps_inject_location(
424 UHardwareGps self,
425 double latitude,
426 double longitude,
427 float accuracy);
428
429void
430u_hardware_gps_delete_aiding_data(
431 UHardwareGps self,
432 uint16_t flags);
391433
392/*434/*
393 \param mode One of the UBUNTU_GPS_POSITION_MODE_* values435 \param mode One of the U_HARDWARE_GPS_POSITION_MODE_* values
394 \param recurrence One of the UBUNTU_GPS_POSITION_RECURRENCE_* values436 \param recurrence One of the U_HARDWARE_GPS_POSITION_RECURRENCE_* values
395 \param min_interval represents the time between fixes in milliseconds.437 \param min_interval represents the time between fixes in milliseconds.
396 \param preferred_accuracy The requested fix accuracy in meters. Can be zero.438 \param preferred_accuracy The requested fix accuracy in meters. Can be zero.
397 \param preferred_time The requested time to first fix in milliseconds. Can be zero.439 \param preferred_time The requested time to first fix in milliseconds. Can be zero.
398 */440 */
399bool ubuntu_gps_set_position_mode(UbuntuGps self, uint32_t mode, uint32_t recurrence,441bool
400 uint32_t min_interval, uint32_t preferred_accuracy,442u_hardware_gps_set_position_mode(
401 uint32_t preferred_time);443 UHardwareGps self,
402void ubuntu_gps_inject_xtra_data(UbuntuGps self, char* data, int length);444 uint32_t mode,
445 uint32_t recurrence,
446 uint32_t min_interval,
447 uint32_t preferred_accuracy,
448 uint32_t preferred_time);
449
450void
451u_hardware_gps_inject_xtra_data(
452 UHardwareGps self,
453 char* data,
454 int length);
403455
404#ifdef __cplusplus456#ifdef __cplusplus
405}457}
406#endif458#endif
407459
408#endif // UBUNTU_APPLICATION_GPS_H_460#endif // UBUNTU_HARDWARE_GPS_H_
409461
=== modified file 'include/ubuntu/status.h'
--- include/ubuntu/status.h 2013-05-30 02:03:42 +0000
+++ include/ubuntu/status.h 2013-07-05 09:17:25 +0000
@@ -20,10 +20,15 @@
20#ifndef UBUNTU_STATUS_H_20#ifndef UBUNTU_STATUS_H_
21#define UBUNTU_STATUS_H_21#define UBUNTU_STATUS_H_
2222
23/**
24 * \brief Indicates the status of an operation.
25 */
23typedef enum26typedef enum
24{27{
25 U_STATUS_SUCCESS,28 U_STATUS_SUCCESS, ///< Operation finished successfully.
26 U_STATUS_ERROR29 U_STATUS_ERROR ///< Operation finished with an error.
27} UStatus;30} UbuntuStatus;
31
32typedef UbuntuStatus UStatus;
2833
29#endif /* UBUNTU_STATUS_H_ */34#endif /* UBUNTU_STATUS_H_ */
3035
=== modified file 'include/ubuntu/unit.h'
--- include/ubuntu/unit.h 2013-05-27 17:09:02 +0000
+++ include/ubuntu/unit.h 2013-07-05 09:17:25 +0000
@@ -20,13 +20,16 @@
20#ifndef UBUNTU_UNIT_H_20#ifndef UBUNTU_UNIT_H_
21#define UBUNTU_UNIT_H_21#define UBUNTU_UNIT_H_
2222
23/**
24 * \brief Describes units known to the platform integration layer.
25 */
23typedef enum26typedef enum
24{27{
25 U_DEGREE,28 U_DEGREE,
26 U_METER,29 U_METER,
27 U_SECOND,30 U_SECOND,
28 U_METER_PER_SECOND,31 U_METER_PER_SECOND,
29 U_MICRO_TESLA32 U_MICRO_TESLA
30} UbuntuUnit;33} UbuntuUnit;
3134
32typedef UbuntuUnit UUnit;35typedef UbuntuUnit UUnit;
3336
=== modified file 'src/hybris/CMakeLists.txt'
--- src/hybris/CMakeLists.txt 2013-06-20 12:23:48 +0000
+++ src/hybris/CMakeLists.txt 2013-07-05 09:17:25 +0000
@@ -1,14 +1,15 @@
1set(SOURCES 1set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
2 hybris_bridge.cpp2
3add_library(
4 ubuntu_application_api SHARED
5
3 ubuntu_application_api_hybris.cpp6 ubuntu_application_api_hybris.cpp
4 ubuntu_application_sensors_hybris.cpp7 ubuntu_application_sensors_hybris.cpp
5)8)
69
7set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
8
9add_library(10add_library(
10 ubuntu_application_api SHARED11 ubuntu_platform_hardware_api SHARED
11 ${SOURCES}12 ubuntu_platform_hardware_api.cpp
12)13)
1314
14include_directories(15include_directories(
@@ -20,6 +21,11 @@
20 hybris-common21 hybris-common
21)22)
2223
24target_link_libraries(
25 ubuntu_platform_hardware_api
26 hybris-common
27)
28
23set_target_properties(29set_target_properties(
24 ubuntu_application_api30 ubuntu_application_api
25 PROPERTIES31 PROPERTIES
@@ -27,8 +33,21 @@
27 SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}33 SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
28)34)
2935
36set_target_properties(
37 ubuntu_platform_hardware_api
38 PROPERTIES
39 VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
40 SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
41)
42
30install(43install(
31 TARGETS ubuntu_application_api 44 TARGETS ubuntu_application_api
32 ${INSTALL_TARGETS_DEFAULT_ARGS})45 ${INSTALL_TARGETS_DEFAULT_ARGS}
46)
47
48install(
49 TARGETS ubuntu_platform_hardware_api
50 ${INSTALL_TARGETS_DEFAULT_ARGS}
51)
3352
34add_subdirectory(tests/)53add_subdirectory(tests/)
3554
=== added file 'src/hybris/bridge.h'
--- src/hybris/bridge.h 1970-01-01 00:00:00 +0000
+++ src/hybris/bridge.h 2013-07-05 09:17:25 +0000
@@ -0,0 +1,200 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17 * Ricardo Mendoza <ricardo.mendoza@canonical.com>
18 */
19#ifndef BRIDGE_H_
20#define BRIDGE_H_
21
22#include <assert.h>
23#include <dlfcn.h>
24#include <stddef.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30extern void *android_dlopen(const char *filename, int flag);
31extern void *android_dlsym(void *handle, const char *symbol);
32
33#ifdef __cplusplus
34}
35#endif
36
37namespace internal
38{
39
40struct ToApplication
41{
42 static const char* path()
43 {
44 return "/system/lib/libubuntu_application_api.so";
45 }
46};
47
48struct ToHardware
49{
50 static const char* path()
51 {
52 return "/system/lib/libubuntu_platform_hardware_api.so";
53 }
54};
55
56template<typename Scope = ToApplication>
57class Bridge
58{
59 public:
60 static Bridge<Scope>& instance()
61 {
62 static Bridge<Scope> bridge;
63 return bridge;
64 }
65
66 void* resolve_symbol(const char* symbol) const
67 {
68 return android_dlsym(lib_handle, symbol);
69 }
70
71 protected:
72 Bridge() : lib_handle(android_dlopen(Scope::path(), RTLD_LAZY))
73 {
74 assert(lib_handle && "Error loading ubuntu_application_api");
75 }
76
77 ~Bridge()
78 {
79 // TODO android_dlclose(libcamera_handle);
80 }
81
82 void* lib_handle;
83};
84
85}
86
87#ifdef __cplusplus
88extern "C" {
89#endif
90
91/**********************************************************/
92/*********** Implementation starts here *******************/
93/**********************************************************/
94
95#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<>::instance().resolve_symbol(sym); }
96
97#define IMPLEMENT_FUNCTION0(return_type, symbol) \
98 return_type symbol() \
99 { \
100 static return_type (*f)() = NULL; \
101 DLSYM(&f, #symbol); \
102 return f();}
103
104#define IMPLEMENT_VOID_FUNCTION0(symbol) \
105 void symbol() \
106 { \
107 static void (*f)() = NULL; \
108 DLSYM(&f, #symbol); \
109 f();}
110
111#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
112 return_type symbol(arg1 _1) \
113 { \
114 static return_type (*f)(arg1) = NULL; \
115 DLSYM(&f, #symbol); \
116 return f(_1); }
117
118#define IMPLEMENT_SF_FUNCTION1(return_type, symbol, arg1) \
119 return_type symbol(arg1 _1) \
120 { \
121 static return_type (*f)(arg1) __attribute__((pcs("aapcs"))) = NULL; \
122 DLSYM(&f, #symbol); \
123 return f(_1); }
124
125
126#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1) \
127 void symbol(arg1 _1) \
128 { \
129 static void (*f)(arg1) = NULL; \
130 DLSYM(&f, #symbol); \
131 f(_1); }
132
133#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2) \
134 return_type symbol(arg1 _1, arg2 _2) \
135 { \
136 static return_type (*f)(arg1, arg2) = NULL; \
137 DLSYM(&f, #symbol); \
138 return f(_1, _2); }
139
140#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2) \
141 void symbol(arg1 _1, arg2 _2) \
142 { \
143 static void (*f)(arg1, arg2) = NULL; \
144 DLSYM(&f, #symbol); \
145 f(_1, _2); }
146
147#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3) \
148 return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
149 { \
150 static return_type (*f)(arg1, arg2, arg3) = NULL; \
151 DLSYM(&f, #symbol); \
152 return f(_1, _2, _3); }
153
154#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3) \
155 void symbol(arg1 _1, arg2 _2, arg3 _3) \
156 { \
157 static void (*f)(arg1, arg2, arg3) = NULL; \
158 DLSYM(&f, #symbol); \
159 f(_1, _2, _3); }
160
161#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
162 void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
163 { \
164 static void (*f)(arg1, arg2, arg3, arg4) = NULL; \
165 DLSYM(&f, #symbol); \
166 f(_1, _2, _3, _4); }
167
168#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
169 return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
170 { \
171 static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
172 DLSYM(&f, #symbol); \
173 return f(_1, _2, _3, _4); }
174
175#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
176 return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
177 { \
178 static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
179 DLSYM(&f, #symbol); \
180 return f(_1, _2, _3, _4, _5, _6); }
181
182#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
183 void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
184 { \
185 static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
186 DLSYM(&f, #symbol); \
187 f(_1, _2, _3, _4, _5, _6, _7); }
188
189#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
190 void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
191 { \
192 static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
193 DLSYM(&f, #symbol); \
194 f(_1, _2, _3, _4, _5, _6, _7, _8); }
195
196#ifdef __cplusplus
197}
198#endif
199
200#endif // BRIDGE_H_
0201
=== removed file 'src/hybris/hybris_bridge.cpp'
--- src/hybris/hybris_bridge.cpp 2013-06-05 22:34:41 +0000
+++ src/hybris/hybris_bridge.cpp 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17 * Ricardo Mendoza <ricardo.mendoza@canonical.com>
18 */
19
20#include "hybris_bridge.h"
21
22#include <dlfcn.h>
23#include <assert.h>
24
25namespace uh = ubuntu::hybris;
26
27extern "C" {
28
29extern void *android_dlopen(const char *filename, int flag);
30extern void *android_dlsym(void *handle, const char *symbol);
31
32}
33
34const char* uh::Bridge::path_to_library()
35{
36 return "/system/lib/libubuntu_application_api.so";
37}
38
39uh::Bridge& uh::Bridge::instance()
40{
41 static uh::Bridge bridge;
42 return bridge;
43}
44
45uh::Bridge::Bridge()
46 : lib_handle(android_dlopen(path_to_library(), RTLD_LAZY))
47{
48 assert(lib_handle && "Error loading ubuntu_application_api");
49}
50
51uh::Bridge::~Bridge()
52{
53 // TODO android_dlclose(libcamera_handle);
54}
55
56void* uh::Bridge::resolve_symbol(const char* symbol) const
57{
58 return android_dlsym(lib_handle, symbol);
59}
600
=== removed file 'src/hybris/hybris_bridge.h'
--- src/hybris/hybris_bridge.h 2013-06-05 23:44:55 +0000
+++ src/hybris/hybris_bridge.h 1970-01-01 00:00:00 +0000
@@ -1,148 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17 * Ricardo Mendoza <ricardo.mendoza@canonical.com>
18 */
19
20#ifndef UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
21#define UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
22
23#include <stddef.h>
24
25namespace ubuntu
26{
27namespace hybris
28{
29
30struct Bridge
31{
32 Bridge();
33 ~Bridge();
34
35 static const char* path_to_library();
36 static Bridge& instance();
37
38 void* resolve_symbol(const char* symbol) const;
39
40 void* lib_handle;
41};
42
43}
44}
45
46// Sweet and beautiful music.
47#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) ubuntu::hybris::Bridge::instance().resolve_symbol(sym); }
48
49#define IMPLEMENT_FUNCTION0(return_type, symbol) \
50 return_type symbol() \
51 { \
52 static return_type (*f)() = NULL; \
53 DLSYM(&f, #symbol); \
54 return f();}
55
56#define IMPLEMENT_VOID_FUNCTION0(symbol) \
57 void symbol() \
58 { \
59 static void (*f)() = NULL; \
60 DLSYM(&f, #symbol); \
61 f();}
62
63#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
64 return_type symbol(arg1 _1) \
65 { \
66 static return_type (*f)(arg1) = NULL; \
67 DLSYM(&f, #symbol); \
68 return f(_1); }
69
70#define IMPLEMENT_SF_FUNCTION1(return_type, symbol, arg1) \
71 return_type symbol(arg1 _1) \
72 { \
73 static return_type (*f)(arg1) __attribute__((pcs("aapcs"))) = NULL; \
74 DLSYM(&f, #symbol); \
75 return f(_1); }
76
77
78#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1) \
79 void symbol(arg1 _1) \
80 { \
81 static void (*f)(arg1) = NULL; \
82 DLSYM(&f, #symbol); \
83 f(_1); }
84
85#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2) \
86 return_type symbol(arg1 _1, arg2 _2) \
87 { \
88 static return_type (*f)(arg1, arg2) = NULL; \
89 DLSYM(&f, #symbol); \
90 return f(_1, _2); }
91
92#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2) \
93 void symbol(arg1 _1, arg2 _2) \
94 { \
95 static void (*f)(arg1, arg2) = NULL; \
96 DLSYM(&f, #symbol); \
97 f(_1, _2); }
98
99#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3) \
100 return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
101 { \
102 static return_type (*f)(arg1, arg2, arg3) = NULL; \
103 DLSYM(&f, #symbol); \
104 return f(_1, _2, _3); }
105
106#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3) \
107 void symbol(arg1 _1, arg2 _2, arg3 _3) \
108 { \
109 static void (*f)(arg1, arg2, arg3) = NULL; \
110 DLSYM(&f, #symbol); \
111 f(_1, _2, _3); }
112
113#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
114 void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
115 { \
116 static void (*f)(arg1, arg2, arg3, arg4) = NULL; \
117 DLSYM(&f, #symbol); \
118 f(_1, _2, _3, _4); }
119
120#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
121 return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
122 { \
123 static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
124 DLSYM(&f, #symbol); \
125 return f(_1, _2, _3, _4); }
126
127#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
128 return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
129 { \
130 static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
131 DLSYM(&f, #symbol); \
132 return f(_1, _2, _3, _4, _5, _6); }
133
134#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
135 void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
136 { \
137 static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
138 DLSYM(&f, #symbol); \
139 f(_1, _2, _3, _4, _5, _6, _7); }
140
141#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
142 void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
143 { \
144 static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
145 DLSYM(&f, #symbol); \
146 f(_1, _2, _3, _4, _5, _6, _7, _8); }
147
148#endif // UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
1490
=== modified file 'src/hybris/tests/CMakeLists.txt'
--- src/hybris/tests/CMakeLists.txt 2013-06-03 20:54:26 +0000
+++ src/hybris/tests/CMakeLists.txt 2013-07-05 09:17:25 +0000
@@ -4,7 +4,7 @@
4target_link_libraries(test_android_ubuntu_app_api ubuntu_application_api EGL GLESv2)4target_link_libraries(test_android_ubuntu_app_api ubuntu_application_api EGL GLESv2)
55
6add_executable(test_android_gps_api test_gps_api.cpp)6add_executable(test_android_gps_api test_gps_api.cpp)
7target_link_libraries(test_android_gps_api ubuntu_application_api)7target_link_libraries(test_android_gps_api ubuntu_platform_hardware_api)
88
9add_executable(test_android_ubuntu_app_api_multiple_surfaces test_multiple_surfaces_event_delivery.cpp)9add_executable(test_android_ubuntu_app_api_multiple_surfaces test_multiple_surfaces_event_delivery.cpp)
10target_link_libraries(test_android_ubuntu_app_api_multiple_surfaces ubuntu_application_api EGL GLESv2)10target_link_libraries(test_android_ubuntu_app_api_multiple_surfaces ubuntu_application_api EGL GLESv2)
1111
=== modified file 'src/hybris/tests/test_gps_api.cpp'
--- src/hybris/tests/test_gps_api.cpp 2013-02-05 08:01:14 +0000
+++ src/hybris/tests/test_gps_api.cpp 2013-07-05 09:17:25 +0000
@@ -15,7 +15,7 @@
15 *15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 */17 */
18#include <ubuntu/application/ubuntu_application_gps.h>18#include <ubuntu/hardware/gps.h>
1919
20#include <ctime>20#include <ctime>
21#include <signal.h>21#include <signal.h>
@@ -23,6 +23,8 @@
23#include <string.h>23#include <string.h>
24#include <unistd.h>24#include <unistd.h>
2525
26namespace ubuntu
27{
26class GPSTest28class GPSTest
27{29{
28 public:30 public:
@@ -32,10 +34,10 @@
32 bool stop();34 bool stop();
33 void inject_time();35 void inject_time();
3436
35 UbuntuGps ubuntu_gps;37 UHardwareGps u_hardware_gps;
36};38};
3739
38void gps_location_cb(UbuntuGpsLocation* location, void* context)40void gps_location_cb(UHardwareGpsLocation* location, void* context)
39{41{
40 printf("gps_location_cb() called.\n");42 printf("gps_location_cb() called.\n");
41}43}
@@ -44,26 +46,26 @@
44{46{
45 switch(status)47 switch(status)
46 {48 {
47 case UBUNTU_GPS_STATUS_NONE:49 case U_HARDWARE_GPS_STATUS_NONE:
48 printf("status: None\n");50 printf("status: None\n");
49 break;51 break;
50 case UBUNTU_GPS_STATUS_SESSION_BEGIN:52 case U_HARDWARE_GPS_STATUS_SESSION_BEGIN:
51 printf("status: Session Begin\n");53 printf("status: Session Begin\n");
52 break;54 break;
53 case UBUNTU_GPS_STATUS_SESSION_END:55 case U_HARDWARE_GPS_STATUS_SESSION_END:
54 printf("status: Session End\n");56 printf("status: Session End\n");
55 break;57 break;
56 case UBUNTU_GPS_STATUS_ENGINE_ON:58 case U_HARDWARE_GPS_STATUS_ENGINE_ON:
57 printf("status: Engine On\n");59 printf("status: Engine On\n");
58 break;60 break;
59 case UBUNTU_GPS_STATUS_ENGINE_OFF:61 case U_HARDWARE_GPS_STATUS_ENGINE_OFF:
60 printf("status: Engine Off\n");62 printf("status: Engine Off\n");
61 default:63 default:
62 break;64 break;
63 };65 };
64}66}
6567
66void gps_sb_status_cb(UbuntuGpsSvStatus* sv_info, void* context)68void gps_sb_status_cb(UHardwareGpsSvStatus* sv_info, void* context)
67{69{
68 printf("gps_sb_status_cb() called, listing %d space vehicles\n", sv_info->num_svs);70 printf("gps_sb_status_cb() called, listing %d space vehicles\n", sv_info->num_svs);
69}71}
@@ -80,15 +82,15 @@
80{82{
81 printf("gps_set_cabapilities_cb() -");83 printf("gps_set_cabapilities_cb() -");
8284
83 if (capabilities & UBUNTU_GPS_CAPABILITY_SCHEDULING)85 if (capabilities & U_HARDWARE_GPS_CAPABILITY_SCHEDULING)
84 printf(" scheduling");86 printf(" scheduling");
85 if (capabilities & UBUNTU_GPS_CAPABILITY_MSB)87 if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSB)
86 printf(" MSB");88 printf(" MSB");
87 if (capabilities & UBUNTU_GPS_CAPABILITY_MSA)89 if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSA)
88 printf(" MSA");90 printf(" MSA");
89 if (capabilities & UBUNTU_GPS_CAPABILITY_SINGLE_SHOT)91 if (capabilities & U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT)
90 printf(" 'single shot'");92 printf(" 'single shot'");
91 if (capabilities & UBUNTU_GPS_CAPABILITY_ON_DEMAND_TIME)93 if (capabilities & U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME)
92 printf(" 'on demand time'");94 printf(" 'on demand time'");
9395
94 printf("\n");96 printf("\n");
@@ -105,31 +107,31 @@
105 printf("gps_xtra_download_request_cb() called.\n");107 printf("gps_xtra_download_request_cb() called.\n");
106}108}
107109
108void agps_status_cb(UbuntuAgpsStatus* status, void* context)110void agps_status_cb(UHardwareGpsAGpsStatus* status, void* context)
109{111{
110 printf("agps status -");112 printf("agps status -");
111113
112 if (status->type == UBUNTU_AGPS_TYPE_SUPL)114 if (status->type == U_HARDWARE_GPS_AGPS_TYPE_SUPL)
113 printf(" SUPL");115 printf(" SUPL");
114 else116 else
115 printf(" C2K");117 printf(" C2K");
116118
117 switch (status->status)119 switch (status->status)
118 {120 {
119 case UBUNTU_GPS_REQUEST_AGPS_DATA_CONN:121 case U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN:
120 printf(", request AGPS data connection");122 printf(", request AGPS data connection");
121 break;123 break;
122 case UBUNTU_GPS_RELEASE_AGPS_DATA_CONN:124 case U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN:
123 printf(", release AGPS data connection");125 printf(", release AGPS data connection");
124 break;126 break;
125 case UBUNTU_GPS_AGPS_DATA_CONNECTED:127 case U_HARDWARE_GPS_AGPS_DATA_CONNECTED:
126 printf(", request AGPS data connected");128 printf(", request AGPS data connected");
127 break;129 break;
128 case UBUNTU_GPS_AGPS_DATA_CONN_DONE:130 case U_HARDWARE_GPS_AGPS_DATA_CONN_DONE:
129 printf(", AGPS data connection done");131 printf(", AGPS data connection done");
130 break;132 break;
131 default:133 default:
132 case UBUNTU_GPS_AGPS_DATA_CONN_FAILED:134 case U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED:
133 printf(", AGPS data connection failed");135 printf(", AGPS data connection failed");
134 break;136 break;
135 }137 }
@@ -137,7 +139,7 @@
137 printf(" ipaddr=%u\n", status->ipaddr);139 printf(" ipaddr=%u\n", status->ipaddr);
138}140}
139141
140void gps_notify_cb(UbuntuGpsNiNotification *notification, void* context)142void gps_notify_cb(UHardwareGpsNiNotification *notification, void* context)
141{143{
142 printf("gps_notify_cb() called.\n");144 printf("gps_notify_cb() called.\n");
143}145}
@@ -153,14 +155,14 @@
153}155}
154156
155GPSTest::GPSTest()157GPSTest::GPSTest()
156 : ubuntu_gps(NULL)158 : u_hardware_gps(NULL)
157{159{
158}160}
159161
160GPSTest::~GPSTest()162GPSTest::~GPSTest()
161{163{
162 if (ubuntu_gps)164 if (u_hardware_gps)
163 ubuntu_gps_delete(ubuntu_gps);165 u_hardware_gps_delete(u_hardware_gps);
164}166}
165167
166void GPSTest::inject_time()168void GPSTest::inject_time()
@@ -168,7 +170,7 @@
168 // A real implementation would inject time from some NTP server.170 // A real implementation would inject time from some NTP server.
169 time_t t = time(0);171 time_t t = time(0);
170 int64_t time_millis = (int64_t)t * (int64_t)1000;172 int64_t time_millis = (int64_t)t * (int64_t)1000;
171 ubuntu_gps_inject_time(ubuntu_gps,173 u_hardware_gps_inject_time(u_hardware_gps,
172 time_millis /*NTP time would go here*/,174 time_millis /*NTP time would go here*/,
173 time_millis /*internal time when that NTP time was taken*/,175 time_millis /*internal time when that NTP time was taken*/,
174 10 /* possible deviation, in milliseconds*/);176 10 /* possible deviation, in milliseconds*/);
@@ -176,7 +178,7 @@
176178
177bool GPSTest::init_and_start()179bool GPSTest::init_and_start()
178{180{
179 UbuntuGpsParams gps_params;181 UHardwareGpsParams gps_params;
180182
181 gps_params.location_cb = gps_location_cb;183 gps_params.location_cb = gps_location_cb;
182 gps_params.status_cb = gps_status_cb;184 gps_params.status_cb = gps_status_cb;
@@ -191,14 +193,14 @@
191 gps_params.request_refloc_cb = agps_ril_request_refloc_cb;193 gps_params.request_refloc_cb = agps_ril_request_refloc_cb;
192 gps_params.context = this;194 gps_params.context = this;
193195
194 UbuntuGps ubuntu_gps = ubuntu_gps_new(&gps_params);196 UHardwareGps u_hardware_gps = u_hardware_gps_new(&gps_params);
195 if (!ubuntu_gps)197 if (!u_hardware_gps)
196 {198 {
197 printf("GPS creation failed!\n");199 printf("GPS creation failed!\n");
198 return false;200 return false;
199 }201 }
200202
201 bool ok = ubuntu_gps_start(ubuntu_gps);203 bool ok = u_hardware_gps_start(u_hardware_gps);
202 if (!ok)204 if (!ok)
203 {205 {
204 printf("GPS start up failed!\n");206 printf("GPS start up failed!\n");
@@ -210,12 +212,13 @@
210212
211bool GPSTest::stop()213bool GPSTest::stop()
212{214{
213 bool ok = ubuntu_gps_stop(ubuntu_gps);215 bool ok = u_hardware_gps_stop(u_hardware_gps);
214 if (!ok)216 if (!ok)
215 printf("failed when stopping GPS!\n");217 printf("failed when stopping GPS!\n");
216218
217 return ok;219 return ok;
218}220}
221}
219222
220void wait_for_sigint()223void wait_for_sigint()
221{224{
@@ -232,7 +235,7 @@
232int main(int argc, char** argv)235int main(int argc, char** argv)
233{236{
234 int return_value = 0;237 int return_value = 0;
235 GPSTest test;238 ubuntu::GPSTest test;
236239
237 if (!test.init_and_start())240 if (!test.init_and_start())
238 return 1;241 return 1;
239242
=== modified file 'src/hybris/ubuntu_application_api_hybris.cpp'
--- src/hybris/ubuntu_application_api_hybris.cpp 2013-06-18 00:05:11 +0000
+++ src/hybris/ubuntu_application_api_hybris.cpp 2013-07-05 09:17:25 +0000
@@ -19,7 +19,6 @@
1919
20#include <private/application/ui/ubuntu_application_ui.h>20#include <private/application/ui/ubuntu_application_ui.h>
2121
22#include <ubuntu/application/ubuntu_application_gps.h>
23#include <ubuntu/ui/ubuntu_ui_session_service.h>22#include <ubuntu/ui/ubuntu_ui_session_service.h>
2423
25// C APIs24// C APIs
@@ -30,21 +29,12 @@
30#include <ubuntu/application/ui/clipboard.h>29#include <ubuntu/application/ui/clipboard.h>
31#include <ubuntu/application/ui/display.h>30#include <ubuntu/application/ui/display.h>
3231
33#include <assert.h>32#include "bridge.h"
34#include <dlfcn.h>
35#include <stddef.h>
36
37#include "hybris_bridge.h"
3833
39#ifdef __cplusplus34#ifdef __cplusplus
40extern "C" {35extern "C" {
41#endif36#endif
4237
43/**********************************************************/
44/*********** Implementation starts here *******************/
45/**********************************************************/
46
47
48// Session helpers38// Session helpers
49IMPLEMENT_FUNCTION0(UAUiSessionProperties*, ua_ui_session_properties_new);39IMPLEMENT_FUNCTION0(UAUiSessionProperties*, ua_ui_session_properties_new);
50IMPLEMENT_VOID_FUNCTION2(ua_ui_session_properties_set_type, UAUiSessionProperties*, UAUiSessionType);40IMPLEMENT_VOID_FUNCTION2(ua_ui_session_properties_set_type, UAUiSessionProperties*, UAUiSessionType);
@@ -135,18 +125,6 @@
135IMPLEMENT_VOID_FUNCTION0(ubuntu_ui_report_notification_invisible);125IMPLEMENT_VOID_FUNCTION0(ubuntu_ui_report_notification_invisible);
136IMPLEMENT_VOID_FUNCTION1(ubuntu_ui_install_task_controller, ubuntu_ui_task_controller*);126IMPLEMENT_VOID_FUNCTION1(ubuntu_ui_install_task_controller, ubuntu_ui_task_controller*);
137127
138// GPS
139IMPLEMENT_FUNCTION1(UbuntuGps, ubuntu_gps_new, UbuntuGpsParams*);
140IMPLEMENT_VOID_FUNCTION1(ubuntu_gps_delete, UbuntuGps);
141IMPLEMENT_FUNCTION1(bool, ubuntu_gps_start, UbuntuGps);
142IMPLEMENT_FUNCTION1(bool, ubuntu_gps_stop, UbuntuGps);
143IMPLEMENT_VOID_FUNCTION4(ubuntu_gps_inject_time, UbuntuGps, int64_t, int64_t, int);
144IMPLEMENT_VOID_FUNCTION4(ubuntu_gps_inject_location, UbuntuGps, double, double, float);
145IMPLEMENT_VOID_FUNCTION2(ubuntu_gps_delete_aiding_data, UbuntuGps, uint16_t);
146IMPLEMENT_FUNCTION6(bool, ubuntu_gps_set_position_mode, UbuntuGps, uint32_t, uint32_t,
147 uint32_t, uint32_t, uint32_t);
148IMPLEMENT_VOID_FUNCTION3(ubuntu_gps_inject_xtra_data, UbuntuGps, char*, int);
149
150#ifdef __cplusplus128#ifdef __cplusplus
151}129}
152#endif130#endif
153131
=== modified file 'src/hybris/ubuntu_application_sensors_hybris.cpp'
--- src/hybris/ubuntu_application_sensors_hybris.cpp 2013-06-05 22:59:25 +0000
+++ src/hybris/ubuntu_application_sensors_hybris.cpp 2013-07-05 09:17:25 +0000
@@ -21,7 +21,7 @@
21#include <ubuntu/application/sensors/proximity.h>21#include <ubuntu/application/sensors/proximity.h>
22#include <ubuntu/application/sensors/light.h>22#include <ubuntu/application/sensors/light.h>
2323
24#include "hybris_bridge.h"24#include "bridge.h"
2525
26// Ubuntu Application Sensors26// Ubuntu Application Sensors
2727
2828
=== added file 'src/hybris/ubuntu_platform_hardware_api.cpp'
--- src/hybris/ubuntu_platform_hardware_api.cpp 1970-01-01 00:00:00 +0000
+++ src/hybris/ubuntu_platform_hardware_api.cpp 2013-07-05 09:17:25 +0000
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17 * Ricardo Mendoza <ricardo.mendoza@canonical.com>
18 */
19
20// C APIs
21#include <ubuntu/hardware/gps.h>
22
23#include "bridge.h"
24
25// Hardware - GPS
26IMPLEMENT_FUNCTION1(
27UHardwareGps,
28u_hardware_gps_new,
29UHardwareGpsParams*);
30
31IMPLEMENT_VOID_FUNCTION1(
32u_hardware_gps_delete,
33UHardwareGps);
34
35IMPLEMENT_FUNCTION1(
36bool,
37u_hardware_gps_start,
38UHardwareGps);
39
40IMPLEMENT_FUNCTION1(
41bool,
42u_hardware_gps_stop,
43UHardwareGps);
44
45IMPLEMENT_VOID_FUNCTION4(
46u_hardware_gps_inject_time,
47UHardwareGps,
48int64_t,
49int64_t,
50int);
51
52IMPLEMENT_VOID_FUNCTION4(
53u_hardware_gps_inject_location,
54UHardwareGps,
55double,
56double,
57float);
58
59IMPLEMENT_VOID_FUNCTION2(
60u_hardware_gps_delete_aiding_data,
61UHardwareGps,
62uint16_t);
63
64IMPLEMENT_FUNCTION6(
65bool,
66u_hardware_gps_set_position_mode,
67UHardwareGps,
68uint32_t,
69uint32_t,
70uint32_t,
71uint32_t,
72uint32_t);
73
74IMPLEMENT_VOID_FUNCTION3(
75u_hardware_gps_inject_xtra_data,
76UHardwareGps,
77char*,
78int);

Subscribers

People subscribed via source and target branches