Merge lp:~thomas-voss/location-service/update-to-work-against-platform-hardware-api into lp:location-service/trunk

Proposed by Thomas Voß
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 23
Merged at revision: 22
Proposed branch: lp:~thomas-voss/location-service/update-to-work-against-platform-hardware-api
Merge into: lp:location-service/trunk
Diff against target: 195 lines (+32/-32)
4 files modified
CMakeLists.txt (+2/-2)
debian/control (+2/-2)
src/location_service/com/ubuntu/location/providers/gps/CMakeLists.txt (+5/-5)
src/location_service/com/ubuntu/location/providers/gps/provider.cpp (+23/-23)
To merge this branch: bzr merge lp:~thomas-voss/location-service/update-to-work-against-platform-hardware-api
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Didier Roche-Tolomelli Approve
Review via email: mp+179858@code.launchpad.net

Commit message

Adjust build and runtime dependency to use the hardware bits of the platform API.

Description of the change

Adjust build and runtime dependency to use the hardware bits of the platform API.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

sounds legit, I only wonder about:
19 -add_subdirectory(tests)
20 +# add_subdirectory(tests)

Do we have any tests? Are we going to skip them?

review: Needs Information
23. By Thomas Voß

Reenable tests again.

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

looks good to me.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-06-13 13:57:38 +0000
3+++ CMakeLists.txt 2013-08-13 07:20:01 +0000
4@@ -22,8 +22,8 @@
5 find_package(PkgConfig)
6 find_package(Boost 1.49 COMPONENTS system program_options)
7 find_package(GLog)
8-pkg_check_modules(DBUS dbus-1)
9-pkg_check_modules(DBUS_CPP dbus-cpp)
10+pkg_check_modules(DBUS dbus-1 REQUIRED)
11+pkg_check_modules(DBUS_CPP dbus-cpp REQUIRED)
12
13 #####################################################################
14 # Enable code coverage calculation with gcov/gcovr/lcov
15
16=== modified file 'debian/control'
17--- debian/control 2013-07-10 14:42:20 +0000
18+++ debian/control 2013-08-13 07:20:01 +0000
19@@ -17,8 +17,8 @@
20 libgoogle-glog-dev,
21 libgtest-dev,
22 libiw-dev,
23- libplatform-api1-dev,
24- libubuntu-platform-api1-dev,
25+ libplatform-hardware-api-headers,
26+ libplatform-hardware-api1-dev,
27 ruby-ronn,
28 Standards-Version: 3.9.4
29 Homepage: http://launchpad.net/location-service
30
31=== modified file 'src/location_service/com/ubuntu/location/providers/gps/CMakeLists.txt'
32--- src/location_service/com/ubuntu/location/providers/gps/CMakeLists.txt 2013-05-28 14:20:45 +0000
33+++ src/location_service/com/ubuntu/location/providers/gps/CMakeLists.txt 2013-08-13 07:20:01 +0000
34@@ -6,16 +6,16 @@
35
36 if (LOCATION_SERVICE_ENABLE_GPS_PROVIDER)
37 find_file(
38- UBUNTU_APPLICATION_GPS_H ubuntu_application_gps.h
39- NAMES ubuntu/application/ubuntu_application_gps.h
40+ UBUNTU_HARDWARE_GPS_H gps.h
41+ NAMES ubuntu/hardware/gps.h
42 )
43
44- if (UBUNTU_APPLICATION_GPS_H)
45+ if (UBUNTU_HARDWARE_GPS_H)
46 message(STATUS "Enabling GPS location provider")
47
48 add_library(gps provider.cpp)
49
50- target_link_libraries(gps ubuntu_application_api)
51+ target_link_libraries(gps ubuntu_platform_hardware_api.so)
52
53 set(
54 ENABLED_PROVIDER_TARGETS
55@@ -27,5 +27,5 @@
56 -DCOM_UBUNTU_LOCATION_SERVICE_PROVIDERS_GPS ${ENABLED_PROVIDER_TARGETS_DEFINITIONS}
57 PARENT_SCOPE
58 )
59- endif (UBUNTU_APPLICATION_GPS_H)
60+ endif (UBUNTU_HARDWARE_GPS_H)
61 endif (LOCATION_SERVICE_ENABLE_GPS_PROVIDER)
62\ No newline at end of file
63
64=== modified file 'src/location_service/com/ubuntu/location/providers/gps/provider.cpp'
65--- src/location_service/com/ubuntu/location/providers/gps/provider.cpp 2013-05-29 09:21:16 +0000
66+++ src/location_service/com/ubuntu/location/providers/gps/provider.cpp 2013-08-13 07:20:01 +0000
67@@ -19,7 +19,7 @@
68
69 #include "com/ubuntu/location/logging.h"
70
71-#include <ubuntu/application/ubuntu_application_gps.h>
72+#include <ubuntu/hardware/gps.h>
73
74 namespace cul = com::ubuntu::location;
75 namespace culg = com::ubuntu::location::providers::gps;
76@@ -28,45 +28,45 @@
77 {
78 static const std::map<uint16_t, std::string> status_lut =
79 {
80- {UBUNTU_GPS_STATUS_NONE, "UBUNTU_GPS_STATUS_NONE"},
81- {UBUNTU_GPS_STATUS_SESSION_BEGIN, "UBUNTU_GPS_STATUS_SESSION_BEGIN"},
82- {UBUNTU_GPS_STATUS_SESSION_END, "UBUNTU_GPS_STATUS_SESSION_END"},
83- {UBUNTU_GPS_STATUS_ENGINE_ON, "UBUNTU_GPS_STATUS_ENGINE_ON"},
84- {UBUNTU_GPS_STATUS_ENGINE_OFF, "UBUNTU_GPS_STATUS_ENGINE_OFF"}
85+ {U_HARDWARE_GPS_STATUS_NONE, "U_HARDWARE_GPS_STATUS_NONE"},
86+ {U_HARDWARE_GPS_STATUS_SESSION_BEGIN, "U_HARDWARE_GPS_STATUS_SESSION_BEGIN"},
87+ {U_HARDWARE_GPS_STATUS_SESSION_END, "U_HARDWARE_GPS_STATUS_SESSION_END"},
88+ {U_HARDWARE_GPS_STATUS_ENGINE_ON, "U_HARDWARE_GPS_STATUS_ENGINE_ON"},
89+ {U_HARDWARE_GPS_STATUS_ENGINE_OFF, "U_HARDWARE_GPS_STATUS_ENGINE_OFF"}
90 };
91 }
92
93 struct culg::Provider::Private
94 {
95
96-static void on_location_update(UbuntuGpsLocation* location, void* context)
97+static void on_location_update(UHardwareGpsLocation* location, void* context)
98 {
99 auto thiz = static_cast<culg::Provider*>(context);
100
101- if (location->flags & UBUNTU_GPS_LOCATION_HAS_LAT_LONG)
102+ if (location->flags & U_HARDWARE_GPS_LOCATION_HAS_LAT_LONG)
103 {
104- VLOG(1) << "location->flags & UBUNTU_GPS_LOCATION_HAS_LAT_LONG";
105+ VLOG(1) << "location->flags & U_HARDWARE_GPS_LOCATION_HAS_LAT_LONG";
106
107 cul::Position pos;
108 pos.latitude(cul::wgs84::Latitude{location->latitude * cul::units::Degrees});
109 pos.longitude(cul::wgs84::Longitude{location->longitude * cul::units::Degrees});
110- if(location->flags & UBUNTU_GPS_LOCATION_HAS_ALTITUDE)
111+ if(location->flags & U_HARDWARE_GPS_LOCATION_HAS_ALTITUDE)
112 pos.altitude(cul::wgs84::Altitude{location->altitude * cul::units::Meters});
113
114 thiz->deliver_position_updates(cul::Update<cul::Position>{pos, cul::Clock::now()});
115 }
116
117- if (location->flags & UBUNTU_GPS_LOCATION_HAS_SPEED)
118+ if (location->flags & U_HARDWARE_GPS_LOCATION_HAS_SPEED)
119 {
120- VLOG(1) << "location->flags & UBUNTU_GPS_LOCATION_HAS_SPEED";
121+ VLOG(1) << "location->flags & U_HARDWARE_GPS_LOCATION_HAS_SPEED";
122
123 cul::Velocity v{location->speed * cul::units::MetersPerSecond};
124 thiz->deliver_velocity_updates(cul::Update<cul::Velocity>{v, cul::Clock::now()});
125 }
126
127- if (location->flags & UBUNTU_GPS_LOCATION_HAS_BEARING)
128+ if (location->flags & U_HARDWARE_GPS_LOCATION_HAS_BEARING)
129 {
130- VLOG(1) << "location->flags & UBUNTU_GPS_LOCATION_HAS_BEARING";
131+ VLOG(1) << "location->flags & U_HARDWARE_GPS_LOCATION_HAS_BEARING";
132
133 cul::Heading h{location->bearing * cul::units::Degrees};
134 thiz->deliver_heading_updates(cul::Update<cul::Heading>{h, cul::Clock::now()});
135@@ -78,7 +78,7 @@
136 VLOG(1) << "Status = " << status_lut.at(status);
137 }
138
139-static void on_sv_status_update(UbuntuGpsSvStatus* sv_info, void* /*context*/)
140+static void on_sv_status_update(UHardwareGpsSvStatus* sv_info, void* /*context*/)
141 {
142 VLOG(1) << "SV status update: [#svs: " << sv_info->num_svs << "]";
143 }
144@@ -97,12 +97,12 @@
145 VLOG(1) << __PRETTY_FUNCTION__;
146 }
147
148-static void on_agps_status_update(UbuntuAgpsStatus* /*status*/, void* /*context*/)
149+static void on_agps_status_update(UHardwareGpsAGpsStatus* /*status*/, void* /*context*/)
150 {
151 VLOG(1) << __PRETTY_FUNCTION__;
152 }
153
154-static void on_gps_ni_notification(UbuntuGpsNiNotification* /*notification*/, void* /*context*/)
155+static void on_gps_ni_notification(UHardwareGpsNiNotification* /*notification*/, void* /*context*/)
156 {
157 VLOG(1) << __PRETTY_FUNCTION__;
158 }
159@@ -124,16 +124,16 @@
160
161 void start()
162 {
163- ubuntu_gps_start(gps_handle);
164+ u_hardware_gps_start(gps_handle);
165 }
166
167 void stop()
168 {
169- ubuntu_gps_stop(gps_handle);
170+ u_hardware_gps_stop(gps_handle);
171 }
172
173- UbuntuGpsParams gps_params;
174- UbuntuGps gps_handle;
175+ UHardwareGpsParams gps_params;
176+ UHardwareGps gps_handle;
177 };
178
179
180@@ -182,13 +182,13 @@
181 d->gps_params.request_refloc_cb = culg::Provider::Private::on_agps_ril_request_ref_lock;
182 d->gps_params.context = this;
183
184- d->gps_handle = ubuntu_gps_new(std::addressof(d->gps_params));
185+ d->gps_handle = u_hardware_gps_new(std::addressof(d->gps_params));
186 }
187
188 culg::Provider::~Provider() noexcept
189 {
190 d->stop();
191- ubuntu_gps_delete(d->gps_handle);
192+ u_hardware_gps_delete(d->gps_handle);
193 }
194
195 bool culg::Provider::matches_criteria(const cul::Criteria&)

Subscribers

People subscribed via source and target branches