Merge lp:~mandel/location-service/add-auto-formatting into lp:location-service/trunk

Proposed by Manuel de la Peña on 2015-04-23
Status: Approved
Approved by: Thomas Voß on 2015-04-24
Approved revision: 191
Proposed branch: lp:~mandel/location-service/add-auto-formatting
Merge into: lp:location-service/trunk
Diff against target: 30592 lines (+11828/-10771)
162 files modified
CMakeLists.txt (+35/-0)
_clang-format (+48/-0)
astyle-config (+44/-0)
include/location_service/com/ubuntu/location/accuracy.h (+17/-12)
include/location_service/com/ubuntu/location/clock.h (+1/-1)
include/location_service/com/ubuntu/location/codec.h (+54/-44)
include/location_service/com/ubuntu/location/configuration.h (+1/-1)
include/location_service/com/ubuntu/location/connectivity/bounded_integer.h (+15/-15)
include/location_service/com/ubuntu/location/connectivity/manager.h (+2/-4)
include/location_service/com/ubuntu/location/connectivity/radio_cell.h (+54/-117)
include/location_service/com/ubuntu/location/connectivity/wireless_network.h (+9/-15)
include/location_service/com/ubuntu/location/criteria.h (+13/-9)
include/location_service/com/ubuntu/location/default_provider_selection_policy.h (+10/-17)
include/location_service/com/ubuntu/location/heading.h (+1/-1)
include/location_service/com/ubuntu/location/init_and_shutdown.h (+1/-1)
include/location_service/com/ubuntu/location/logging.h (+1/-2)
include/location_service/com/ubuntu/location/optional.h (+2/-2)
include/location_service/com/ubuntu/location/position.h (+10/-3)
include/location_service/com/ubuntu/location/provider.h (+14/-16)
include/location_service/com/ubuntu/location/provider_enumerator.h (+1/-1)
include/location_service/com/ubuntu/location/provider_factory.h (+7/-5)
include/location_service/com/ubuntu/location/provider_selection.h (+10/-4)
include/location_service/com/ubuntu/location/provider_selection_policy.h (+3/-4)
include/location_service/com/ubuntu/location/providers/geoclue/geoclue.h (+55/-23)
include/location_service/com/ubuntu/location/providers/geoclue/provider.h (+11/-5)
include/location_service/com/ubuntu/location/providers/remote/interface.h (+45/-70)
include/location_service/com/ubuntu/location/providers/remote/skeleton.h (+7/-3)
include/location_service/com/ubuntu/location/providers/remote/stub.h (+7/-3)
include/location_service/com/ubuntu/location/providers/skyhook/provider.h (+16/-7)
include/location_service/com/ubuntu/location/proxy_provider.h (+2/-2)
include/location_service/com/ubuntu/location/satellite_based_positioning_state.h (+3/-3)
include/location_service/com/ubuntu/location/service/configuration.h (+4/-5)
include/location_service/com/ubuntu/location/service/default_permission_manager.h (+6/-8)
include/location_service/com/ubuntu/location/service/interface.h (+10/-28)
include/location_service/com/ubuntu/location/service/permission_manager.h (+5/-7)
include/location_service/com/ubuntu/location/service/session/implementation.h (+3/-3)
include/location_service/com/ubuntu/location/service/session/interface.h (+4/-4)
include/location_service/com/ubuntu/location/service/session/skeleton.h (+1/-1)
include/location_service/com/ubuntu/location/service/session/stub.h (+4/-6)
include/location_service/com/ubuntu/location/service/skeleton.h (+15/-17)
include/location_service/com/ubuntu/location/service/stub.h (+4/-4)
include/location_service/com/ubuntu/location/space_vehicle.h (+35/-38)
include/location_service/com/ubuntu/location/units/units.h (+10/-11)
include/location_service/com/ubuntu/location/update.h (+10/-11)
include/location_service/com/ubuntu/location/velocity.h (+1/-1)
include/location_service/com/ubuntu/location/wgs84/altitude.h (+5/-3)
include/location_service/com/ubuntu/location/wgs84/coordinate.h (+11/-11)
include/location_service/com/ubuntu/location/wgs84/latitude.h (+6/-2)
include/location_service/com/ubuntu/location/wgs84/longitude.h (+6/-2)
include/location_service/com/ubuntu/location/wifi_and_cell_reporting_state.h (+3/-3)
src/location_service/com/ubuntu/location/boost_ptree_settings.cpp (+3/-2)
src/location_service/com/ubuntu/location/boost_ptree_settings.h (+1/-1)
src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.cpp (+334/-350)
src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.h (+9/-10)
src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.cpp (+73/-96)
src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.h (+3/-4)
src/location_service/com/ubuntu/location/connectivity/dummy_connectivity_manager.h (+9/-5)
src/location_service/com/ubuntu/location/connectivity/manager.cpp (+58/-19)
src/location_service/com/ubuntu/location/connectivity/nm.h (+66/-68)
src/location_service/com/ubuntu/location/connectivity/ofono.h (+522/-600)
src/location_service/com/ubuntu/location/connectivity/ofono_nm_connectivity_manager.cpp (+390/-348)
src/location_service/com/ubuntu/location/connectivity/ofono_nm_connectivity_manager.h (+54/-39)
src/location_service/com/ubuntu/location/connectivity/radio_cell.cpp (+31/-26)
src/location_service/com/ubuntu/location/connectivity/wireless_network.cpp (+10/-5)
src/location_service/com/ubuntu/location/criteria.cpp (+24/-6)
src/location_service/com/ubuntu/location/default_permission_manager.cpp (+6/-5)
src/location_service/com/ubuntu/location/default_provider_selection_policy.cpp (+56/-72)
src/location_service/com/ubuntu/location/engine.cpp (+156/-145)
src/location_service/com/ubuntu/location/engine.h (+24/-48)
src/location_service/com/ubuntu/location/non_selecting_provider_selection_policy.cpp (+50/-33)
src/location_service/com/ubuntu/location/non_selecting_provider_selection_policy.h (+1/-1)
src/location_service/com/ubuntu/location/position.cpp (+27/-22)
src/location_service/com/ubuntu/location/provider.cpp (+43/-15)
src/location_service/com/ubuntu/location/provider_factory.cpp (+8/-15)
src/location_service/com/ubuntu/location/providers/config.cpp (+14/-29)
src/location_service/com/ubuntu/location/providers/dummy/provider.cpp (+54/-68)
src/location_service/com/ubuntu/location/providers/dummy/provider.h (+16/-58)
src/location_service/com/ubuntu/location/providers/geoclue/provider.cpp (+77/-90)
src/location_service/com/ubuntu/location/providers/gps/android_hardware_abstraction_layer.cpp (+153/-168)
src/location_service/com/ubuntu/location/providers/gps/android_hardware_abstraction_layer.h (+25/-22)
src/location_service/com/ubuntu/location/providers/gps/hardware_abstraction_layer.h (+3/-3)
src/location_service/com/ubuntu/location/providers/gps/net_cpp_gps_xtra_downloader.h (+26/-11)
src/location_service/com/ubuntu/location/providers/gps/null_gps_xtra_downloader.h (+19/-3)
src/location_service/com/ubuntu/location/providers/gps/provider.cpp (+16/-17)
src/location_service/com/ubuntu/location/providers/gps/provider.h (+6/-5)
src/location_service/com/ubuntu/location/providers/remote/provider.cpp (+378/-319)
src/location_service/com/ubuntu/location/providers/remote/provider.h (+1/-1)
src/location_service/com/ubuntu/location/providers/remote/skeleton.cpp (+2/-1)
src/location_service/com/ubuntu/location/providers/skyhook/provider.cpp (+43/-45)
src/location_service/com/ubuntu/location/proxy_provider.cpp (+16/-21)
src/location_service/com/ubuntu/location/satellite_based_positioning_state.cpp (+19/-19)
src/location_service/com/ubuntu/location/service/daemon.cpp (+210/-215)
src/location_service/com/ubuntu/location/service/daemon.h (+9/-21)
src/location_service/com/ubuntu/location/service/daemon_cli_main.cpp (+4/-2)
src/location_service/com/ubuntu/location/service/daemon_main.cpp (+4/-2)
src/location_service/com/ubuntu/location/service/dbus_connection_factory.h (+2/-5)
src/location_service/com/ubuntu/location/service/default_configuration.cpp (+3/-3)
src/location_service/com/ubuntu/location/service/default_configuration.h (+5/-6)
src/location_service/com/ubuntu/location/service/default_permission_manager.cpp (+6/-5)
src/location_service/com/ubuntu/location/service/demultiplexing_reporter.cpp (+12/-8)
src/location_service/com/ubuntu/location/service/demultiplexing_reporter.h (+13/-3)
src/location_service/com/ubuntu/location/service/harvester.cpp (+20/-12)
src/location_service/com/ubuntu/location/service/harvester.h (+1/-2)
src/location_service/com/ubuntu/location/service/ichnaea_reporter.cpp (+149/-118)
src/location_service/com/ubuntu/location/service/ichnaea_reporter.h (+23/-28)
src/location_service/com/ubuntu/location/service/implementation.cpp (+69/-90)
src/location_service/com/ubuntu/location/service/implementation.h (+2/-2)
src/location_service/com/ubuntu/location/service/program_options.h (+51/-50)
src/location_service/com/ubuntu/location/service/provider_daemon.cpp (+49/-60)
src/location_service/com/ubuntu/location/service/provider_daemon.h (+1/-1)
src/location_service/com/ubuntu/location/service/provider_daemon_main.cpp (+2/-4)
src/location_service/com/ubuntu/location/service/runtime_tests.cpp (+43/-36)
src/location_service/com/ubuntu/location/service/runtime_tests.h (+1/-1)
src/location_service/com/ubuntu/location/service/session/implementation.cpp (+50/-55)
src/location_service/com/ubuntu/location/service/session/interface.cpp (+2/-1)
src/location_service/com/ubuntu/location/service/session/interface_p.h (+48/-51)
src/location_service/com/ubuntu/location/service/session/skeleton.cpp (+91/-85)
src/location_service/com/ubuntu/location/service/session/stub.cpp (+96/-85)
src/location_service/com/ubuntu/location/service/skeleton.cpp (+83/-127)
src/location_service/com/ubuntu/location/service/stub.cpp (+19/-17)
src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp (+42/-52)
src/location_service/com/ubuntu/location/service/trust_store_permission_manager.h (+3/-4)
src/location_service/com/ubuntu/location/set_name_for_thread.h (+1/-1)
src/location_service/com/ubuntu/location/settings.cpp (+2/-0)
src/location_service/com/ubuntu/location/settings.h (+24/-13)
src/location_service/com/ubuntu/location/wifi_and_cell_reporting_state.cpp (+19/-19)
tests/acceptance_tests.cpp (+272/-309)
tests/connectivity_manager_test.cpp (+133/-114)
tests/controller_test.cpp (+11/-21)
tests/daemon_and_cli_tests.cpp (+48/-71)
tests/default_permission_manager_test.cpp (+2/-3)
tests/demultiplexing_reporter_test.cpp (+6/-10)
tests/did_finish_successfully.h (+5/-1)
tests/dummy_provider_tests.cpp (+11/-16)
tests/engine_test.cpp (+50/-67)
tests/espoo_provider_test.cpp (+143/-137)
tests/geoclue_provider_test.cpp (+2/-3)
tests/gps_provider_test.cpp (+139/-188)
tests/harvester_test.cpp (+9/-25)
tests/heading_test.cpp (+7/-6)
tests/ichnaea_reporter_test.cpp (+41/-83)
tests/mock_connectivity_manager.h (+15/-16)
tests/mock_event_consumer.h (+17/-17)
tests/mock_network_manager.h (+81/-77)
tests/mock_ofono.h (+82/-51)
tests/mock_provider.h (+11/-6)
tests/mock_reporter.h (+4/-5)
tests/mongoose.c (+5311/-4272)
tests/mongoose.h (+105/-96)
tests/null_provider_selection_policy.h (+6/-11)
tests/position_test.cpp (+11/-19)
tests/provider_factory_test.cpp (+13/-11)
tests/provider_selection_policy_test.cpp (+51/-59)
tests/provider_test.cpp (+66/-45)
tests/remote_provider_test.cpp (+199/-214)
tests/remote_providerd_test.cpp (+120/-116)
tests/session_test.cpp (+37/-25)
tests/trust_store_permission_manager_test.cpp (+47/-53)
tests/web_server.h (+21/-19)
tests/wgs84_test.cpp (+57/-51)
tools/CMakeLists.txt (+1/-0)
tools/formatcode.in (+67/-0)
To merge this branch: bzr merge lp:~mandel/location-service/add-auto-formatting
Reviewer Review Type Date Requested Status
Ricardo Salveti code, wait a bit more to land. Disapprove on 2015-04-27
Thomas Voß (community) 2015-04-23 Approve on 2015-04-24
PS Jenkins bot continuous-integration Approve on 2015-04-23
Review via email: mp+257240@code.launchpad.net

Commit message

Add the autoformatting used in the diff projects from the team.

Description of the change

Add the autoformatting used in the diff projects from the team.

To post a comment you must log in.
185. By Manuel de la Peña on 2015-04-23

Run the autoformatting code.

186. By Manuel de la Peña on 2015-04-23

Reverted the format changes and added the missing _clang_format file.

187. By Manuel de la Peña on 2015-04-23

Add missin astyle file.

188. By Manuel de la Peña on 2015-04-23

Performed style rule.

189. By Manuel de la Peña on 2015-04-23

Revert style changes.

190. By Manuel de la Peña on 2015-04-23

Merged with trunk.

191. By Manuel de la Peña on 2015-04-23

Ran format job.

Thomas Voß (thomas-voss) wrote :

LGTM.

review: Approve
Ricardo Salveti (rsalveti) wrote :

I'd like to put this landing on hold until we sort out the remaining critical issues with location-service (and make it reliable).

Landing a big cosmetic change creates a huge pain later on when tracing back changes and bisecting problems, for really no benefit. While I understand it's good to have a code style pattern, at this point I feel it could end up creating more problems for us.

We can land this once we're more comfortable with the codebase.

review: Disapprove (code, wait a bit more to land.)

Unmerged revisions

191. By Manuel de la Peña on 2015-04-23

Ran format job.

190. By Manuel de la Peña on 2015-04-23

Merged with trunk.

189. By Manuel de la Peña on 2015-04-23

Revert style changes.

188. By Manuel de la Peña on 2015-04-23

Performed style rule.

187. By Manuel de la Peña on 2015-04-23

Add missin astyle file.

186. By Manuel de la Peña on 2015-04-23

Reverted the format changes and added the missing _clang_format file.

185. By Manuel de la Peña on 2015-04-23

Run the autoformatting code.

184. By Manuel de la Peña on 2015-04-23

Add auto-formatting shared between diff projects from the team.

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 2014-09-18 23:06:08 +0000
3+++ CMakeLists.txt 2015-04-23 17:23:49 +0000
4@@ -54,6 +54,41 @@
5 SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-local-typedefs")
6 endif (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS)
7
8+
9+#
10+# Code style fixer. We put the code through astyle first because it makes some fixes that
11+# clang-format won't do (such as "char *p" -> "char* p"). But astyle messes up other things
12+# (particularly lambdas and assembly-style comments), which clang-format does right.
13+# So, we run clang-format after running astyle, which undoes the damage done by astyle
14+# without reverting desirable astyle fixes.
15+#
16+
17+find_program(ASTYLE_COMMAND NAMES astyle)
18+if (NOT ASTYLE_COMMAND)
19+ message(WARNING "Cannot find astyle: formatcode target will not be available")
20+else()
21+ # astyle 2.03 creates DOS line endings, so we need to fix its output
22+ find_program(DOS2UNIX_COMMAND NAMES dos2unix)
23+ if (NOT DOS2UNIX_COMMAND)
24+ message(WARNING "Cannot find dos2unix: formatcode target will not be available")
25+ else()
26+ find_program(CLANG_FORMAT_COMMAND NAMES clang-format-3.6 clang-format-3.5)
27+ if (NOT CLANG_FORMAT_COMMAND)
28+ message(WARNING "Cannot find clang-format >= clang-format-3.5: formatcode target will not be available")
29+ endif()
30+ endif()
31+endif()
32+
33+if (ASTYLE_COMMAND AND DOS2UNIX_COMMAND AND CLANG_FORMAT_COMMAND)
34+ add_subdirectory(tools)
35+ add_custom_target(
36+ format
37+ ${CMAKE_BINARY_DIR}/tools/formatcode ${CMAKE_SOURCE_DIR}/src ${ASTYLE_COMMAND} ${CLANG_FORMAT_COMMAND}
38+ COMMAND ${CMAKE_BINARY_DIR}/tools/formatcode ${CMAKE_SOURCE_DIR}/include ${ASTYLE_COMMAND} ${CLANG_FORMAT_COMMAND}
39+ COMMAND ${CMAKE_BINARY_DIR}/tools/formatcode ${CMAKE_SOURCE_DIR}/tests ${ASTYLE_COMMAND} ${CLANG_FORMAT_COMMAND}
40+ )
41+endif()
42+
43 include_directories(
44 ${Boost_INCLUDE_DIRS}
45 ${DBUS_INCLUDE_DIRS}
46
47=== added file '_clang-format'
48--- _clang-format 1970-01-01 00:00:00 +0000
49+++ _clang-format 2015-04-23 17:23:49 +0000
50@@ -0,0 +1,48 @@
51+---
52+AccessModifierOffset: -4
53+AlignEscapedNewlinesLeft: true
54+AlignTrailingComments: true
55+AllowAllParametersOfDeclarationOnNextLine: true
56+AllowShortFunctionsOnASingleLine: false
57+AllowShortIfStatementsOnASingleLine: false
58+AllowShortLoopsOnASingleLine: false
59+AlwaysBreakBeforeMultilineStrings: true
60+AlwaysBreakTemplateDeclarations: true
61+BinPackParameters: false
62+BreakBeforeBinaryOperators: false
63+BreakBeforeBraces: Allman
64+BreakBeforeTernaryOperators: false
65+BreakConstructorInitializersBeforeComma: true
66+ColumnLimit: 120
67+ConstructorInitializerAllOnOneLineOrOnePerLine: false
68+ConstructorInitializerIndentWidth: 4
69+ContinuationIndentWidth: 4
70+Cpp11BracedListStyle: true
71+DerivePointerBinding: true
72+ExperimentalAutoDetectBinPacking: false
73+IndentCaseLabels: true
74+IndentFunctionDeclarationAfterType: true
75+IndentWidth: 4
76+Language: Cpp
77+MaxEmptyLinesToKeep: 1
78+NamespaceIndentation: None
79+ObjCSpaceBeforeProtocolList: false
80+PenaltyBreakBeforeFirstCallParameter: 1
81+PenaltyBreakComment: 100
82+PenaltyBreakFirstLessLess: 120
83+PenaltyBreakString: 1000
84+PenaltyExcessCharacter: 1000000
85+PenaltyReturnTypeOnItsOwnLine: 200
86+PointerBindsToType: true
87+SpaceBeforeAssignmentOperators: true
88+SpaceBeforeParens: ControlStatements
89+SpaceInEmptyParentheses: false
90+SpacesBeforeTrailingComments: 2
91+SpacesInAngles: false
92+SpacesInCStyleCastParentheses: false
93+SpacesInParentheses: false
94+Standard: Cpp11
95+TabWidth: 8
96+UseTab: Never
97+...
98+
99
100=== added file 'astyle-config'
101--- astyle-config 1970-01-01 00:00:00 +0000
102+++ astyle-config 2015-04-23 17:23:49 +0000
103@@ -0,0 +1,44 @@
104+# Options for formatting code with astyle.
105+#
106+# This helps to make code match the style guide.
107+#
108+# Use like this:
109+#
110+# astyle --options=astyle-config mfile.h myfile.cpp
111+#
112+# Occasionally, astyle does something silly (particularly with lambdas), so it's
113+# still necessary to scan the changes for things that are wrong.
114+# But, for most files, it does a good job.
115+#
116+# Please consider using this before checking code in for review. Code reviews shouldn't
117+# have to deal with layout issues, they are just a distraction. It's better to be able
118+# to focus on semantics in a code review, with style issues out of the way.
119+
120+--formatted
121+--style=allman
122+--min-conditional-indent=2
123+--indent-switches
124+--max-instatement-indent=120
125+--pad-header
126+--align-pointer=type
127+--align-reference=type
128+--add-brackets
129+--convert-tabs
130+--close-templates
131+--max-code-length=120
132+
133+# --pad-oper
134+#
135+# Commented out for now. It changes
136+#
137+# for (int i=0; i<10; ++i)
138+# to
139+# for (int i = 0; i < 10; ++i)
140+#
141+# Unfortunately, it also messes with rvalue references:
142+#
143+# ResourcePtr& operator=(ResourcePtr&& r);
144+#
145+# becomes:
146+#
147+# ResourcePtr& operator=(ResourcePtr && r);
148
149=== modified file 'include/location_service/com/ubuntu/location/accuracy.h'
150--- include/location_service/com/ubuntu/location/accuracy.h 2013-05-28 14:41:06 +0000
151+++ include/location_service/com/ubuntu/location/accuracy.h 2015-04-23 17:23:49 +0000
152@@ -34,12 +34,12 @@
153 postalcode,
154 street,
155 detailed,
156-
157+
158 best = detailed,
159 worst = country
160 };
161
162-template<typename T>
163+template <typename T>
164 struct AccuracyTraits
165 {
166 static AccuracyLevel classify(const T& instance);
167@@ -47,14 +47,20 @@
168 static T worst();
169 };
170
171-template<typename T>
172+template <typename T>
173 struct Accuracy
174 {
175 typedef typename T::Unit Unit;
176 typedef typename T::Quantity Quantity;
177
178- static Accuracy<T> best() { return AccuracyTraits<T>::best(); }
179- static Accuracy<T> worst() { return AccuracyTraits<T>::worst(); }
180+ static Accuracy<T> best()
181+ {
182+ return AccuracyTraits<T>::best();
183+ }
184+ static Accuracy<T> worst()
185+ {
186+ return AccuracyTraits<T>::worst();
187+ }
188
189 AccuracyLevel classify() const
190 {
191@@ -64,15 +70,14 @@
192 T value;
193 };
194
195-template<typename T>
196+template <typename T>
197 inline std::ostream& operator<<(std::ostream& out, const Accuracy<T>& update)
198 {
199 out << "Accuracy(" << update.value << ")";
200 return out;
201 }
202-
203-}
204-}
205-}
206-
207-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_ACCURACY_H_
208+}
209+}
210+}
211+
212+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_ACCURACY_H_
213
214=== modified file 'include/location_service/com/ubuntu/location/clock.h'
215--- include/location_service/com/ubuntu/location/clock.h 2013-12-16 12:37:07 +0000
216+++ include/location_service/com/ubuntu/location/clock.h 2015-04-23 17:23:49 +0000
217@@ -66,4 +66,4 @@
218 }
219 }
220
221-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CLOCK_H_
222+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CLOCK_H_
223
224=== modified file 'include/location_service/com/ubuntu/location/codec.h'
225--- include/location_service/com/ubuntu/location/codec.h 2014-09-12 15:04:21 +0000
226+++ include/location_service/com/ubuntu/location/codec.h 2015-04-23 17:23:49 +0000
227@@ -38,7 +38,7 @@
228 {
229 namespace helper
230 {
231-template<typename T>
232+template <typename T>
233 struct TypeMapper<com::ubuntu::location::units::Quantity<T>>
234 {
235 constexpr static ArgumentType type_value()
236@@ -63,7 +63,7 @@
237 };
238 }
239
240-template<typename T>
241+template <typename T>
242 struct Codec<com::ubuntu::location::Optional<T>>
243 {
244 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::Optional<T>& in)
245@@ -71,7 +71,9 @@
246 bool has_value{in};
247 Codec<bool>::encode_argument(writer, has_value);
248 if (has_value)
249+ {
250 Codec<typename com::ubuntu::location::Optional<T>::value_type>::encode_argument(writer, *in);
251+ }
252 }
253
254 static void decode_argument(Message::Reader& reader, com::ubuntu::location::Optional<T>& in)
255@@ -83,14 +85,15 @@
256 typename com::ubuntu::location::Optional<T>::value_type value;
257 Codec<typename com::ubuntu::location::Optional<T>::value_type>::decode_argument(reader, value);
258 in = value;
259- } else
260+ }
261+ else
262 {
263 in.reset();
264 }
265 }
266 };
267
268-template<typename T>
269+template <typename T>
270 struct Codec<com::ubuntu::location::units::Quantity<T>>
271 {
272 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::units::Quantity<T>& in)
273@@ -106,8 +109,8 @@
274 }
275 };
276
277-template<typename T, typename U>
278-struct Codec<com::ubuntu::location::wgs84::Coordinate<T,U>>
279+template <typename T, typename U>
280+struct Codec<com::ubuntu::location::wgs84::Coordinate<T, U>>
281 {
282 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::wgs84::Coordinate<T, U>& in)
283 {
284@@ -120,7 +123,7 @@
285 }
286 };
287
288-template<>
289+template <>
290 struct Codec<com::ubuntu::location::Position>
291 {
292 typedef com::ubuntu::location::Position::Accuracy::Horizontal HorizontalAccuracy;
293@@ -130,7 +133,8 @@
294 {
295 Codec<com::ubuntu::location::wgs84::Latitude>::encode_argument(writer, in.latitude);
296 Codec<com::ubuntu::location::wgs84::Longitude>::encode_argument(writer, in.longitude);
297- Codec<com::ubuntu::location::Optional<com::ubuntu::location::wgs84::Altitude>>::encode_argument(writer, in.altitude);
298+ Codec<com::ubuntu::location::Optional<com::ubuntu::location::wgs84::Altitude>>::encode_argument(writer,
299+ in.altitude);
300
301 Codec<com::ubuntu::location::Optional<HorizontalAccuracy>>::encode_argument(writer, in.accuracy.horizontal);
302 Codec<com::ubuntu::location::Optional<VerticalAccuracy>>::encode_argument(writer, in.accuracy.vertical);
303@@ -140,17 +144,17 @@
304 {
305 Codec<com::ubuntu::location::wgs84::Latitude>::decode_argument(reader, in.latitude);
306 Codec<com::ubuntu::location::wgs84::Longitude>::decode_argument(reader, in.longitude);
307- Codec<com::ubuntu::location::Optional<com::ubuntu::location::wgs84::Altitude>>::decode_argument(reader, in.altitude);
308+ Codec<com::ubuntu::location::Optional<com::ubuntu::location::wgs84::Altitude>>::decode_argument(reader,
309+ in.altitude);
310
311 Codec<com::ubuntu::location::Optional<HorizontalAccuracy>>::decode_argument(reader, in.accuracy.horizontal);
312 Codec<com::ubuntu::location::Optional<VerticalAccuracy>>::decode_argument(reader, in.accuracy.vertical);
313 }
314 };
315
316-
317 namespace helper
318 {
319-template<>
320+template <>
321 struct TypeMapper<com::ubuntu::location::SpaceVehicle::Key>
322 {
323 constexpr static ArgumentType type_value()
324@@ -169,12 +173,11 @@
325 static std::string signature()
326 {
327 static const std::string s =
328- helper::TypeMapper<std::uint32_t>::signature() +
329- helper::TypeMapper<std::uint32_t>::signature();
330+ helper::TypeMapper<std::uint32_t>::signature() + helper::TypeMapper<std::uint32_t>::signature();
331 return s;
332 }
333 };
334-template<>
335+template <>
336 struct TypeMapper<com::ubuntu::location::SpaceVehicle>
337 {
338 constexpr static ArgumentType type_value()
339@@ -194,20 +197,20 @@
340 {
341 std::string s =
342 DBUS_STRUCT_BEGIN_CHAR_AS_STRING +
343- helper::TypeMapper<com::ubuntu::location::SpaceVehicle::Key>::signature() +
344- helper::TypeMapper<float>::signature() +
345- helper::TypeMapper<bool>::signature() +
346- helper::TypeMapper<bool>::signature() +
347- helper::TypeMapper<bool>::signature() +
348- helper::TypeMapper<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::signature() +
349- helper::TypeMapper<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::signature() +
350+ helper::TypeMapper<com::ubuntu::location::SpaceVehicle::Key>::signature() +
351+ helper::TypeMapper<float>::signature() + helper::TypeMapper<bool>::signature() +
352+ helper::TypeMapper<bool>::signature() + helper::TypeMapper<bool>::signature() +
353+ helper::TypeMapper<
354+ com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::signature() +
355+ helper::TypeMapper<
356+ com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::signature() +
357 DBUS_STRUCT_END_CHAR_AS_STRING;
358 return s;
359 }
360 };
361 }
362
363-template<>
364+template <>
365 struct Codec<com::ubuntu::location::SpaceVehicle::Key>
366 {
367 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::SpaceVehicle::Key& in)
368@@ -223,7 +226,7 @@
369 }
370 };
371
372-template<>
373+template <>
374 struct Codec<com::ubuntu::location::SpaceVehicle>
375 {
376 inline static void encode_argument(Message::Writer& writer, const com::ubuntu::location::SpaceVehicle& in)
377@@ -235,8 +238,10 @@
378 sub.push_boolean(in.has_almanac_data);
379 sub.push_boolean(in.has_ephimeris_data);
380 sub.push_boolean(in.used_in_fix);
381- Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::encode_argument(sub, in.azimuth);
382- Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::encode_argument(sub, in.elevation);
383+ Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::encode_argument(
384+ sub, in.azimuth);
385+ Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::encode_argument(
386+ sub, in.elevation);
387
388 writer.close_structure(std::move(sub));
389 }
390@@ -250,14 +255,16 @@
391 in.has_almanac_data = sub.pop_boolean();
392 in.has_ephimeris_data = sub.pop_boolean();
393 in.used_in_fix = sub.pop_boolean();
394- Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::decode_argument(sub, in.azimuth);
395- Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::decode_argument(sub, in.elevation);
396+ Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::decode_argument(
397+ sub, in.azimuth);
398+ Codec<com::ubuntu::location::units::Quantity<com::ubuntu::location::units::PlaneAngle>>::decode_argument(
399+ sub, in.elevation);
400 }
401 };
402
403 namespace helper
404 {
405-template<>
406+template <>
407 struct TypeMapper<std::map<com::ubuntu::location::SpaceVehicle::Key, com::ubuntu::location::SpaceVehicle>>
408 {
409 constexpr static ArgumentType type_value()
410@@ -275,20 +282,23 @@
411
412 static std::string signature()
413 {
414- static const std::string s = DBUS_TYPE_ARRAY_AS_STRING + TypeMapper<com::ubuntu::location::SpaceVehicle>::signature();
415+ static const std::string s =
416+ DBUS_TYPE_ARRAY_AS_STRING + TypeMapper<com::ubuntu::location::SpaceVehicle>::signature();
417 return s;
418 }
419 };
420 }
421-template<>
422+template <>
423 struct Codec<std::map<com::ubuntu::location::SpaceVehicle::Key, com::ubuntu::location::SpaceVehicle>>
424 {
425- inline static void encode_argument(Message::Writer& writer, const std::map<com::ubuntu::location::SpaceVehicle::Key, com::ubuntu::location::SpaceVehicle>& arg)
426+ inline static void encode_argument(
427+ Message::Writer& writer,
428+ const std::map<com::ubuntu::location::SpaceVehicle::Key, com::ubuntu::location::SpaceVehicle>& arg)
429 {
430 types::Signature signature(helper::TypeMapper<com::ubuntu::location::SpaceVehicle>::signature());
431 auto sub = writer.open_array(signature);
432
433- for(const auto& element : arg)
434+ for (const auto& element : arg)
435 {
436 Codec<com::ubuntu::location::SpaceVehicle>::encode_argument(sub, element.second);
437 }
438@@ -296,7 +306,9 @@
439 writer.close_array(std::move(sub));
440 }
441
442- inline static void decode_argument(Message::Reader& reader, std::map<com::ubuntu::location::SpaceVehicle::Key, com::ubuntu::location::SpaceVehicle>& out)
443+ inline static void decode_argument(
444+ Message::Reader& reader,
445+ std::map<com::ubuntu::location::SpaceVehicle::Key, com::ubuntu::location::SpaceVehicle>& out)
446 {
447 auto sub = reader.pop_array();
448 while (sub.type() != ArgumentType::invalid)
449@@ -308,7 +320,7 @@
450 }
451 };
452
453-template<>
454+template <>
455 struct Codec<com::ubuntu::location::Criteria>
456 {
457 typedef com::ubuntu::location::units::Quantity<com::ubuntu::location::units::Length> HorizontalAccuracy;
458@@ -343,7 +355,7 @@
459 }
460 };
461
462-template<>
463+template <>
464 struct Codec<com::ubuntu::location::Provider::Features>
465 {
466 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::Provider::Features& in)
467@@ -357,7 +369,7 @@
468 }
469 };
470
471-template<>
472+template <>
473 struct Codec<com::ubuntu::location::Provider::Requirements>
474 {
475 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::Provider::Requirements& in)
476@@ -371,7 +383,7 @@
477 }
478 };
479
480-template<>
481+template <>
482 struct Codec<com::ubuntu::location::WifiAndCellIdReportingState>
483 {
484 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::WifiAndCellIdReportingState& in)
485@@ -387,7 +399,7 @@
486
487 namespace helper
488 {
489-template<typename T>
490+template <typename T>
491 struct TypeMapper<com::ubuntu::location::Update<T>>
492 {
493 constexpr static ArgumentType type_value()
494@@ -405,15 +417,13 @@
495
496 static std::string signature()
497 {
498- static const std::string s =
499- helper::TypeMapper<T>::signature() +
500- helper::TypeMapper<uint64_t>::signature();
501+ static const std::string s = helper::TypeMapper<T>::signature() + helper::TypeMapper<uint64_t>::signature();
502 return s;
503 }
504 };
505 }
506
507-template<typename T>
508+template <typename T>
509 struct Codec<com::ubuntu::location::Update<T>>
510 {
511 static void encode_argument(Message::Writer& writer, const com::ubuntu::location::Update<T>& in)
512@@ -426,9 +436,9 @@
513 {
514 Codec<T>::decode_argument(reader, in.value);
515 in.when = com::ubuntu::location::Clock::Timestamp(com::ubuntu::location::Clock::Duration(reader.pop_int64()));
516- }
517+ }
518 };
519 }
520 }
521
522-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CODEC_H_
523+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CODEC_H_
524
525=== modified file 'include/location_service/com/ubuntu/location/configuration.h'
526--- include/location_service/com/ubuntu/location/configuration.h 2013-05-29 06:04:02 +0000
527+++ include/location_service/com/ubuntu/location/configuration.h 2015-04-23 17:23:49 +0000
528@@ -31,4 +31,4 @@
529 }
530 }
531
532-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONFIGURATION_H_
533\ No newline at end of file
534+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONFIGURATION_H_
535\ No newline at end of file
536
537=== modified file 'include/location_service/com/ubuntu/location/connectivity/bounded_integer.h'
538--- include/location_service/com/ubuntu/location/connectivity/bounded_integer.h 2014-06-10 11:53:01 +0000
539+++ include/location_service/com/ubuntu/location/connectivity/bounded_integer.h 2015-04-23 17:23:49 +0000
540@@ -33,7 +33,7 @@
541 * @brief A helper class to handle bounded integer values, with an optional domain
542 * for tagging domain-specific types.
543 */
544-template<typename Tag, int min, int max, int inv = min-1>
545+template <typename Tag, int min, int max, int inv = min - 1>
546 class BoundedInteger
547 {
548 public:
549@@ -79,16 +79,14 @@
550 // Capping to [0,1]
551 percent = std::min<float>(1., std::max<float>(0., percent));
552
553- return BoundedInteger<Tag, min, max, inv>
554- {
555- static_cast<int>(minimum() + percent * range())
556- };
557+ return BoundedInteger<Tag, min, max, inv>{static_cast<int>(minimum() + percent * range())};
558 }
559
560 /**
561 * @brief Constructs an invalid instance.
562 */
563- inline BoundedInteger() : value(min-1)
564+ inline BoundedInteger()
565+ : value(min - 1)
566 {
567 }
568
569@@ -97,19 +95,20 @@
570 * @param value The raw value.
571 * @throw std::runtime_error if value is not in [min, max].
572 */
573- inline explicit BoundedInteger(int value) : value(value)
574+ inline explicit BoundedInteger(int value)
575+ : value(value)
576 {
577 if (value < min || value > max)
578- throw std::runtime_error(
579- std::to_string(value) + " is not in " + "[" +
580- std::to_string(min) + ", " + std::to_string(max) + "]");
581+ throw std::runtime_error(std::to_string(value) + " is not in " + "[" + std::to_string(min) + ", " +
582+ std::to_string(max) + "]");
583 }
584
585 /**
586 * @brief Copy c'tor.
587 * @param rhs The instance to copy from.
588 */
589- inline BoundedInteger(const BoundedInteger<Tag, min, max, inv>& rhs) : value(rhs.value)
590+ inline BoundedInteger(const BoundedInteger<Tag, min, max, inv>& rhs)
591+ : value(rhs.value)
592 {
593 }
594
595@@ -169,9 +168,8 @@
596 inline void set(int new_value)
597 {
598 if (new_value < min || new_value > max)
599- throw std::runtime_error(
600- std::to_string(new_value) + " is not in " + "[" +
601- std::to_string(min) + ", " + std::to_string(max) + "]");
602+ throw std::runtime_error(std::to_string(new_value) + " is not in " + "[" + std::to_string(min) + ", " +
603+ std::to_string(max) + "]");
604
605 value = new_value;
606 }
607@@ -193,7 +191,9 @@
608 out << bi.value;
609
610 if (!bi.is_valid())
611+ {
612 out << " -> invalid";
613+ }
614
615 return out;
616 }
617@@ -206,4 +206,4 @@
618 }
619 }
620
621-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_BOUNDED_INTEGER_H_
622+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_BOUNDED_INTEGER_H_
623
624=== modified file 'include/location_service/com/ubuntu/location/connectivity/manager.h'
625--- include/location_service/com/ubuntu/location/connectivity/manager.h 2014-07-10 16:44:26 +0000
626+++ include/location_service/com/ubuntu/location/connectivity/manager.h 2015-04-23 17:23:49 +0000
627@@ -106,8 +106,7 @@
628 struct ConnectivityManagementNotSupported : public std::runtime_error
629 {
630 ConnectivityManagementNotSupported()
631- : std::runtime_error(
632- "Underlying platform does not provide support for connectivity mgmt.")
633+ : std::runtime_error("Underlying platform does not provide support for connectivity mgmt.")
634 {
635 }
636 };
637@@ -154,7 +153,6 @@
638 */
639 virtual const core::Property<bool>& is_wwan_hardware_enabled() const = 0;
640
641-
642 /**
643 * @brief Returns a getable/observable property that describes the characteristics
644 * of the active network connection.
645@@ -230,4 +228,4 @@
646 }
647 }
648
649-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_MANAGER_H_
650+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_MANAGER_H_
651
652=== modified file 'include/location_service/com/ubuntu/location/connectivity/radio_cell.h'
653--- include/location_service/com/ubuntu/location/connectivity/radio_cell.h 2014-06-10 11:53:01 +0000
654+++ include/location_service/com/ubuntu/location/connectivity/radio_cell.h 2015-04-23 17:23:49 +0000
655@@ -50,35 +50,53 @@
656 };
657
658 /** @cond */
659- struct Mcc {};
660- struct Mnc {};
661- struct Lac {};
662- struct Id {};
663- struct Psc {};
664- struct Pid {};
665- struct Rss {};
666- struct Asu {};
667- struct Ta {};
668+ struct Mcc
669+ {
670+ };
671+ struct Mnc
672+ {
673+ };
674+ struct Lac
675+ {
676+ };
677+ struct Id
678+ {
679+ };
680+ struct Psc
681+ {
682+ };
683+ struct Pid
684+ {
685+ };
686+ struct Rss
687+ {
688+ };
689+ struct Asu
690+ {
691+ };
692+ struct Ta
693+ {
694+ };
695
696- template<int min, int max, int invalid = min-1>
697+ template <int min, int max, int invalid = min - 1>
698 using MobileCountryCode = BoundedInteger<Mcc, min, max, invalid>;
699- template<int min, int max, int invalid = min-1>
700+ template <int min, int max, int invalid = min - 1>
701 using MobileNetworkCode = BoundedInteger<Mnc, min, max, invalid>;
702- template<int min, int max, int invalid = min-1>
703+ template <int min, int max, int invalid = min - 1>
704 using LocationAreaCode = BoundedInteger<Lac, min, max, invalid>;
705- template<int min, int max, int invalid = min-1>
706+ template <int min, int max, int invalid = min - 1>
707 using TrackingAreaCode = BoundedInteger<Lac, min, max, invalid>;
708- template<int min, int max, int invalid = min-1>
709+ template <int min, int max, int invalid = min - 1>
710 using CellId = BoundedInteger<Id, min, max, invalid>;
711- template<int min, int max, int invalid = min-1>
712+ template <int min, int max, int invalid = min - 1>
713 using PrimaryScramblingCode = BoundedInteger<Psc, min, max, invalid>;
714- template<int min, int max, int invalid = min-1>
715+ template <int min, int max, int invalid = min - 1>
716 using PhysicalId = BoundedInteger<Pid, min, max, invalid>;
717- template<int min, int max, int invalid = min-1>
718+ template <int min, int max, int invalid = min - 1>
719 using ReceivedSignalStrength = BoundedInteger<Rss, min, max, invalid>;
720- template<int min, int max, int invalid = min-1>
721+ template <int min, int max, int invalid = min - 1>
722 using ArbitraryStrengthUnit = BoundedInteger<Asu, min, max, invalid>;
723- template<int min, int max, int invalid = min-1>
724+ template <int min, int max, int invalid = min - 1>
725 using TimingAdvance = BoundedInteger<Ta, min, max, invalid>;
726 /** @endcond */
727
728@@ -86,41 +104,16 @@
729 struct Gsm
730 {
731 /** 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
732- typedef MobileCountryCode
733- <
734- 0,
735- 999,
736- std::numeric_limits<int>::max()
737- > MCC;
738+ typedef MobileCountryCode<0, 999, std::numeric_limits<int>::max()> MCC;
739 /** 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
740- typedef MobileNetworkCode
741- <
742- 0,
743- 999,
744- std::numeric_limits<int>::max()
745- > MNC;
746+ typedef MobileNetworkCode<0, 999, std::numeric_limits<int>::max()> MNC;
747 /** 16-bit Location Area Code, 0..65535, INT_MAX if unknown */
748- typedef LocationAreaCode
749- <
750- 0,
751- 65535,
752- std::numeric_limits<int>::max()
753- > LAC;
754+ typedef LocationAreaCode<0, 65535, std::numeric_limits<int>::max()> LAC;
755 /** 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown */
756- typedef CellId
757- <
758- 0,
759- 65535,
760- std::numeric_limits<int>::max()
761- > ID;
762+ typedef CellId<0, 65535, std::numeric_limits<int>::max()> ID;
763
764 /** Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
765- typedef ArbitraryStrengthUnit
766- <
767- 0,
768- 31,
769- 99
770- > SignalStrength;
771+ typedef ArbitraryStrengthUnit<0, 31, 99> SignalStrength;
772
773 MCC mobile_country_code;
774 MNC mobile_network_code;
775@@ -133,40 +126,15 @@
776 struct Umts
777 {
778 /** 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
779- typedef MobileCountryCode
780- <
781- 0,
782- 999,
783- std::numeric_limits<int>::max()
784- > MCC;
785+ typedef MobileCountryCode<0, 999, std::numeric_limits<int>::max()> MCC;
786 /** 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
787- typedef MobileNetworkCode
788- <
789- 0,
790- 999,
791- std::numeric_limits<int>::max()
792- > MNC;
793+ typedef MobileNetworkCode<0, 999, std::numeric_limits<int>::max()> MNC;
794 /** 16-bit Location Area Code, 0..65535, INT_MAX if unknown */
795- typedef LocationAreaCode
796- <
797- 0,
798- 65535,
799- std::numeric_limits<int>::max()
800- > LAC;
801+ typedef LocationAreaCode<0, 65535, std::numeric_limits<int>::max()> LAC;
802 /** 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */
803- typedef CellId
804- <
805- 0,
806- 268435455,
807- std::numeric_limits<int>::max()
808- > ID;
809+ typedef CellId<0, 268435455, std::numeric_limits<int>::max()> ID;
810 /** Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
811- typedef ArbitraryStrengthUnit
812- <
813- 0,
814- 31,
815- 99
816- > SignalStrength;
817+ typedef ArbitraryStrengthUnit<0, 31, 99> SignalStrength;
818
819 MCC mobile_country_code;
820 MNC mobile_network_code;
821@@ -179,47 +147,17 @@
822 struct Lte
823 {
824 /** 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
825- typedef MobileCountryCode
826- <
827- 0,
828- 999,
829- std::numeric_limits<int>::max()
830- > MCC;
831+ typedef MobileCountryCode<0, 999, std::numeric_limits<int>::max()> MCC;
832 /** 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
833- typedef MobileNetworkCode
834- <
835- 0,
836- 999,
837- std::numeric_limits<int>::max()
838- > MNC;
839+ typedef MobileNetworkCode<0, 999, std::numeric_limits<int>::max()> MNC;
840 /** 16-bit Tracking Area Code, 0..65535, INT_MAX if unknown */
841- typedef TrackingAreaCode
842- <
843- 0,
844- 65535,
845- std::numeric_limits<int>::max()
846- > TAC;
847+ typedef TrackingAreaCode<0, 65535, std::numeric_limits<int>::max()> TAC;
848 /** 28-bit Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */
849- typedef CellId
850- <
851- 0,
852- 268435455,
853- std::numeric_limits<int>::max()
854- > ID;
855+ typedef CellId<0, 268435455, std::numeric_limits<int>::max()> ID;
856 /** Physical cell id, 0..503, INT_MAX if unknown */
857- typedef PhysicalId
858- <
859- 0,
860- 503,
861- std::numeric_limits<int>::max()
862- > PID;
863+ typedef PhysicalId<0, 503, std::numeric_limits<int>::max()> PID;
864 /** Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
865- typedef ArbitraryStrengthUnit
866- <
867- 0,
868- 31,
869- 99
870- > SignalStrength;
871+ typedef ArbitraryStrengthUnit<0, 31, 99> SignalStrength;
872
873 MCC mobile_country_code;
874 MNC mobile_network_code;
875@@ -279,5 +217,4 @@
876 }
877 }
878
879-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_RADIO_CELL_H_
880-
881+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_RADIO_CELL_H_
882
883=== modified file 'include/location_service/com/ubuntu/location/connectivity/wireless_network.h'
884--- include/location_service/com/ubuntu/location/connectivity/wireless_network.h 2014-06-10 09:08:10 +0000
885+++ include/location_service/com/ubuntu/location/connectivity/wireless_network.h 2015-04-23 17:23:49 +0000
886@@ -52,27 +52,21 @@
887 struct Tag
888 {
889 /** @brief Tags a frequency measurement for a wireless network. */
890- struct Frequency {};
891+ struct Frequency
892+ {
893+ };
894 /** @brief Tags the signal strength of a wireless network. */
895- struct SignalStrength {};
896+ struct SignalStrength
897+ {
898+ };
899 };
900 /** @endcond */
901
902 /** Frequency that an individual AP operates on. */
903- typedef BoundedInteger
904- <
905- Tag::Frequency,
906- 2412,
907- 5825
908- > Frequency;
909+ typedef BoundedInteger<Tag::Frequency, 2412, 5825> Frequency;
910
911 /** Strength of signal for an individual AP. */
912- typedef BoundedInteger
913- <
914- Tag::SignalStrength,
915- 0,
916- 100
917- > SignalStrength;
918+ typedef BoundedInteger<Tag::SignalStrength, 0, 100> SignalStrength;
919
920 /** @cond */
921 WirelessNetwork() = default;
922@@ -114,4 +108,4 @@
923 }
924 }
925
926-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_WIRELESS_NETWORK_H_
927+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_WIRELESS_NETWORK_H_
928
929=== modified file 'include/location_service/com/ubuntu/location/criteria.h'
930--- include/location_service/com/ubuntu/location/criteria.h 2014-01-12 18:03:12 +0000
931+++ include/location_service/com/ubuntu/location/criteria.h 2015-04-23 17:23:49 +0000
932@@ -42,18 +42,22 @@
933
934 struct Requires
935 {
936- bool position = true; ///< The client needs position measurements.
937- bool altitude = false; ///< The client needs altitude measurements.
938- bool velocity = false; ///< The client needs velocity measurments.
939- bool heading = false; ///< The client needs heading measurements.
940+ bool position = true; ///< The client needs position measurements.
941+ bool altitude = false; ///< The client needs altitude measurements.
942+ bool velocity = false; ///< The client needs velocity measurments.
943+ bool heading = false; ///< The client needs heading measurements.
944 } requires = Requires{};
945
946 struct Accuracy
947 {
948- units::Quantity<units::Length> horizontal = 3000 * units::Meters; ///< The client requires measurements of at least this horizontal accuracy.
949- Optional<units::Quantity<units::Length>> vertical; ///< The client requires measurements of at least this vertical accuracy.
950- Optional<units::Quantity<units::Velocity>> velocity; ///< The client requires measurements of at least this velocity accuracy.
951- Optional<units::Quantity<units::PlaneAngle>> heading; ///< The client requires measurements of at least this heading accuracy.
952+ units::Quantity<units::Length> horizontal =
953+ 3000 * units::Meters; ///< The client requires measurements of at least this horizontal accuracy.
954+ Optional<units::Quantity<units::Length>> vertical; ///< The client requires measurements of at least this
955+ ///vertical accuracy.
956+ Optional<units::Quantity<units::Velocity>> velocity; ///< The client requires measurements of at least this
957+ ///velocity accuracy.
958+ Optional<units::Quantity<units::PlaneAngle>> heading; ///< The client requires measurements of at least this
959+ ///heading accuracy.
960 } accuracy = Accuracy{};
961 };
962
963@@ -65,4 +69,4 @@
964 }
965 }
966
967-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CRITERIA_H_
968+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CRITERIA_H_
969
970=== modified file 'include/location_service/com/ubuntu/location/default_provider_selection_policy.h'
971--- include/location_service/com/ubuntu/location/default_provider_selection_policy.h 2013-12-14 09:10:29 +0000
972+++ include/location_service/com/ubuntu/location/default_provider_selection_policy.h 2015-04-23 17:23:49 +0000
973@@ -31,25 +31,18 @@
974 public:
975 DefaultProviderSelectionPolicy();
976 ~DefaultProviderSelectionPolicy() noexcept;
977-
978- ProviderSelection determine_provider_selection_for_criteria(
979- const Criteria& criteria,
980- const ProviderEnumerator& enumerator);
981-
982- Provider::Ptr determine_position_updates_provider(
983- const Criteria& criteria,
984- const ProviderEnumerator& enumerator);
985-
986- Provider::Ptr determine_heading_updates_provider(
987- const Criteria& criteria,
988- const ProviderEnumerator& enumerator);
989-
990- Provider::Ptr determine_velocity_updates_provider(
991- const Criteria& criteria,
992- const ProviderEnumerator& enumerator);
993+
994+ ProviderSelection determine_provider_selection_for_criteria(const Criteria& criteria,
995+ const ProviderEnumerator& enumerator);
996+
997+ Provider::Ptr determine_position_updates_provider(const Criteria& criteria, const ProviderEnumerator& enumerator);
998+
999+ Provider::Ptr determine_heading_updates_provider(const Criteria& criteria, const ProviderEnumerator& enumerator);
1000+
1001+ Provider::Ptr determine_velocity_updates_provider(const Criteria& criteria, const ProviderEnumerator& enumerator);
1002 };
1003 }
1004 }
1005 }
1006
1007-#endif // LOCATION_SERVICE_COM_UBUNTU_DEFAULT_PROVIDER_SELECTION_POLICY_H_
1008+#endif // LOCATION_SERVICE_COM_UBUNTU_DEFAULT_PROVIDER_SELECTION_POLICY_H_
1009
1010=== modified file 'include/location_service/com/ubuntu/location/heading.h'
1011--- include/location_service/com/ubuntu/location/heading.h 2013-12-12 14:36:32 +0000
1012+++ include/location_service/com/ubuntu/location/heading.h 2015-04-23 17:23:49 +0000
1013@@ -32,4 +32,4 @@
1014 }
1015 }
1016
1017-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_HEADING_H_
1018+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_HEADING_H_
1019
1020=== modified file 'include/location_service/com/ubuntu/location/init_and_shutdown.h'
1021--- include/location_service/com/ubuntu/location/init_and_shutdown.h 2013-05-29 09:21:16 +0000
1022+++ include/location_service/com/ubuntu/location/init_and_shutdown.h 2015-04-23 17:23:49 +0000
1023@@ -33,4 +33,4 @@
1024 }
1025 }
1026
1027-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_INIT_AND_SHUTDOWN_H_
1028\ No newline at end of file
1029+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_INIT_AND_SHUTDOWN_H_
1030\ No newline at end of file
1031
1032=== modified file 'include/location_service/com/ubuntu/location/logging.h'
1033--- include/location_service/com/ubuntu/location/logging.h 2014-06-20 07:40:34 +0000
1034+++ include/location_service/com/ubuntu/location/logging.h 2015-04-23 17:23:49 +0000
1035@@ -21,5 +21,4 @@
1036 #include <glog/logging.h>
1037 #include <glog/vlog_is_on.h>
1038
1039-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_LOGGING_H_
1040-
1041+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_LOGGING_H_
1042
1043=== modified file 'include/location_service/com/ubuntu/location/optional.h'
1044--- include/location_service/com/ubuntu/location/optional.h 2013-12-12 14:36:32 +0000
1045+++ include/location_service/com/ubuntu/location/optional.h 2015-04-23 17:23:49 +0000
1046@@ -26,10 +26,10 @@
1047 {
1048 namespace location
1049 {
1050-template<typename T>
1051+template <typename T>
1052 using Optional = boost::optional<T>;
1053 }
1054 }
1055 }
1056
1057-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_OPTIONAL_H_
1058+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_OPTIONAL_H_
1059
1060=== modified file 'include/location_service/com/ubuntu/location/position.h'
1061--- include/location_service/com/ubuntu/location/position.h 2014-06-17 08:06:08 +0000
1062+++ include/location_service/com/ubuntu/location/position.h 2015-04-23 17:23:49 +0000
1063@@ -50,8 +50,15 @@
1064 Position() = default;
1065 Position(const wgs84::Latitude&, const wgs84::Longitude&);
1066 Position(const wgs84::Latitude&, const wgs84::Longitude&, const wgs84::Altitude&);
1067- Position(const wgs84::Latitude&, const wgs84::Longitude&, const wgs84::Altitude&, const units::Quantity<units::Length>& hor_acc);
1068- Position(const wgs84::Latitude&, const wgs84::Longitude&, const wgs84::Altitude&, const units::Quantity<units::Length>& hor_acc, const units::Quantity<units::Length>& ver_acc);
1069+ Position(const wgs84::Latitude&,
1070+ const wgs84::Longitude&,
1071+ const wgs84::Altitude&,
1072+ const units::Quantity<units::Length>& hor_acc);
1073+ Position(const wgs84::Latitude&,
1074+ const wgs84::Longitude&,
1075+ const wgs84::Altitude&,
1076+ const units::Quantity<units::Length>& hor_acc,
1077+ const units::Quantity<units::Length>& ver_acc);
1078
1079 bool operator==(const Position& rhs) const;
1080 bool operator!=(const Position& rhs) const;
1081@@ -68,4 +75,4 @@
1082 }
1083 }
1084 }
1085-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_POSITION_H_
1086+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_POSITION_H_
1087
1088=== modified file 'include/location_service/com/ubuntu/location/provider.h'
1089--- include/location_service/com/ubuntu/location/provider.h 2015-01-21 20:13:28 +0000
1090+++ include/location_service/com/ubuntu/location/provider.h 2015-04-23 17:23:49 +0000
1091@@ -52,22 +52,22 @@
1092 */
1093 enum class Features : std::size_t
1094 {
1095- none = 0, ///< The provider does not support any feature.
1096- position = 1 << 0, ///< The provider features position updates.
1097- velocity = 1 << 1, ///< The provider features velocity updates.
1098- heading = 1 << 2 ///< The provider features heading updates.
1099- };
1100+ none = 0, ///< The provider does not support any feature.
1101+ position = 1 << 0, ///< The provider features position updates.
1102+ velocity = 1 << 1, ///< The provider features velocity updates.
1103+ heading = 1 << 2 ///< The provider features heading updates.
1104+ };
1105
1106 /**
1107 * @brief Enumerates the requirements of a provider implementation.
1108 */
1109 enum class Requirements : std::size_t
1110 {
1111- none = 0, ///< The provider does not require anything.
1112- satellites = 1 << 0, ///< The provider requires satellites to be visible.
1113- cell_network = 1 << 1, ///< The provider requires a cell-network to work correctly.
1114- data_network = 1 << 2, ///< The provider requires a data-network to work correctly.
1115- monetary_spending = 1 << 3 ///< Using the provider results in monetary cost.
1116+ none = 0, ///< The provider does not require anything.
1117+ satellites = 1 << 0, ///< The provider requires satellites to be visible.
1118+ cell_network = 1 << 1, ///< The provider requires a cell-network to work correctly.
1119+ data_network = 1 << 2, ///< The provider requires a data-network to work correctly.
1120+ monetary_spending = 1 << 3 ///< Using the provider results in monetary cost.
1121 };
1122
1123 /**
1124@@ -80,11 +80,11 @@
1125 class Controller
1126 {
1127 public:
1128- typedef std::shared_ptr<Controller> Ptr;
1129+ typedef std::shared_ptr<Controller> Ptr;
1130
1131 virtual ~Controller() = default;
1132 Controller(const Controller&) = delete;
1133- Controller& operator=(const Controller&) = delete;
1134+ Controller& operator=(const Controller&) = delete;
1135
1136 /**
1137 * @brief disable switches the provider to a disabled state, such that subsequent
1138@@ -234,9 +234,7 @@
1139 virtual void on_reference_heading_updated(const Update<Heading>& heading);
1140
1141 protected:
1142- explicit Provider(
1143- const Features& features = Features::none,
1144- const Requirements& requirements = Requirements::none);
1145+ explicit Provider(const Features& features = Features::none, const Requirements& requirements = Requirements::none);
1146
1147 virtual Updates& mutable_updates();
1148
1149@@ -289,4 +287,4 @@
1150 }
1151 }
1152
1153-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_H_
1154+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_H_
1155
1156=== modified file 'include/location_service/com/ubuntu/location/provider_enumerator.h'
1157--- include/location_service/com/ubuntu/location/provider_enumerator.h 2013-12-14 09:10:29 +0000
1158+++ include/location_service/com/ubuntu/location/provider_enumerator.h 2015-04-23 17:23:49 +0000
1159@@ -46,4 +46,4 @@
1160 }
1161 }
1162
1163-#endif // LOCATION_SERVICE_COM_UBUNTU_PROVIDER_ENUMERATOR_H_
1164+#endif // LOCATION_SERVICE_COM_UBUNTU_PROVIDER_ENUMERATOR_H_
1165
1166=== modified file 'include/location_service/com/ubuntu/location/provider_factory.h'
1167--- include/location_service/com/ubuntu/location/provider_factory.h 2014-10-27 21:58:16 +0000
1168+++ include/location_service/com/ubuntu/location/provider_factory.h 2015-04-23 17:23:49 +0000
1169@@ -37,7 +37,7 @@
1170
1171 class ProviderFactory
1172 {
1173- public:
1174+public:
1175 typedef com::ubuntu::location::Configuration Configuration;
1176 typedef std::function<Provider::Ptr(const Configuration&)> Factory;
1177
1178@@ -50,13 +50,15 @@
1179 // by calling the factory and passing it the given config. Please note that the name
1180 // can be decorated with @ for distinguishing providers of the same type but different configs.
1181 // Eg.:
1182- // --provider=remote::Provider@espoo --remote::Provider@espoo::name="com.ubuntu.espoo.service.Provider" --remote::Provider@espoo::path="/com/ubuntu/espoo/service/Provider"
1183- // --provider=remote::Provider@gps --remote::Provider@gps::name="com.ubuntu.android.gps.Provider" --remote::Provider@gps::path="/com/ubuntu/android/gps/Provider"
1184+ // --provider=remote::Provider@espoo --remote::Provider@espoo::name="com.ubuntu.espoo.service.Provider"
1185+ // --remote::Provider@espoo::path="/com/ubuntu/espoo/service/Provider"
1186+ // --provider=remote::Provider@gps --remote::Provider@gps::name="com.ubuntu.android.gps.Provider"
1187+ // --remote::Provider@gps::path="/com/ubuntu/android/gps/Provider"
1188 Provider::Ptr create_provider_for_name_with_config(const std::string& name, const Configuration& config);
1189
1190 void enumerate(const std::function<void(const std::string&, const Factory&)>& enumerator);
1191
1192- private:
1193+private:
1194 ProviderFactory() = default;
1195 ~ProviderFactory() = default;
1196
1197@@ -70,4 +72,4 @@
1198 }
1199 }
1200
1201-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_FACTORY_H_
1202+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_FACTORY_H_
1203
1204=== modified file 'include/location_service/com/ubuntu/location/provider_selection.h'
1205--- include/location_service/com/ubuntu/location/provider_selection.h 2013-12-14 09:10:29 +0000
1206+++ include/location_service/com/ubuntu/location/provider_selection.h 2015-04-23 17:23:49 +0000
1207@@ -35,11 +35,17 @@
1208 Provider::Features flags = Provider::Features::none;
1209
1210 if (position_updates_provider)
1211+ {
1212 flags = flags | Provider::Features::position;
1213+ }
1214 if (heading_updates_provider)
1215+ {
1216 flags = flags | Provider::Features::heading;
1217- if(velocity_updates_provider)
1218+ }
1219+ if (velocity_updates_provider)
1220+ {
1221 flags = flags | Provider::Features::velocity;
1222+ }
1223
1224 return flags;
1225 }
1226@@ -52,11 +58,11 @@
1227 inline bool operator==(const ProviderSelection& lhs, const ProviderSelection& rhs)
1228 {
1229 return lhs.position_updates_provider == rhs.position_updates_provider &&
1230- lhs.heading_updates_provider == rhs.heading_updates_provider &&
1231- lhs.velocity_updates_provider == rhs.velocity_updates_provider;
1232+ lhs.heading_updates_provider == rhs.heading_updates_provider &&
1233+ lhs.velocity_updates_provider == rhs.velocity_updates_provider;
1234 }
1235 }
1236 }
1237 }
1238
1239-#endif // LOCATION_SERVICE_COM_UBUNTU_PROVIDER_SELECTION_H_
1240+#endif // LOCATION_SERVICE_COM_UBUNTU_PROVIDER_SELECTION_H_
1241
1242=== modified file 'include/location_service/com/ubuntu/location/provider_selection_policy.h'
1243--- include/location_service/com/ubuntu/location/provider_selection_policy.h 2014-06-20 07:40:34 +0000
1244+++ include/location_service/com/ubuntu/location/provider_selection_policy.h 2015-04-23 17:23:49 +0000
1245@@ -43,9 +43,8 @@
1246 ProviderSelectionPolicy& operator=(const ProviderSelectionPolicy&) = delete;
1247 virtual ~ProviderSelectionPolicy() = default;
1248
1249- virtual ProviderSelection determine_provider_selection_for_criteria(
1250- const Criteria& criteria,
1251- const ProviderEnumerator& enumerator) = 0;
1252+ virtual ProviderSelection determine_provider_selection_for_criteria(const Criteria& criteria,
1253+ const ProviderEnumerator& enumerator) = 0;
1254
1255 protected:
1256 ProviderSelectionPolicy() = default;
1257@@ -54,4 +53,4 @@
1258 }
1259 }
1260
1261-#endif // LOCATION_SERVICE_COM_UBUNTU_PROVIDER_SELECTION_POLICY_H_
1262+#endif // LOCATION_SERVICE_COM_UBUNTU_PROVIDER_SELECTION_POLICY_H_
1263
1264=== modified file 'include/location_service/com/ubuntu/location/providers/geoclue/geoclue.h'
1265--- include/location_service/com/ubuntu/location/providers/geoclue/geoclue.h 2014-02-03 13:52:21 +0000
1266+++ include/location_service/com/ubuntu/location/providers/geoclue/geoclue.h 2015-04-23 17:23:49 +0000
1267@@ -43,13 +43,10 @@
1268
1269 friend std::ostream& operator<<(std::ostream& out, const Status& status)
1270 {
1271- static std::map<Status, std::string> lut =
1272- {
1273- {Status::error, "error"},
1274- {Status::unavailable, "unavailable"},
1275- {Status::acquiring, "acquiring"},
1276- {Status::available, "available"}
1277- };
1278+ static std::map<Status, std::string> lut = {{Status::error, "error"},
1279+ {Status::unavailable, "unavailable"},
1280+ {Status::acquiring, "acquiring"},
1281+ {Status::available, "available"}};
1282
1283 return out << lut[status];
1284 }
1285@@ -62,7 +59,10 @@
1286 }
1287 typedef Geoclue Interface;
1288 typedef std::tuple<std::string, std::string> ResultType;
1289- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1290+ inline static const std::chrono::milliseconds default_timeout()
1291+ {
1292+ return std::chrono::seconds{1};
1293+ }
1294 };
1295
1296 struct GetStatus
1297@@ -73,7 +73,10 @@
1298 }
1299 typedef Geoclue Interface;
1300 typedef int32_t ResultType;
1301- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1302+ inline static const std::chrono::milliseconds default_timeout()
1303+ {
1304+ return std::chrono::seconds{1};
1305+ }
1306 };
1307
1308 struct AddReference
1309@@ -84,7 +87,10 @@
1310 }
1311 typedef Geoclue Interface;
1312 typedef void ResultType;
1313- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1314+ inline static const std::chrono::milliseconds default_timeout()
1315+ {
1316+ return std::chrono::seconds{1};
1317+ }
1318 };
1319
1320 struct RemoveReference
1321@@ -95,7 +101,10 @@
1322 }
1323 typedef Geoclue Interface;
1324 typedef void ResultType;
1325- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1326+ inline static const std::chrono::milliseconds default_timeout()
1327+ {
1328+ return std::chrono::seconds{1};
1329+ }
1330 };
1331
1332 struct Address
1333@@ -107,8 +116,13 @@
1334 return "GetAddress";
1335 }
1336 typedef Address Interface;
1337- typedef std::tuple<int32_t, std::map<std::string, std::string>, dbus::types::Struct<std::tuple<int32_t, double, double>>> ResultType;
1338- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1339+ typedef std::tuple<int32_t,
1340+ std::map<std::string, std::string>,
1341+ dbus::types::Struct<std::tuple<int32_t, double, double>>> ResultType;
1342+ inline static const std::chrono::milliseconds default_timeout()
1343+ {
1344+ return std::chrono::seconds{1};
1345+ }
1346 };
1347
1348 struct Signals
1349@@ -120,7 +134,9 @@
1350 return "PositionChanged";
1351 };
1352 typedef Address Interface;
1353- typedef std::tuple<int32_t, std::map<std::string, std::string>, dbus::types::Struct<std::tuple<int32_t, double, double>>> ArgumentType;
1354+ typedef std::tuple<int32_t,
1355+ std::map<std::string, std::string>,
1356+ dbus::types::Struct<std::tuple<int32_t, double, double>>> ArgumentType;
1357 };
1358 };
1359 };
1360@@ -146,8 +162,16 @@
1361 return "GetPosition";
1362 }
1363 typedef Position Interface;
1364- typedef std::tuple<int32_t, int32_t, double, double, double, dbus::types::Struct<std::tuple<int32_t, double, double>>> ResultType;
1365- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1366+ typedef std::tuple<int32_t,
1367+ int32_t,
1368+ double,
1369+ double,
1370+ double,
1371+ dbus::types::Struct<std::tuple<int32_t, double, double>>> ResultType;
1372+ inline static const std::chrono::milliseconds default_timeout()
1373+ {
1374+ return std::chrono::seconds{1};
1375+ }
1376 };
1377
1378 struct Signals
1379@@ -159,7 +183,12 @@
1380 return "PositionChanged";
1381 };
1382 typedef Position Interface;
1383- typedef std::tuple<int32_t, int32_t, double, double, double, dbus::types::Struct<std::tuple<int32_t, double, double>>> ArgumentType;
1384+ typedef std::tuple<int32_t,
1385+ int32_t,
1386+ double,
1387+ double,
1388+ double,
1389+ dbus::types::Struct<std::tuple<int32_t, double, double>>> ArgumentType;
1390 };
1391 };
1392 };
1393@@ -186,7 +215,10 @@
1394 }
1395 typedef Velocity Interface;
1396 typedef std::tuple<int32_t, int32_t, double, double, double> ResultType;
1397- inline static const std::chrono::milliseconds default_timeout() { return std::chrono::seconds{1}; }
1398+ inline static const std::chrono::milliseconds default_timeout()
1399+ {
1400+ return std::chrono::seconds{1};
1401+ }
1402 };
1403 struct Signals
1404 {
1405@@ -211,7 +243,7 @@
1406 {
1407 namespace traits
1408 {
1409-template<>
1410+template <>
1411 struct Service<org::freedesktop::Geoclue>
1412 {
1413 inline static const std::string& interface_name()
1414@@ -221,7 +253,7 @@
1415 }
1416 };
1417
1418-template<>
1419+template <>
1420 struct Service<org::freedesktop::Geoclue::Address>
1421 {
1422 inline static const std::string& interface_name()
1423@@ -231,7 +263,7 @@
1424 }
1425 };
1426
1427-template<>
1428+template <>
1429 struct Service<org::freedesktop::Geoclue::Position>
1430 {
1431 inline static const std::string& interface_name()
1432@@ -241,7 +273,7 @@
1433 }
1434 };
1435
1436-template<>
1437+template <>
1438 struct Service<org::freedesktop::Geoclue::Velocity>
1439 {
1440 inline static const std::string& interface_name()
1441@@ -254,4 +286,4 @@
1442 }
1443 }
1444
1445-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_GEOCLUE_H_
1446+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_GEOCLUE_H_
1447
1448=== modified file 'include/location_service/com/ubuntu/location/providers/geoclue/provider.h'
1449--- include/location_service/com/ubuntu/location/providers/geoclue/provider.h 2013-12-10 09:42:54 +0000
1450+++ include/location_service/com/ubuntu/location/providers/geoclue/provider.h 2015-04-23 17:23:49 +0000
1451@@ -33,13 +33,19 @@
1452 {
1453 class Provider : public com::ubuntu::location::Provider
1454 {
1455- public:
1456+public:
1457 static Provider::Ptr create_instance(const ProviderFactory::Configuration&);
1458
1459 struct Configuration
1460 {
1461- static std::string key_name() { return "name"; }
1462- static std::string key_path() { return "path"; }
1463+ static std::string key_name()
1464+ {
1465+ return "name";
1466+ }
1467+ static std::string key_path()
1468+ {
1469+ return "path";
1470+ }
1471 std::string name;
1472 std::string path;
1473
1474@@ -61,7 +67,7 @@
1475 virtual void start_heading_updates();
1476 virtual void stop_heading_updates();
1477
1478- private:
1479+private:
1480 struct Private;
1481 std::unique_ptr<Private> d;
1482 };
1483@@ -70,4 +76,4 @@
1484 }
1485 }
1486 }
1487-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_PROVIDER_H_
1488+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_PROVIDER_H_
1489
1490=== modified file 'include/location_service/com/ubuntu/location/providers/remote/interface.h'
1491--- include/location_service/com/ubuntu/location/providers/remote/interface.h 2015-01-21 20:04:56 +0000
1492+++ include/location_service/com/ubuntu/location/providers/remote/interface.h 2015-04-23 17:23:49 +0000
1493@@ -99,26 +99,20 @@
1494 // Creates a new skeleton instance and installs the interface
1495 // com::ubuntu::remote::Interface on it.
1496 Skeleton(const core::dbus::Object::Ptr& object)
1497- : object{object},
1498- properties
1499- {
1500- object->get_property<Properties::HasPosition>(),
1501- object->get_property<Properties::HasVelocity>(),
1502- object->get_property<Properties::HasHeading>(),
1503- object->get_property<Properties::RequiresSatellites>(),
1504- object->get_property<Properties::RequiresCellNetwork>(),
1505- object->get_property<Properties::RequiresDataNetwork>(),
1506- object->get_property<Properties::RequiresMonetarySpending>(),
1507- object->get_property<Properties::ArePositionUpdatesRunning>(),
1508- object->get_property<Properties::AreHeadingUpdatesRunning>(),
1509- object->get_property<Properties::AreVelocityUpdatesRunning>()
1510- },
1511- signals
1512- {
1513- object->get_signal<Signals::PositionChanged>(),
1514- object->get_signal<Signals::HeadingChanged>(),
1515- object->get_signal<Signals::VelocityChanged>()
1516- }
1517+ : object{object}
1518+ , properties{object->get_property<Properties::HasPosition>(),
1519+ object->get_property<Properties::HasVelocity>(),
1520+ object->get_property<Properties::HasHeading>(),
1521+ object->get_property<Properties::RequiresSatellites>(),
1522+ object->get_property<Properties::RequiresCellNetwork>(),
1523+ object->get_property<Properties::RequiresDataNetwork>(),
1524+ object->get_property<Properties::RequiresMonetarySpending>(),
1525+ object->get_property<Properties::ArePositionUpdatesRunning>(),
1526+ object->get_property<Properties::AreHeadingUpdatesRunning>(),
1527+ object->get_property<Properties::AreVelocityUpdatesRunning>()}
1528+ , signals{object->get_signal<Signals::PositionChanged>(),
1529+ object->get_signal<Signals::HeadingChanged>(),
1530+ object->get_signal<Signals::VelocityChanged>()}
1531 {
1532 }
1533
1534@@ -141,20 +135,14 @@
1535 // All known signals.
1536 struct
1537 {
1538- std::shared_ptr<core::dbus::Signal<
1539- Signals::PositionChanged,
1540- Signals::PositionChanged::ArgumentType
1541- >> position_changed;
1542-
1543- std::shared_ptr<core::dbus::Signal<
1544- Signals::HeadingChanged,
1545- Signals::HeadingChanged::ArgumentType
1546- >> heading_changed;
1547-
1548- std::shared_ptr<core::dbus::Signal<
1549- Signals::VelocityChanged,
1550- Signals::VelocityChanged::ArgumentType
1551- >> velocity_changed;
1552+ std::shared_ptr<core::dbus::Signal<Signals::PositionChanged, Signals::PositionChanged::ArgumentType>>
1553+ position_changed;
1554+
1555+ std::shared_ptr<core::dbus::Signal<Signals::HeadingChanged, Signals::HeadingChanged::ArgumentType>>
1556+ heading_changed;
1557+
1558+ std::shared_ptr<core::dbus::Signal<Signals::VelocityChanged, Signals::VelocityChanged::ArgumentType>>
1559+ velocity_changed;
1560 } signals;
1561 };
1562
1563@@ -163,26 +151,20 @@
1564 // Creates a new skeleton instance and installs the interface
1565 // com::ubuntu::remote::Interface on it.
1566 Stub(const core::dbus::Object::Ptr& object)
1567- : object{object},
1568- properties
1569- {
1570- object->get_property<Properties::HasPosition>(),
1571- object->get_property<Properties::HasVelocity>(),
1572- object->get_property<Properties::HasHeading>(),
1573- object->get_property<Properties::RequiresSatellites>(),
1574- object->get_property<Properties::RequiresCellNetwork>(),
1575- object->get_property<Properties::RequiresDataNetwork>(),
1576- object->get_property<Properties::RequiresMonetarySpending>(),
1577- object->get_property<Properties::ArePositionUpdatesRunning>(),
1578- object->get_property<Properties::AreHeadingUpdatesRunning>(),
1579- object->get_property<Properties::AreVelocityUpdatesRunning>()
1580- },
1581- signals
1582- {
1583- object->get_signal<Signals::PositionChanged>(),
1584- object->get_signal<Signals::HeadingChanged>(),
1585- object->get_signal<Signals::VelocityChanged>()
1586- }
1587+ : object{object}
1588+ , properties{object->get_property<Properties::HasPosition>(),
1589+ object->get_property<Properties::HasVelocity>(),
1590+ object->get_property<Properties::HasHeading>(),
1591+ object->get_property<Properties::RequiresSatellites>(),
1592+ object->get_property<Properties::RequiresCellNetwork>(),
1593+ object->get_property<Properties::RequiresDataNetwork>(),
1594+ object->get_property<Properties::RequiresMonetarySpending>(),
1595+ object->get_property<Properties::ArePositionUpdatesRunning>(),
1596+ object->get_property<Properties::AreHeadingUpdatesRunning>(),
1597+ object->get_property<Properties::AreVelocityUpdatesRunning>()}
1598+ , signals{object->get_signal<Signals::PositionChanged>(),
1599+ object->get_signal<Signals::HeadingChanged>(),
1600+ object->get_signal<Signals::VelocityChanged>()}
1601 {
1602 }
1603
1604@@ -205,27 +187,20 @@
1605 // All known signals.
1606 struct
1607 {
1608- std::shared_ptr<core::dbus::Signal<
1609- Signals::PositionChanged,
1610- Signals::PositionChanged::ArgumentType
1611- >> position_changed;
1612-
1613- std::shared_ptr<core::dbus::Signal<
1614- Signals::HeadingChanged,
1615- Signals::HeadingChanged::ArgumentType
1616- >> heading_changed;
1617-
1618- std::shared_ptr<core::dbus::Signal<
1619- Signals::VelocityChanged,
1620- Signals::VelocityChanged::ArgumentType
1621- >> velocity_changed;
1622+ std::shared_ptr<core::dbus::Signal<Signals::PositionChanged, Signals::PositionChanged::ArgumentType>>
1623+ position_changed;
1624+
1625+ std::shared_ptr<core::dbus::Signal<Signals::HeadingChanged, Signals::HeadingChanged::ArgumentType>>
1626+ heading_changed;
1627+
1628+ std::shared_ptr<core::dbus::Signal<Signals::VelocityChanged, Signals::VelocityChanged::ArgumentType>>
1629+ velocity_changed;
1630 } signals;
1631 };
1632-
1633 };
1634 }
1635 }
1636 }
1637 }
1638 }
1639-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_REMOTE_INTERFACE_H_
1640+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_REMOTE_INTERFACE_H_
1641
1642=== modified file 'include/location_service/com/ubuntu/location/providers/remote/skeleton.h'
1643--- include/location_service/com/ubuntu/location/providers/remote/skeleton.h 2014-09-12 13:11:42 +0000
1644+++ include/location_service/com/ubuntu/location/providers/remote/skeleton.h 2015-04-23 17:23:49 +0000
1645@@ -20,10 +20,14 @@
1646
1647 #include <com/ubuntu/location/provider.h>
1648
1649-namespace core { namespace dbus {
1650+namespace core
1651+{
1652+namespace dbus
1653+{
1654 class Bus;
1655 class Object;
1656-}}
1657+}
1658+}
1659
1660 namespace com
1661 {
1662@@ -56,4 +60,4 @@
1663 }
1664 }
1665 }
1666-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_REMOTE_SKELETON_H_
1667+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_REMOTE_SKELETON_H_
1668
1669=== modified file 'include/location_service/com/ubuntu/location/providers/remote/stub.h'
1670--- include/location_service/com/ubuntu/location/providers/remote/stub.h 2014-09-12 13:11:42 +0000
1671+++ include/location_service/com/ubuntu/location/providers/remote/stub.h 2015-04-23 17:23:49 +0000
1672@@ -20,10 +20,14 @@
1673
1674 #include <com/ubuntu/location/provider.h>
1675
1676-namespace core { namespace dbus {
1677+namespace core
1678+{
1679+namespace dbus
1680+{
1681 class Bus;
1682 class Object;
1683-}}
1684+}
1685+}
1686
1687 namespace com
1688 {
1689@@ -52,4 +56,4 @@
1690 }
1691 }
1692 }
1693-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_REMOTE_STUB_H_
1694+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_REMOTE_STUB_H_
1695
1696=== modified file 'include/location_service/com/ubuntu/location/providers/skyhook/provider.h'
1697--- include/location_service/com/ubuntu/location/providers/skyhook/provider.h 2013-12-10 09:42:54 +0000
1698+++ include/location_service/com/ubuntu/location/providers/skyhook/provider.h 2015-04-23 17:23:49 +0000
1699@@ -35,17 +35,26 @@
1700 {
1701 class Provider : public com::ubuntu::location::Provider
1702 {
1703- public:
1704+public:
1705 static Provider::Ptr create_instance(const ProviderFactory::Configuration& config);
1706-
1707+
1708 static const Provider::FeatureFlags& default_feature_flags();
1709 static const Provider::RequirementFlags& default_requirement_flags();
1710
1711 struct Configuration
1712 {
1713- static std::string key_username() { return "username"; }
1714- static std::string key_realm() { return "realm"; }
1715- static std::string key_period() { return "period"; }
1716+ static std::string key_username()
1717+ {
1718+ return "username";
1719+ }
1720+ static std::string key_realm()
1721+ {
1722+ return "realm";
1723+ }
1724+ static std::string key_period()
1725+ {
1726+ return "period";
1727+ }
1728
1729 std::string user_name;
1730 std::string realm;
1731@@ -68,7 +77,7 @@
1732 virtual void start_heading_updates();
1733 virtual void stop_heading_updates();
1734
1735- private:
1736+private:
1737 struct Private;
1738 std::unique_ptr<Private> d;
1739 };
1740@@ -77,4 +86,4 @@
1741 }
1742 }
1743 }
1744-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_SKYHOOK_PROVIDER_H_
1745+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_SKYHOOK_PROVIDER_H_
1746
1747=== modified file 'include/location_service/com/ubuntu/location/proxy_provider.h'
1748--- include/location_service/com/ubuntu/location/proxy_provider.h 2014-06-20 07:40:34 +0000
1749+++ include/location_service/com/ubuntu/location/proxy_provider.h 2015-04-23 17:23:49 +0000
1750@@ -46,7 +46,7 @@
1751
1752 virtual void start_heading_updates();
1753 virtual void stop_heading_updates();
1754-
1755+
1756 private:
1757 ProviderSelection providers;
1758
1759@@ -61,4 +61,4 @@
1760 }
1761 }
1762
1763-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROXY_PROVIDER_H_
1764+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROXY_PROVIDER_H_
1765
1766=== modified file 'include/location_service/com/ubuntu/location/satellite_based_positioning_state.h'
1767--- include/location_service/com/ubuntu/location/satellite_based_positioning_state.h 2014-11-14 11:26:45 +0000
1768+++ include/location_service/com/ubuntu/location/satellite_based_positioning_state.h 2015-04-23 17:23:49 +0000
1769@@ -32,8 +32,8 @@
1770 */
1771 enum class SatelliteBasedPositioningState
1772 {
1773- on, ///< Satellite assisted positioning is on.
1774- off ///< Satellite assisted positioning is off.
1775+ on, ///< Satellite assisted positioning is on.
1776+ off ///< Satellite assisted positioning is off.
1777 };
1778
1779 /** @brief Pretty prints the given state to the given stream. */
1780@@ -44,4 +44,4 @@
1781 }
1782 }
1783
1784-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SATELLITE_BASED_POSITIONING_STATE_H_
1785+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SATELLITE_BASED_POSITIONING_STATE_H_
1786
1787=== modified file 'include/location_service/com/ubuntu/location/service/configuration.h'
1788--- include/location_service/com/ubuntu/location/service/configuration.h 2014-11-14 11:33:05 +0000
1789+++ include/location_service/com/ubuntu/location/service/configuration.h 2015-04-23 17:23:49 +0000
1790@@ -41,10 +41,9 @@
1791 Configuration(const Configuration&) = delete;
1792 Configuration& operator=(const Configuration&) = delete;
1793
1794- virtual std::shared_ptr<Engine> the_engine(
1795- const std::set<Provider::Ptr>& provider_set,
1796- const ProviderSelectionPolicy::Ptr& provider_selection_policy) = 0;
1797-
1798+ virtual std::shared_ptr<Engine> the_engine(const std::set<Provider::Ptr>& provider_set,
1799+ const ProviderSelectionPolicy::Ptr& provider_selection_policy) = 0;
1800+
1801 virtual ProviderSelectionPolicy::Ptr the_provider_selection_policy() = 0;
1802 virtual std::set<Provider::Ptr> the_provider_set() = 0;
1803 virtual PermissionManager::Ptr the_permission_manager() = 0;
1804@@ -57,4 +56,4 @@
1805 }
1806 }
1807
1808-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_CONFIGURATION_H_
1809+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_CONFIGURATION_H_
1810
1811=== modified file 'include/location_service/com/ubuntu/location/service/default_permission_manager.h'
1812--- include/location_service/com/ubuntu/location/service/default_permission_manager.h 2013-12-10 09:42:54 +0000
1813+++ include/location_service/com/ubuntu/location/service/default_permission_manager.h 2015-04-23 17:23:49 +0000
1814@@ -33,17 +33,15 @@
1815 {
1816 class DefaultPermissionManager : public PermissionManager
1817 {
1818- public:
1819+public:
1820 typedef std::shared_ptr<DefaultPermissionManager> Ptr;
1821
1822 DefaultPermissionManager();
1823 ~DefaultPermissionManager() noexcept;
1824-
1825- Result check_permission_for_credentials(
1826- const Criteria&,
1827- const Credentials& credentials);
1828-
1829- private:
1830+
1831+ Result check_permission_for_credentials(const Criteria&, const Credentials& credentials);
1832+
1833+private:
1834 pid_t pid;
1835 uid_t uid;
1836 };
1837@@ -51,4 +49,4 @@
1838 }
1839 }
1840 }
1841-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_DEFAULT_PERMISSION_MANAGER_H_
1842+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_DEFAULT_PERMISSION_MANAGER_H_
1843
1844=== modified file 'include/location_service/com/ubuntu/location/service/interface.h'
1845--- include/location_service/com/ubuntu/location/service/interface.h 2014-08-01 15:59:25 +0000
1846+++ include/location_service/com/ubuntu/location/service/interface.h 2015-04-23 17:23:49 +0000
1847@@ -45,7 +45,7 @@
1848 */
1849 class Interface
1850 {
1851- protected:
1852+protected:
1853 struct Errors
1854 {
1855 struct InsufficientPermissions
1856@@ -70,10 +70,7 @@
1857
1858 inline static const std::string& name()
1859 {
1860- static const std::string s
1861- {
1862- "CreateSessionForCriteria"
1863- };
1864+ static const std::string s{"CreateSessionForCriteria"};
1865 return s;
1866 }
1867
1868@@ -91,10 +88,7 @@
1869 {
1870 inline static const std::string& name()
1871 {
1872- static const std::string s
1873- {
1874- "DoesSatelliteBasedPositioning"
1875- };
1876+ static const std::string s{"DoesSatelliteBasedPositioning"};
1877 return s;
1878 }
1879
1880@@ -108,10 +102,7 @@
1881 {
1882 inline static const std::string& name()
1883 {
1884- static const std::string s
1885- {
1886- "DoesReportCellAndWifiIds"
1887- };
1888+ static const std::string s{"DoesReportCellAndWifiIds"};
1889 return s;
1890 }
1891
1892@@ -125,10 +116,7 @@
1893 {
1894 inline static const std::string& name()
1895 {
1896- static const std::string s
1897- {
1898- "IsOnline"
1899- };
1900+ static const std::string s{"IsOnline"};
1901 return s;
1902 }
1903
1904@@ -142,10 +130,7 @@
1905 {
1906 inline static const std::string& name()
1907 {
1908- static const std::string s
1909- {
1910- "VisibleSpaceVehicles"
1911- };
1912+ static const std::string s{"VisibleSpaceVehicles"};
1913 return s;
1914 }
1915
1916@@ -159,7 +144,7 @@
1917
1918 Interface() = default;
1919
1920- public:
1921+public:
1922 typedef std::shared_ptr<Interface> Ptr;
1923
1924 /**
1925@@ -222,15 +207,12 @@
1926 {
1927 namespace traits
1928 {
1929-template<>
1930+template <>
1931 struct Service<com::ubuntu::location::service::Interface>
1932 {
1933 static const std::string& interface_name()
1934 {
1935- static const std::string s
1936- {
1937- "com.ubuntu.location.Service"
1938- };
1939+ static const std::string s{"com.ubuntu.location.Service"};
1940 return s;
1941 }
1942 };
1943@@ -240,4 +222,4 @@
1944
1945 #include <com/ubuntu/location/codec.h>
1946
1947-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_INTERFACE_H_
1948+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_INTERFACE_H_
1949
1950=== modified file 'include/location_service/com/ubuntu/location/service/permission_manager.h'
1951--- include/location_service/com/ubuntu/location/service/permission_manager.h 2014-06-23 04:57:59 +0000
1952+++ include/location_service/com/ubuntu/location/service/permission_manager.h 2015-04-23 17:23:49 +0000
1953@@ -53,8 +53,8 @@
1954 */
1955 enum class Result
1956 {
1957- granted, ///< The app is allowed to access the location service.
1958- rejected ///< The app is not allowed to access the location service.
1959+ granted, ///< The app is allowed to access the location service.
1960+ rejected ///< The app is not allowed to access the location service.
1961 };
1962
1963 virtual ~PermissionManager() = default;
1964@@ -67,10 +67,8 @@
1965 * @param credentials The credentials identifying the remote peer.
1966 * @return Result::granted if the remote peer is allowed to access the location service, Result::rejected otherwise.
1967 */
1968- virtual Result check_permission_for_credentials(
1969- const Criteria& criteria,
1970- const Credentials& credentials) = 0;
1971-
1972+ virtual Result check_permission_for_credentials(const Criteria& criteria, const Credentials& credentials) = 0;
1973+
1974 protected:
1975 PermissionManager() = default;
1976 };
1977@@ -78,4 +76,4 @@
1978 }
1979 }
1980 }
1981-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PERMISSION_MANAGER_H_
1982+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PERMISSION_MANAGER_H_
1983
1984=== modified file 'include/location_service/com/ubuntu/location/service/session/implementation.h'
1985--- include/location_service/com/ubuntu/location/service/session/implementation.h 2014-02-03 13:52:21 +0000
1986+++ include/location_service/com/ubuntu/location/service/session/implementation.h 2015-04-23 17:23:49 +0000
1987@@ -36,7 +36,7 @@
1988 {
1989 class Implementation : public Interface
1990 {
1991- public:
1992+public:
1993 Implementation(const Provider::Ptr& provider);
1994 Implementation(const Implementation&) = delete;
1995 virtual ~Implementation() noexcept;
1996@@ -51,7 +51,7 @@
1997 virtual void start_heading_updates();
1998 virtual void stop_heading_updates() noexcept;
1999
2000- private:
2001+private:
2002 struct Private;
2003 std::unique_ptr<Private> d;
2004 };
2005@@ -61,4 +61,4 @@
2006 }
2007 }
2008
2009-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_IMPLEMENTATION_H_
2010+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_IMPLEMENTATION_H_
2011
2012=== modified file 'include/location_service/com/ubuntu/location/service/session/interface.h'
2013--- include/location_service/com/ubuntu/location/service/session/interface.h 2014-05-19 09:55:25 +0000
2014+++ include/location_service/com/ubuntu/location/service/session/interface.h 2015-04-23 17:23:49 +0000
2015@@ -70,8 +70,8 @@
2016 */
2017 enum class Status
2018 {
2019- enabled, ///< Updates are enabled and delivered to this session.
2020- disabled ///< Updates are disabled and not delivered to this session.
2021+ enabled, ///< Updates are enabled and delivered to this session.
2022+ disabled ///< Updates are disabled and not delivered to this session.
2023 };
2024
2025 /**
2026@@ -114,7 +114,7 @@
2027 */
2028 virtual Updates& updates();
2029
2030-protected:
2031+protected:
2032 Interface();
2033
2034 private:
2035@@ -127,4 +127,4 @@
2036 }
2037 }
2038
2039-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_INTERFACE_H_
2040+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_INTERFACE_H_
2041
2042=== modified file 'include/location_service/com/ubuntu/location/service/session/skeleton.h'
2043--- include/location_service/com/ubuntu/location/service/session/skeleton.h 2014-08-01 12:51:25 +0000
2044+++ include/location_service/com/ubuntu/location/service/session/skeleton.h 2015-04-23 17:23:49 +0000
2045@@ -119,4 +119,4 @@
2046 }
2047 }
2048
2049-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_SKELETON_H_
2050+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_SKELETON_H_
2051
2052=== modified file 'include/location_service/com/ubuntu/location/service/session/stub.h'
2053--- include/location_service/com/ubuntu/location/service/session/stub.h 2014-02-03 13:52:21 +0000
2054+++ include/location_service/com/ubuntu/location/service/session/stub.h 2015-04-23 17:23:49 +0000
2055@@ -42,10 +42,8 @@
2056 {
2057 class Stub : public core::dbus::Stub<Interface>
2058 {
2059- public:
2060- Stub(
2061- const core::dbus::Bus::Ptr& bus,
2062- const core::dbus::types::ObjectPath& session_path);
2063+public:
2064+ Stub(const core::dbus::Bus::Ptr& bus, const core::dbus::types::ObjectPath& session_path);
2065 Stub(const Stub&) = delete;
2066 virtual ~Stub() noexcept;
2067 Stub& operator=(const Stub&) = delete;
2068@@ -61,7 +59,7 @@
2069 virtual void start_heading_updates();
2070 virtual void stop_heading_updates() noexcept;
2071
2072- private:
2073+private:
2074 struct Private;
2075 std::unique_ptr<Private> d;
2076 };
2077@@ -70,4 +68,4 @@
2078 }
2079 }
2080 }
2081-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_STUB_H_
2082+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SESSION_STUB_H_
2083
2084=== modified file 'include/location_service/com/ubuntu/location/service/skeleton.h'
2085--- include/location_service/com/ubuntu/location/service/skeleton.h 2015-02-13 13:19:18 +0000
2086+++ include/location_service/com/ubuntu/location/service/skeleton.h 2015-04-23 17:23:49 +0000
2087@@ -38,9 +38,8 @@
2088 {
2089 namespace service
2090 {
2091-class Skeleton
2092- : public core::dbus::Skeleton<com::ubuntu::location::service::Interface>,
2093- public std::enable_shared_from_this<Skeleton>
2094+class Skeleton : public core::dbus::Skeleton<com::ubuntu::location::service::Interface>,
2095+ public std::enable_shared_from_this<Skeleton>
2096 {
2097 public:
2098 typedef std::shared_ptr<Skeleton> Ptr;
2099@@ -123,10 +122,9 @@
2100
2101 // Tries to register the given session under the given path in the session store.
2102 // Returns true iff the session has been added to the store.
2103- bool add_to_session_store_for_path(
2104- const core::dbus::types::ObjectPath& path,
2105- std::unique_ptr<core::dbus::ServiceWatcher> watcher,
2106- const session::Interface::Ptr& session);
2107+ bool add_to_session_store_for_path(const core::dbus::types::ObjectPath& path,
2108+ std::unique_ptr<core::dbus::ServiceWatcher> watcher,
2109+ const session::Interface::Ptr& session);
2110
2111 // Removes the session with the given path from the session store.
2112 void remove_from_session_store_for_path(const core::dbus::types::ObjectPath& path);
2113@@ -145,19 +143,19 @@
2114 // The skeleton object representing com.ubuntu.location.service.Interface on the bus.
2115 core::dbus::Object::Ptr object;
2116 // We emit property changes manually.
2117- core::dbus::Signal
2118- <
2119- core::dbus::interfaces::Properties::Signals::PropertiesChanged,
2120- core::dbus::interfaces::Properties::Signals::PropertiesChanged::ArgumentType
2121- >::Ptr properties_changed;
2122+ core::dbus::Signal<core::dbus::interfaces::Properties::Signals::PropertiesChanged,
2123+ core::dbus::interfaces::Properties::Signals::PropertiesChanged::ArgumentType>::Ptr
2124+ properties_changed;
2125
2126 // DBus properties as exposed on the bus for com.ubuntu.location.service.Interface
2127 struct
2128 {
2129- std::shared_ptr< core::dbus::Property<Interface::Properties::DoesSatelliteBasedPositioning> > does_satellite_based_positioning;
2130- std::shared_ptr< core::dbus::Property<Interface::Properties::DoesReportCellAndWifiIds> > does_report_cell_and_wifi_ids;
2131- std::shared_ptr< core::dbus::Property<Interface::Properties::IsOnline> > is_online;
2132- std::shared_ptr< core::dbus::Property<Interface::Properties::VisibleSpaceVehicles> > visible_space_vehicles;
2133+ std::shared_ptr<core::dbus::Property<Interface::Properties::DoesSatelliteBasedPositioning>>
2134+ does_satellite_based_positioning;
2135+ std::shared_ptr<core::dbus::Property<Interface::Properties::DoesReportCellAndWifiIds>>
2136+ does_report_cell_and_wifi_ids;
2137+ std::shared_ptr<core::dbus::Property<Interface::Properties::IsOnline>> is_online;
2138+ std::shared_ptr<core::dbus::Property<Interface::Properties::VisibleSpaceVehicles>> visible_space_vehicles;
2139 } properties;
2140 // We sign up to property changes here, to be able to report them to the bus
2141 struct
2142@@ -181,4 +179,4 @@
2143 }
2144 }
2145 }
2146-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SKELETON_H_
2147+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_SKELETON_H_
2148
2149=== modified file 'include/location_service/com/ubuntu/location/service/stub.h'
2150--- include/location_service/com/ubuntu/location/service/stub.h 2014-02-03 13:52:21 +0000
2151+++ include/location_service/com/ubuntu/location/service/stub.h 2015-04-23 17:23:49 +0000
2152@@ -33,7 +33,7 @@
2153 {
2154 class Stub : public core::dbus::Stub<Interface>
2155 {
2156- public:
2157+public:
2158 Stub(const dbus::Bus::Ptr& connection);
2159 Stub(const Stub&) = delete;
2160 Stub& operator=(const Stub&) = delete;
2161@@ -42,10 +42,10 @@
2162 session::Interface::Ptr create_session_for_criteria(const Criteria& criteria);
2163 core::Property<bool>& does_satellite_based_positioning();
2164 core::Property<bool>& does_report_cell_and_wifi_ids();
2165- core::Property<bool>& is_online();
2166+ core::Property<bool>& is_online();
2167 core::Property<std::map<SpaceVehicle::Key, SpaceVehicle>>& visible_space_vehicles();
2168
2169- private:
2170+private:
2171 struct Private;
2172 std::unique_ptr<Private> d;
2173 };
2174@@ -53,4 +53,4 @@
2175 }
2176 }
2177 }
2178-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_STUB_H_
2179+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_STUB_H_
2180
2181=== modified file 'include/location_service/com/ubuntu/location/space_vehicle.h'
2182--- include/location_service/com/ubuntu/location/space_vehicle.h 2014-05-20 07:26:03 +0000
2183+++ include/location_service/com/ubuntu/location/space_vehicle.h 2015-04-23 17:23:49 +0000
2184@@ -38,21 +38,23 @@
2185 /** @brief Enumerates all known space-vehicle types. */
2186 enum class Type
2187 {
2188- unknown, ///< Unknown (and thus invalid) type.
2189- beidou, ///< People's Republic of China's regional system, currently limited to Asia and the West Pacific
2190- galileo, ///< A global system being developed by the European Union and other partner countries, planned to be operational by 2014 (and fully deployed by 2019).
2191- glonass, ///< Russia's global navigation system. Fully operational worldwide.
2192- gps, ///< Fully operational worldwide.
2193- compass, ///< People's Republic of China's global system, planned to be operational by 2020.
2194- irnss, ///< India's regional navigation system, planned to be operational by 2014, covering India and Northern Indian Ocean.
2195- qzss ///< Japanese regional system covering Asia and Oceania.
2196- };
2197+ unknown, ///< Unknown (and thus invalid) type.
2198+ beidou, ///< People's Republic of China's regional system, currently limited to Asia and the West Pacific
2199+ galileo, ///< A global system being developed by the European Union and other partner countries, planned to be
2200+ ///operational by 2014 (and fully deployed by 2019).
2201+ glonass, ///< Russia's global navigation system. Fully operational worldwide.
2202+ gps, ///< Fully operational worldwide.
2203+ compass, ///< People's Republic of China's global system, planned to be operational by 2020.
2204+ irnss, ///< India's regional navigation system, planned to be operational by 2014, covering India and Northern
2205+ ///Indian Ocean.
2206+ qzss ///< Japanese regional system covering Asia and Oceania.
2207+ };
2208
2209 /** @brief Uniquely identifies a space vehicle, given its type and its id. */
2210 struct Key
2211 {
2212- Type type = Type::unknown; ///< The positioning system this vehicle belongs to.
2213- Id id = 0; ///< Unique id of the space vehicle.
2214+ Type type = Type::unknown; ///< The positioning system this vehicle belongs to.
2215+ Id id = 0; ///< Unique id of the space vehicle.
2216
2217 inline bool operator==(const SpaceVehicle::Key& rhs) const
2218 {
2219@@ -62,7 +64,9 @@
2220 inline bool operator<(const SpaceVehicle::Key& rhs) const
2221 {
2222 if (type != rhs.type)
2223+ {
2224 return type < rhs.type;
2225+ }
2226
2227 return id < rhs.id;
2228 }
2229@@ -70,12 +74,9 @@
2230
2231 inline bool operator==(const SpaceVehicle& rhs) const
2232 {
2233- return key == rhs.key &&
2234- has_almanac_data == rhs.has_almanac_data &&
2235- has_ephimeris_data == rhs.has_ephimeris_data &&
2236- used_in_fix == rhs.used_in_fix &&
2237- units::roughly_equals(azimuth, rhs.azimuth) &&
2238- units::roughly_equals(elevation, rhs.elevation);
2239+ return key == rhs.key && has_almanac_data == rhs.has_almanac_data &&
2240+ has_ephimeris_data == rhs.has_ephimeris_data && used_in_fix == rhs.used_in_fix &&
2241+ units::roughly_equals(azimuth, rhs.azimuth) && units::roughly_equals(elevation, rhs.elevation);
2242 }
2243
2244 inline bool operator<(const SpaceVehicle& rhs) const
2245@@ -83,28 +84,25 @@
2246 return key < rhs.key;
2247 }
2248
2249- Key key; ///< Unique key identifying an instance.
2250- float snr = -std::numeric_limits<float>::max(); ///< Signal to noise ratio;
2251- bool has_almanac_data = false; ///< Almanac data available for this vehicle.
2252- bool has_ephimeris_data = false; ///< Ephimeris data is available for this vehicle.
2253- bool used_in_fix = false; ///< This vehicle has been used to obtain a fix.
2254- units::Quantity<units::PlaneAngle> azimuth; ///< Azimuth of SV.
2255- units::Quantity<units::PlaneAngle> elevation; ///< Elevation of SV.
2256+ Key key; ///< Unique key identifying an instance.
2257+ float snr = -std::numeric_limits<float>::max(); ///< Signal to noise ratio;
2258+ bool has_almanac_data = false; ///< Almanac data available for this vehicle.
2259+ bool has_ephimeris_data = false; ///< Ephimeris data is available for this vehicle.
2260+ bool used_in_fix = false; ///< This vehicle has been used to obtain a fix.
2261+ units::Quantity<units::PlaneAngle> azimuth; ///< Azimuth of SV.
2262+ units::Quantity<units::PlaneAngle> elevation; ///< Elevation of SV.
2263 };
2264
2265 inline std::ostream& operator<<(std::ostream& out, const SpaceVehicle& sv)
2266 {
2267- static const std::map<SpaceVehicle::Type, std::string> lut =
2268- {
2269- {SpaceVehicle::Type::unknown, "unknown"},
2270- {SpaceVehicle::Type::beidou, "beidou"},
2271- {SpaceVehicle::Type::galileo, "galileo"},
2272- {SpaceVehicle::Type::glonass, "glonass"},
2273- {SpaceVehicle::Type::gps, "gps"},
2274- {SpaceVehicle::Type::compass, "compass"},
2275- {SpaceVehicle::Type::irnss, "irnss"},
2276- {SpaceVehicle::Type::qzss, "qzss" }
2277- };
2278+ static const std::map<SpaceVehicle::Type, std::string> lut = {{SpaceVehicle::Type::unknown, "unknown"},
2279+ {SpaceVehicle::Type::beidou, "beidou"},
2280+ {SpaceVehicle::Type::galileo, "galileo"},
2281+ {SpaceVehicle::Type::glonass, "glonass"},
2282+ {SpaceVehicle::Type::gps, "gps"},
2283+ {SpaceVehicle::Type::compass, "compass"},
2284+ {SpaceVehicle::Type::irnss, "irnss"},
2285+ {SpaceVehicle::Type::qzss, "qzss"}};
2286 return out << "("
2287 << "type: " << lut.at(sv.key.type) << ", "
2288 << "prn: " << sv.key.id << ", "
2289@@ -113,11 +111,10 @@
2290 << "has_ephimeris_data: " << sv.has_ephimeris_data << ", "
2291 << "used_in_fix: " << sv.used_in_fix << ", "
2292 << "azimuth: " << sv.azimuth << ", "
2293- << "elevation: " << sv.elevation
2294- << ")";
2295+ << "elevation: " << sv.elevation << ")";
2296 }
2297 }
2298 }
2299 }
2300
2301-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SPACE_VEHICLE_H_
2302+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_SPACE_VEHICLE_H_
2303
2304=== modified file 'include/location_service/com/ubuntu/location/units/units.h'
2305--- include/location_service/com/ubuntu/location/units/units.h 2013-12-10 09:42:54 +0000
2306+++ include/location_service/com/ubuntu/location/units/units.h 2015-04-23 17:23:49 +0000
2307@@ -49,7 +49,7 @@
2308 static const Velocity MeterPerSecond;
2309 static const Velocity MetersPerSecond;
2310
2311-template<typename Unit>
2312+template <typename Unit>
2313 using Quantity = boost::units::quantity<Unit, double>;
2314
2315 typedef boost::units::si::dimensionless Dimensionless;
2316@@ -58,15 +58,14 @@
2317 using boost::units::cos;
2318 using boost::units::atan2;
2319
2320-template<typename Unit>
2321+template <typename Unit>
2322 inline bool roughly_equals(const Quantity<Unit>& lhs, const Quantity<Unit>& rhs)
2323 {
2324- return std::fabs(lhs.value()-rhs.value()) <= std::numeric_limits<double>::epsilon();
2325-}
2326-}
2327-}
2328-}
2329-}
2330-
2331-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_UNITS_UNITS_H_
2332-
2333+ return std::fabs(lhs.value() - rhs.value()) <= std::numeric_limits<double>::epsilon();
2334+}
2335+}
2336+}
2337+}
2338+}
2339+
2340+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_UNITS_UNITS_H_
2341
2342=== modified file 'include/location_service/com/ubuntu/location/update.h'
2343--- include/location_service/com/ubuntu/location/update.h 2013-12-10 09:42:54 +0000
2344+++ include/location_service/com/ubuntu/location/update.h 2015-04-23 17:23:49 +0000
2345@@ -32,7 +32,7 @@
2346 * @brief Templated class that wraps a value and timestamp.
2347 * @tparam T The contained value.
2348 */
2349-template<typename T>
2350+template <typename T>
2351 struct Update
2352 {
2353 /**
2354@@ -40,9 +40,9 @@
2355 * @param [in] value The value delivered with this update.
2356 * @param [in] when The timestamp when the value was measured.
2357 */
2358- inline Update(const T& value = T{},
2359- const Clock::Timestamp& when = Clock::now())
2360- : value{value}, when{when}
2361+ inline Update(const T& value = T{}, const Clock::Timestamp& when = Clock::now())
2362+ : value{value}
2363+ , when{when}
2364 {
2365 }
2366
2367@@ -78,15 +78,14 @@
2368 * @param out The stream to write to.
2369 * @param update The value to be printed.
2370 */
2371-template<typename T>
2372+template <typename T>
2373 inline std::ostream& operator<<(std::ostream& out, const Update<T>& update)
2374 {
2375 out << "Update(" << update.value << ", " << update.when.time_since_epoch().count() << ")";
2376 return out;
2377 }
2378-
2379-}
2380-}
2381-}
2382-
2383-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_UPDATE_H_
2384+}
2385+}
2386+}
2387+
2388+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_UPDATE_H_
2389
2390=== modified file 'include/location_service/com/ubuntu/location/velocity.h'
2391--- include/location_service/com/ubuntu/location/velocity.h 2014-06-20 07:40:34 +0000
2392+++ include/location_service/com/ubuntu/location/velocity.h 2015-04-23 17:23:49 +0000
2393@@ -32,4 +32,4 @@
2394 }
2395 }
2396
2397-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_VELOCITY_H_
2398+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_VELOCITY_H_
2399
2400=== modified file 'include/location_service/com/ubuntu/location/wgs84/altitude.h'
2401--- include/location_service/com/ubuntu/location/wgs84/altitude.h 2013-12-10 09:42:54 +0000
2402+++ include/location_service/com/ubuntu/location/wgs84/altitude.h 2015-04-23 17:23:49 +0000
2403@@ -35,13 +35,15 @@
2404 }
2405 typedef Coordinate<tag::Altitude, units::Length> Altitude;
2406
2407-template<>
2408+template <>
2409 struct CoordinateTraits<Altitude>
2410 {
2411- static void check_and_throw_if_invalid(const typename Altitude::Quantity&) {}
2412+ static void check_and_throw_if_invalid(const typename Altitude::Quantity&)
2413+ {
2414+ }
2415 };
2416 }
2417 }
2418 }
2419 }
2420-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_ALTITUDE_H_
2421+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_ALTITUDE_H_
2422
2423=== modified file 'include/location_service/com/ubuntu/location/wgs84/coordinate.h'
2424--- include/location_service/com/ubuntu/location/wgs84/coordinate.h 2013-12-12 14:36:32 +0000
2425+++ include/location_service/com/ubuntu/location/wgs84/coordinate.h 2015-04-23 17:23:49 +0000
2426@@ -30,7 +30,7 @@
2427 {
2428 namespace wgs84
2429 {
2430-template<typename Coordinate>
2431+template <typename Coordinate>
2432 struct CoordinateTraits
2433 {
2434 static void check_and_throw_if_invalid(const typename Coordinate::Quantity& coordinate)
2435@@ -38,7 +38,7 @@
2436 }
2437 };
2438
2439-template<typename Tag, typename UnitType>
2440+template <typename Tag, typename UnitType>
2441 class Coordinate
2442 {
2443 public:
2444@@ -48,15 +48,15 @@
2445 explicit Coordinate(const Quantity& value = Quantity())
2446 : value(value)
2447 {
2448- CoordinateTraits<Coordinate<Tag,UnitType>>::check_and_throw_if_invalid(value);
2449+ CoordinateTraits<Coordinate<Tag, UnitType>>::check_and_throw_if_invalid(value);
2450 }
2451
2452- bool operator==(const Coordinate<Tag,UnitType>& rhs) const
2453+ bool operator==(const Coordinate<Tag, UnitType>& rhs) const
2454 {
2455 return value == rhs.value;
2456 }
2457
2458- bool operator!=(const Coordinate<Tag,UnitType>& rhs) const
2459+ bool operator!=(const Coordinate<Tag, UnitType>& rhs) const
2460 {
2461 return value != rhs.value;
2462 }
2463@@ -64,14 +64,14 @@
2464 Quantity value;
2465 };
2466
2467-template<typename T, typename U>
2468-Coordinate<T,U> operator-(const Coordinate<T,U>& lhs, const Coordinate<T,U>& rhs)
2469+template <typename T, typename U>
2470+Coordinate<T, U> operator-(const Coordinate<T, U>& lhs, const Coordinate<T, U>& rhs)
2471 {
2472- return Coordinate<T,U> {rhs.value - lhs.value};
2473+ return Coordinate<T, U>{rhs.value - lhs.value};
2474 }
2475
2476-template<typename T, typename U>
2477-std::ostream& operator<<(std::ostream& out, const Coordinate<T,U>& coord)
2478+template <typename T, typename U>
2479+std::ostream& operator<<(std::ostream& out, const Coordinate<T, U>& coord)
2480 {
2481 out << "Coordinate(" << coord.value << ")";
2482 return out;
2483@@ -80,4 +80,4 @@
2484 }
2485 }
2486 }
2487-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_COORDINATE_H_
2488+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_COORDINATE_H_
2489
2490=== modified file 'include/location_service/com/ubuntu/location/wgs84/latitude.h'
2491--- include/location_service/com/ubuntu/location/wgs84/latitude.h 2013-12-10 09:42:54 +0000
2492+++ include/location_service/com/ubuntu/location/wgs84/latitude.h 2015-04-23 17:23:49 +0000
2493@@ -37,7 +37,7 @@
2494 }
2495 typedef Coordinate<tag::Latitude, units::PlaneAngle> Latitude;
2496
2497-template<>
2498+template <>
2499 struct CoordinateTraits<Latitude>
2500 {
2501 static double min()
2502@@ -52,13 +52,17 @@
2503 static void check_and_throw_if_invalid(const typename Latitude::Quantity& coordinate)
2504 {
2505 if (coordinate.value() < min())
2506+ {
2507 throw std::out_of_range(u8"Latitude(coordinate.value() < min())");
2508+ }
2509 if (coordinate.value() > max())
2510+ {
2511 throw std::out_of_range(u8"Latitude(coordinate.value() > max())");
2512+ }
2513 }
2514 };
2515 }
2516 }
2517 }
2518 }
2519-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_LATITUDE_H_
2520+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_LATITUDE_H_
2521
2522=== modified file 'include/location_service/com/ubuntu/location/wgs84/longitude.h'
2523--- include/location_service/com/ubuntu/location/wgs84/longitude.h 2013-12-10 09:42:54 +0000
2524+++ include/location_service/com/ubuntu/location/wgs84/longitude.h 2015-04-23 17:23:49 +0000
2525@@ -37,7 +37,7 @@
2526 }
2527 typedef Coordinate<tag::Longitude, units::PlaneAngle> Longitude;
2528
2529-template<>
2530+template <>
2531 struct CoordinateTraits<Longitude>
2532 {
2533 static double min()
2534@@ -52,13 +52,17 @@
2535 static void check_and_throw_if_invalid(const typename Longitude::Quantity& coordinate)
2536 {
2537 if (coordinate.value() < min())
2538+ {
2539 throw std::out_of_range(u8"Longitude(coordinate.value() < min())");
2540+ }
2541 if (coordinate.value() > max())
2542+ {
2543 throw std::out_of_range(u8"Longitude(coordinate.value() > max())");
2544+ }
2545 }
2546 };
2547 }
2548 }
2549 }
2550 }
2551-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_LATITUDE_H_
2552+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WGS84_LATITUDE_H_
2553
2554=== modified file 'include/location_service/com/ubuntu/location/wifi_and_cell_reporting_state.h'
2555--- include/location_service/com/ubuntu/location/wifi_and_cell_reporting_state.h 2014-11-14 11:26:45 +0000
2556+++ include/location_service/com/ubuntu/location/wifi_and_cell_reporting_state.h 2015-04-23 17:23:49 +0000
2557@@ -28,8 +28,8 @@
2558 {
2559 enum class WifiAndCellIdReportingState
2560 {
2561- on, ///< Wifi and Cell Ids might be reported to online location services.
2562- off ///< Wifi and Cell Ids are _not_ reported. This is the default value.
2563+ on, ///< Wifi and Cell Ids might be reported to online location services.
2564+ off ///< Wifi and Cell Ids are _not_ reported. This is the default value.
2565 };
2566
2567 /** @brief Pretty prints the given state to the given stream. */
2568@@ -40,4 +40,4 @@
2569 }
2570 }
2571
2572-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WIFI_AND_CELL_REPORTING_STATE_H_
2573+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_WIFI_AND_CELL_REPORTING_STATE_H_
2574
2575=== modified file 'src/location_service/com/ubuntu/location/boost_ptree_settings.cpp'
2576--- src/location_service/com/ubuntu/location/boost_ptree_settings.cpp 2015-01-14 13:41:54 +0000
2577+++ src/location_service/com/ubuntu/location/boost_ptree_settings.cpp 2015-04-23 17:23:49 +0000
2578@@ -25,7 +25,8 @@
2579 namespace location = com::ubuntu::location;
2580
2581 // Creates a new instance, reading values from the given filename.
2582-location::BoostPtreeSettings::BoostPtreeSettings(const std::string& fn) : fn{fn}
2583+location::BoostPtreeSettings::BoostPtreeSettings(const std::string& fn)
2584+ : fn{fn}
2585 {
2586 try
2587 {
2588@@ -52,7 +53,7 @@
2589
2590 // Returns true iff a value is known for the given key.
2591 bool location::BoostPtreeSettings::has_value_for_key(const std::string& key) const
2592-{
2593+{
2594 return tree.count(key) > 0;
2595 }
2596
2597
2598=== modified file 'src/location_service/com/ubuntu/location/boost_ptree_settings.h'
2599--- src/location_service/com/ubuntu/location/boost_ptree_settings.h 2014-11-14 19:24:45 +0000
2600+++ src/location_service/com/ubuntu/location/boost_ptree_settings.h 2015-04-23 17:23:49 +0000
2601@@ -59,4 +59,4 @@
2602 }
2603 }
2604
2605-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_BOOST_PTREE_SETTINGS_H_
2606+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_BOOST_PTREE_SETTINGS_H_
2607
2608=== modified file 'src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.cpp'
2609--- src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.cpp 2014-11-10 12:31:47 +0000
2610+++ src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.cpp 2015-04-23 17:23:49 +0000
2611@@ -24,15 +24,14 @@
2612 {
2613 // We use this for debugging purposes.
2614 const bool also_apply_cell_change_heuristics_to_gsm_cells =
2615- core::posix::this_process::env::get(
2616- "COM_UBUNTU_LOCATION_CONNECTIVITY_DATA_CELL_FOR_GSM_TOO",
2617- "false") == "true";
2618+ core::posix::this_process::env::get("COM_UBUNTU_LOCATION_CONNECTIVITY_DATA_CELL_FOR_GSM_TOO", "false") == "true";
2619
2620 std::int64_t timeout_in_seconds()
2621 {
2622 auto value = core::posix::this_process::env::get("COM_UBUNTU_LOCATION_CONNECTIVITY_DATA_CELL_TIMEOUT", "60");
2623 std::stringstream ss(value);
2624- std::uint64_t result; ss >> result;
2625+ std::uint64_t result;
2626+ ss >> result;
2627
2628 return result;
2629 }
2630@@ -50,65 +49,56 @@
2631
2632 const std::map<std::string, com::ubuntu::location::connectivity::RadioCell::Type>& detail::CachedRadioCell::type_lut()
2633 {
2634- static const std::map<std::string, com::ubuntu::location::connectivity::RadioCell::Type> lut
2635- {
2636- {
2637- org::Ofono::Manager::Modem::NetworkRegistration::Technology::gsm(),
2638- com::ubuntu::location::connectivity::RadioCell::Type::gsm
2639- },
2640- {
2641- org::Ofono::Manager::Modem::NetworkRegistration::Technology::lte(),
2642- com::ubuntu::location::connectivity::RadioCell::Type::lte
2643- },
2644- {
2645- org::Ofono::Manager::Modem::NetworkRegistration::Technology::umts(),
2646- com::ubuntu::location::connectivity::RadioCell::Type::umts
2647- },
2648- {
2649- org::Ofono::Manager::Modem::NetworkRegistration::Technology::edge(),
2650- com::ubuntu::location::connectivity::RadioCell::Type::gsm
2651- },
2652- {
2653- org::Ofono::Manager::Modem::NetworkRegistration::Technology::hspa(),
2654- com::ubuntu::location::connectivity::RadioCell::Type::umts
2655- },
2656- {std::string(), com::ubuntu::location::connectivity::RadioCell::Type::unknown}
2657- };
2658+ static const std::map<std::string, com::ubuntu::location::connectivity::RadioCell::Type> lut{
2659+ {org::Ofono::Manager::Modem::NetworkRegistration::Technology::gsm(),
2660+ com::ubuntu::location::connectivity::RadioCell::Type::gsm},
2661+ {org::Ofono::Manager::Modem::NetworkRegistration::Technology::lte(),
2662+ com::ubuntu::location::connectivity::RadioCell::Type::lte},
2663+ {org::Ofono::Manager::Modem::NetworkRegistration::Technology::umts(),
2664+ com::ubuntu::location::connectivity::RadioCell::Type::umts},
2665+ {org::Ofono::Manager::Modem::NetworkRegistration::Technology::edge(),
2666+ com::ubuntu::location::connectivity::RadioCell::Type::gsm},
2667+ {org::Ofono::Manager::Modem::NetworkRegistration::Technology::hspa(),
2668+ com::ubuntu::location::connectivity::RadioCell::Type::umts},
2669+ {std::string(), com::ubuntu::location::connectivity::RadioCell::Type::unknown}};
2670
2671 return lut;
2672 }
2673
2674-detail::CachedRadioCell::CellChangeHeuristics::CellChangeHeuristics(
2675- boost::asio::io_service& io_service,
2676- bool needed)
2677- : needed(needed),
2678- io_service(io_service),
2679- invalidation_timer(io_service),
2680- valid(true)
2681+detail::CachedRadioCell::CellChangeHeuristics::CellChangeHeuristics(boost::asio::io_service& io_service, bool needed)
2682+ : needed(needed)
2683+ , io_service(io_service)
2684+ , invalidation_timer(io_service)
2685+ , valid(true)
2686 {
2687 }
2688
2689 detail::CachedRadioCell::CachedRadioCell(const org::Ofono::Manager::Modem& modem, boost::asio::io_service& io_service)
2690- : RadioCell(),
2691- cell_change_heuristics(io_service, is_running_on_problematic_modem_firmware(modem)),
2692- roaming(false),
2693- radio_type(Type::gsm),
2694- modem(modem),
2695- detail{}
2696+ : RadioCell()
2697+ , cell_change_heuristics(io_service, is_running_on_problematic_modem_firmware(modem))
2698+ , roaming(false)
2699+ , radio_type(Type::gsm)
2700+ , modem(modem)
2701+ , detail{}
2702 {
2703 auto status = query_status();
2704 radio_type = query_technology();
2705
2706- connections.network_registration_properties_changed = modem.network_registration.signals.property_changed->connect([this](const std::tuple<std::string, core::dbus::types::Variant>& tuple)
2707- {
2708- on_network_registration_property_changed(tuple);
2709- });
2710+ connections.network_registration_properties_changed = modem.network_registration.signals.property_changed->connect(
2711+ [this](const std::tuple<std::string, core::dbus::types::Variant>& tuple)
2712+ {
2713+ on_network_registration_property_changed(tuple);
2714+ });
2715
2716 if (not is_registered_or_roaming(status))
2717+ {
2718 return;
2719+ }
2720
2721 if (radio_type == com::ubuntu::location::connectivity::RadioCell::Type::unknown)
2722+ {
2723 return;
2724+ }
2725
2726 auto lac = query_lac();
2727 auto mcc = query_mcc();
2728@@ -116,53 +106,47 @@
2729 auto cell_id = query_cid();
2730 auto strength = query_strength();
2731
2732- switch(radio_type)
2733- {
2734- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2735- {
2736- com::ubuntu::location::connectivity::RadioCell::Gsm gsm
2737- {
2738- com::ubuntu::location::connectivity::RadioCell::Gsm::MCC{mcc},
2739- com::ubuntu::location::connectivity::RadioCell::Gsm::MNC{mnc},
2740- com::ubuntu::location::connectivity::RadioCell::Gsm::LAC{lac},
2741- com::ubuntu::location::connectivity::RadioCell::Gsm::ID{cell_id},
2742- com::ubuntu::location::connectivity::RadioCell::Gsm::SignalStrength::from_percent(strength/100.f)
2743- };
2744- VLOG(1) << gsm;
2745- detail.gsm = gsm;
2746- break;
2747- }
2748- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2749- {
2750- com::ubuntu::location::connectivity::RadioCell::Lte lte
2751- {
2752- com::ubuntu::location::connectivity::RadioCell::Lte::MCC{mcc},
2753- com::ubuntu::location::connectivity::RadioCell::Lte::MNC{mnc},
2754- com::ubuntu::location::connectivity::RadioCell::Lte::TAC{lac},
2755- com::ubuntu::location::connectivity::RadioCell::Lte::ID{cell_id},
2756- com::ubuntu::location::connectivity::RadioCell::Lte::PID{},
2757- com::ubuntu::location::connectivity::RadioCell::Lte::SignalStrength::from_percent(strength/100.f)
2758- };
2759- VLOG(1) << lte;
2760- detail.lte = lte;
2761- break;
2762- }
2763- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2764- {
2765- com::ubuntu::location::connectivity::RadioCell::Umts umts
2766- {
2767- com::ubuntu::location::connectivity::RadioCell::Umts::MCC{mcc},
2768- com::ubuntu::location::connectivity::RadioCell::Umts::MNC{mnc},
2769- com::ubuntu::location::connectivity::RadioCell::Umts::LAC{lac},
2770- com::ubuntu::location::connectivity::RadioCell::Umts::ID{cell_id},
2771- com::ubuntu::location::connectivity::RadioCell::Umts::SignalStrength::from_percent(strength/100.f)
2772- };
2773- VLOG(1) << umts;
2774- detail.umts = umts;
2775- break;
2776- }
2777- default:
2778- break;
2779+ switch (radio_type)
2780+ {
2781+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2782+ {
2783+ com::ubuntu::location::connectivity::RadioCell::Gsm gsm{
2784+ com::ubuntu::location::connectivity::RadioCell::Gsm::MCC{mcc},
2785+ com::ubuntu::location::connectivity::RadioCell::Gsm::MNC{mnc},
2786+ com::ubuntu::location::connectivity::RadioCell::Gsm::LAC{lac},
2787+ com::ubuntu::location::connectivity::RadioCell::Gsm::ID{cell_id},
2788+ com::ubuntu::location::connectivity::RadioCell::Gsm::SignalStrength::from_percent(strength / 100.f)};
2789+ VLOG(1) << gsm;
2790+ detail.gsm = gsm;
2791+ break;
2792+ }
2793+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2794+ {
2795+ com::ubuntu::location::connectivity::RadioCell::Lte lte{
2796+ com::ubuntu::location::connectivity::RadioCell::Lte::MCC{mcc},
2797+ com::ubuntu::location::connectivity::RadioCell::Lte::MNC{mnc},
2798+ com::ubuntu::location::connectivity::RadioCell::Lte::TAC{lac},
2799+ com::ubuntu::location::connectivity::RadioCell::Lte::ID{cell_id},
2800+ com::ubuntu::location::connectivity::RadioCell::Lte::PID{},
2801+ com::ubuntu::location::connectivity::RadioCell::Lte::SignalStrength::from_percent(strength / 100.f)};
2802+ VLOG(1) << lte;
2803+ detail.lte = lte;
2804+ break;
2805+ }
2806+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2807+ {
2808+ com::ubuntu::location::connectivity::RadioCell::Umts umts{
2809+ com::ubuntu::location::connectivity::RadioCell::Umts::MCC{mcc},
2810+ com::ubuntu::location::connectivity::RadioCell::Umts::MNC{mnc},
2811+ com::ubuntu::location::connectivity::RadioCell::Umts::LAC{lac},
2812+ com::ubuntu::location::connectivity::RadioCell::Umts::ID{cell_id},
2813+ com::ubuntu::location::connectivity::RadioCell::Umts::SignalStrength::from_percent(strength / 100.f)};
2814+ VLOG(1) << umts;
2815+ detail.umts = umts;
2816+ break;
2817+ }
2818+ default:
2819+ break;
2820 }
2821
2822 roaming = status == org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::roaming;
2823@@ -172,7 +156,8 @@
2824
2825 detail::CachedRadioCell::~CachedRadioCell()
2826 {
2827- modem.network_registration.signals.property_changed->disconnect(connections.network_registration_properties_changed);
2828+ modem.network_registration.signals.property_changed->disconnect(
2829+ connections.network_registration_properties_changed);
2830 }
2831
2832 const core::Property<bool>& detail::CachedRadioCell::is_roaming() const
2833@@ -198,7 +183,9 @@
2834 const com::ubuntu::location::connectivity::RadioCell::Gsm& detail::CachedRadioCell::gsm() const
2835 {
2836 if (radio_type != com::ubuntu::location::connectivity::RadioCell::Type::gsm)
2837+ {
2838 throw std::runtime_error("Bad access to unset network type.");
2839+ }
2840
2841 return detail.gsm;
2842 }
2843@@ -206,7 +193,9 @@
2844 const com::ubuntu::location::connectivity::RadioCell::Umts& detail::CachedRadioCell::umts() const
2845 {
2846 if (radio_type != RadioCell::Type::umts)
2847+ {
2848 throw std::runtime_error("Bad access to unset network type.");
2849+ }
2850
2851 return detail.umts;
2852 }
2853@@ -214,14 +203,18 @@
2854 const com::ubuntu::location::connectivity::RadioCell::Lte& detail::CachedRadioCell::lte() const
2855 {
2856 if (radio_type != RadioCell::Type::lte)
2857+ {
2858 throw std::runtime_error("Bad access to unset network type.");
2859+ }
2860
2861 return detail.lte;
2862 }
2863
2864-void detail::CachedRadioCell::on_network_registration_property_changed(const std::tuple<std::string, core::dbus::types::Variant>& tuple)
2865+void detail::CachedRadioCell::on_network_registration_property_changed(
2866+ const std::tuple<std::string, core::dbus::types::Variant>& tuple)
2867 {
2868- VLOG(10) << "Property changed on modem " << modem.object->path() << " for network registration: " << std::get<0>(tuple);
2869+ VLOG(10) << "Property changed on modem " << modem.object->path()
2870+ << " for network registration: " << std::get<0>(tuple);
2871
2872 const auto& key = std::get<0>(tuple);
2873 const auto& variant = std::get<1>(tuple);
2874@@ -232,9 +225,7 @@
2875 {
2876 did_cell_identity_change = true;
2877
2878- auto value = variant.as<
2879- org::Ofono::Manager::Modem::NetworkRegistration::Technology::ValueType
2880- >();
2881+ auto value = variant.as<org::Ofono::Manager::Modem::NetworkRegistration::Technology::ValueType>();
2882
2883 auto it = type_lut().find(value);
2884
2885@@ -251,251 +242,254 @@
2886 }
2887
2888 if (radio_type == it->second)
2889+ {
2890 return;
2891+ }
2892
2893- switch(radio_type)
2894+ switch (radio_type)
2895 {
2896- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2897- switch(it->second)
2898- {
2899- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2900- detail.umts.location_area_code = detail.gsm.location_area_code;
2901- detail.umts.mobile_network_code = detail.gsm.mobile_network_code;
2902- detail.umts.mobile_country_code = detail.gsm.mobile_country_code;
2903- detail.umts.strength.reset();
2904- detail.umts.id.reset();
2905- break;
2906- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2907- detail.lte.tracking_area_code = detail.gsm.location_area_code;
2908- detail.lte.mobile_network_code = detail.gsm.mobile_network_code;
2909- detail.lte.mobile_country_code = detail.gsm.mobile_country_code;
2910- detail.lte.strength.reset();
2911- detail.lte.id.reset();
2912- break;
2913- default:
2914- break;
2915- }
2916- break;
2917- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2918- switch(it->second)
2919- {
2920- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2921- detail.gsm.location_area_code = detail.umts.location_area_code;
2922- detail.gsm.mobile_network_code = detail.umts.mobile_network_code;
2923- detail.gsm.mobile_country_code = detail.umts.mobile_country_code;
2924- detail.gsm.strength.reset();
2925- detail.gsm.id.reset();
2926- break;
2927- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2928- detail.lte.tracking_area_code = detail.umts.location_area_code;
2929- detail.lte.mobile_network_code = detail.umts.mobile_network_code;
2930- detail.lte.mobile_country_code = detail.umts.mobile_country_code;
2931- detail.lte.strength.reset();
2932- detail.lte.id.reset();
2933- break;
2934- default:
2935- break;
2936- }
2937- break;
2938- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2939- switch(it->second)
2940- {
2941- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2942- detail.gsm.location_area_code = detail.lte.tracking_area_code;
2943- detail.gsm.mobile_network_code = detail.lte.mobile_network_code;
2944- detail.gsm.mobile_country_code = detail.lte.mobile_country_code;
2945- detail.gsm.strength.reset();
2946- detail.gsm.id.reset();
2947- break;
2948- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2949- detail.umts.location_area_code = detail.lte.tracking_area_code;
2950- detail.umts.mobile_network_code = detail.lte.mobile_network_code;
2951- detail.umts.mobile_country_code = detail.lte.mobile_country_code;
2952- detail.umts.strength.reset();
2953- detail.umts.id.reset();
2954- break;
2955- default:
2956- break;
2957- }
2958- default:
2959- // We take the default path here, specifically for cases where
2960- // we started out with Technology::unknown.
2961- break;
2962+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2963+ switch (it->second)
2964+ {
2965+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2966+ detail.umts.location_area_code = detail.gsm.location_area_code;
2967+ detail.umts.mobile_network_code = detail.gsm.mobile_network_code;
2968+ detail.umts.mobile_country_code = detail.gsm.mobile_country_code;
2969+ detail.umts.strength.reset();
2970+ detail.umts.id.reset();
2971+ break;
2972+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2973+ detail.lte.tracking_area_code = detail.gsm.location_area_code;
2974+ detail.lte.mobile_network_code = detail.gsm.mobile_network_code;
2975+ detail.lte.mobile_country_code = detail.gsm.mobile_country_code;
2976+ detail.lte.strength.reset();
2977+ detail.lte.id.reset();
2978+ break;
2979+ default:
2980+ break;
2981+ }
2982+ break;
2983+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
2984+ switch (it->second)
2985+ {
2986+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
2987+ detail.gsm.location_area_code = detail.umts.location_area_code;
2988+ detail.gsm.mobile_network_code = detail.umts.mobile_network_code;
2989+ detail.gsm.mobile_country_code = detail.umts.mobile_country_code;
2990+ detail.gsm.strength.reset();
2991+ detail.gsm.id.reset();
2992+ break;
2993+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
2994+ detail.lte.tracking_area_code = detail.umts.location_area_code;
2995+ detail.lte.mobile_network_code = detail.umts.mobile_network_code;
2996+ detail.lte.mobile_country_code = detail.umts.mobile_country_code;
2997+ detail.lte.strength.reset();
2998+ detail.lte.id.reset();
2999+ break;
3000+ default:
3001+ break;
3002+ }
3003+ break;
3004+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3005+ switch (it->second)
3006+ {
3007+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3008+ detail.gsm.location_area_code = detail.lte.tracking_area_code;
3009+ detail.gsm.mobile_network_code = detail.lte.mobile_network_code;
3010+ detail.gsm.mobile_country_code = detail.lte.mobile_country_code;
3011+ detail.gsm.strength.reset();
3012+ detail.gsm.id.reset();
3013+ break;
3014+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3015+ detail.umts.location_area_code = detail.lte.tracking_area_code;
3016+ detail.umts.mobile_network_code = detail.lte.mobile_network_code;
3017+ detail.umts.mobile_country_code = detail.lte.mobile_country_code;
3018+ detail.umts.strength.reset();
3019+ detail.umts.id.reset();
3020+ break;
3021+ default:
3022+ break;
3023+ }
3024+ default:
3025+ // We take the default path here, specifically for cases where
3026+ // we started out with Technology::unknown.
3027+ break;
3028 };
3029
3030 radio_type = it->second;
3031
3032 if (cell_change_heuristics.valid.get())
3033+ {
3034 on_changed();
3035+ }
3036 }
3037
3038 if (key == org::Ofono::Manager::Modem::NetworkRegistration::CellId::name())
3039 {
3040 did_cell_identity_change = true;
3041
3042- auto value = variant.as<
3043- org::Ofono::Manager::Modem::NetworkRegistration::CellId::ValueType
3044- >();
3045+ auto value = variant.as<org::Ofono::Manager::Modem::NetworkRegistration::CellId::ValueType>();
3046
3047- switch(radio_type)
3048+ switch (radio_type)
3049 {
3050- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3051- detail.gsm.id.set(value);
3052- VLOG(1) << detail.gsm;
3053- break;
3054- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3055- detail.umts.id.set(value);
3056- VLOG(1) << detail.umts;
3057- break;
3058- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3059- detail.lte.id.set(value);
3060- VLOG(1) << detail.lte;
3061- break;
3062- default:
3063- break;
3064+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3065+ detail.gsm.id.set(value);
3066+ VLOG(1) << detail.gsm;
3067+ break;
3068+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3069+ detail.umts.id.set(value);
3070+ VLOG(1) << detail.umts;
3071+ break;
3072+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3073+ detail.lte.id.set(value);
3074+ VLOG(1) << detail.lte;
3075+ break;
3076+ default:
3077+ break;
3078 };
3079
3080 if (cell_change_heuristics.valid.get())
3081+ {
3082 on_changed();
3083+ }
3084 }
3085
3086 if (key == org::Ofono::Manager::Modem::NetworkRegistration::LocationAreaCode::name())
3087 {
3088 did_cell_identity_change = true;
3089
3090- auto value = variant.as<
3091- org::Ofono::Manager::Modem::NetworkRegistration::LocationAreaCode::ValueType
3092- >();
3093- switch(radio_type)
3094+ auto value = variant.as<org::Ofono::Manager::Modem::NetworkRegistration::LocationAreaCode::ValueType>();
3095+ switch (radio_type)
3096 {
3097- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3098- detail.gsm.location_area_code.set(value);
3099- VLOG(1) << detail.gsm;
3100- break;
3101- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3102- detail.umts.location_area_code.set(value);
3103- VLOG(1) << detail.umts;
3104- break;
3105- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3106- detail.lte.tracking_area_code.set(value);
3107- VLOG(1) << detail.lte;
3108- break;
3109- default:
3110- break;
3111+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3112+ detail.gsm.location_area_code.set(value);
3113+ VLOG(1) << detail.gsm;
3114+ break;
3115+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3116+ detail.umts.location_area_code.set(value);
3117+ VLOG(1) << detail.umts;
3118+ break;
3119+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3120+ detail.lte.tracking_area_code.set(value);
3121+ VLOG(1) << detail.lte;
3122+ break;
3123+ default:
3124+ break;
3125 };
3126
3127 if (cell_change_heuristics.valid.get())
3128+ {
3129 on_changed();
3130+ }
3131 }
3132
3133 if (key == org::Ofono::Manager::Modem::NetworkRegistration::MobileCountryCode::name())
3134 {
3135 did_cell_identity_change = true;
3136
3137- std::stringstream ss
3138- {
3139- variant.as<
3140- org::Ofono::Manager::Modem::NetworkRegistration::MobileCountryCode::ValueType
3141- >()
3142- };
3143- int value{-1}; ss >> value;
3144+ std::stringstream ss{
3145+ variant.as<org::Ofono::Manager::Modem::NetworkRegistration::MobileCountryCode::ValueType>()};
3146+ int value{-1};
3147+ ss >> value;
3148
3149- switch(radio_type)
3150+ switch (radio_type)
3151 {
3152- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3153- detail.gsm.mobile_country_code.set(value);
3154- VLOG(1) << detail.gsm;
3155- break;
3156- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3157- detail.umts.mobile_country_code.set(value);
3158- VLOG(1) << detail.umts;
3159- break;
3160- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3161- detail.lte.mobile_country_code.set(value);
3162- VLOG(1) << detail.lte;
3163- break;
3164- default:
3165- break;
3166+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3167+ detail.gsm.mobile_country_code.set(value);
3168+ VLOG(1) << detail.gsm;
3169+ break;
3170+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3171+ detail.umts.mobile_country_code.set(value);
3172+ VLOG(1) << detail.umts;
3173+ break;
3174+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3175+ detail.lte.mobile_country_code.set(value);
3176+ VLOG(1) << detail.lte;
3177+ break;
3178+ default:
3179+ break;
3180 };
3181
3182 if (cell_change_heuristics.valid.get())
3183+ {
3184 on_changed();
3185+ }
3186 }
3187
3188 if (key == org::Ofono::Manager::Modem::NetworkRegistration::MobileNetworkCode::name())
3189 {
3190 did_cell_identity_change = true;
3191
3192- std::stringstream ss
3193- {
3194- variant.as<
3195- org::Ofono::Manager::Modem::NetworkRegistration::MobileNetworkCode::ValueType
3196- >()
3197- };
3198- int value{-1}; ss >> value;
3199+ std::stringstream ss{
3200+ variant.as<org::Ofono::Manager::Modem::NetworkRegistration::MobileNetworkCode::ValueType>()};
3201+ int value{-1};
3202+ ss >> value;
3203
3204- switch(radio_type)
3205+ switch (radio_type)
3206 {
3207- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3208- detail.gsm.mobile_network_code.set(value);
3209- VLOG(1) << detail.gsm;
3210- break;
3211- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3212- detail.umts.mobile_network_code.set(value);
3213- VLOG(1) << detail.umts;
3214- break;
3215- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3216- detail.lte.mobile_network_code.set(value);
3217- VLOG(1) << detail.lte;
3218- break;
3219- default:
3220- break;
3221+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3222+ detail.gsm.mobile_network_code.set(value);
3223+ VLOG(1) << detail.gsm;
3224+ break;
3225+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3226+ detail.umts.mobile_network_code.set(value);
3227+ VLOG(1) << detail.umts;
3228+ break;
3229+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3230+ detail.lte.mobile_network_code.set(value);
3231+ VLOG(1) << detail.lte;
3232+ break;
3233+ default:
3234+ break;
3235 };
3236
3237 if (cell_change_heuristics.valid.get())
3238+ {
3239 on_changed();
3240+ }
3241 }
3242
3243 if (key == org::Ofono::Manager::Modem::NetworkRegistration::Strength::name())
3244 {
3245- auto value = variant.as<
3246- org::Ofono::Manager::Modem::NetworkRegistration::Strength::ValueType
3247- >();
3248+ auto value = variant.as<org::Ofono::Manager::Modem::NetworkRegistration::Strength::ValueType>();
3249
3250- switch(radio_type)
3251+ switch (radio_type)
3252 {
3253- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3254- detail.gsm.strength
3255- = com::ubuntu::location::connectivity::RadioCell::Gsm::SignalStrength::from_percent(value/100.f);
3256- VLOG(1) << detail.gsm;
3257- break;
3258- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3259- detail.umts.strength
3260- = com::ubuntu::location::connectivity::RadioCell::Umts::SignalStrength::from_percent(value/100.f);
3261- VLOG(1) << detail.umts;
3262- break;
3263- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3264- detail.lte.strength
3265- = com::ubuntu::location::connectivity::RadioCell::Lte::SignalStrength::from_percent(value/100.f);
3266- VLOG(1) << detail.lte;
3267- break;
3268- default:
3269- break;
3270+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3271+ detail.gsm.strength =
3272+ com::ubuntu::location::connectivity::RadioCell::Gsm::SignalStrength::from_percent(value / 100.f);
3273+ VLOG(1) << detail.gsm;
3274+ break;
3275+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3276+ detail.umts.strength =
3277+ com::ubuntu::location::connectivity::RadioCell::Umts::SignalStrength::from_percent(value / 100.f);
3278+ VLOG(1) << detail.umts;
3279+ break;
3280+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3281+ detail.lte.strength =
3282+ com::ubuntu::location::connectivity::RadioCell::Lte::SignalStrength::from_percent(value / 100.f);
3283+ VLOG(1) << detail.lte;
3284+ break;
3285+ default:
3286+ break;
3287 };
3288
3289 if (cell_change_heuristics.valid.get())
3290+ {
3291 on_changed();
3292+ }
3293 }
3294
3295 if (key == org::Ofono::Manager::Modem::NetworkRegistration::Status::name())
3296 {
3297- roaming =
3298- variant.as<org::Ofono::Manager::Modem::NetworkRegistration::Status::ValueType>() ==
3299- org::Ofono::Manager::Modem::NetworkRegistration::Status::roaming;
3300+ roaming = variant.as<org::Ofono::Manager::Modem::NetworkRegistration::Status::ValueType>() ==
3301+ org::Ofono::Manager::Modem::NetworkRegistration::Status::roaming;
3302 }
3303
3304 if (did_cell_identity_change)
3305+ {
3306 execute_cell_change_heuristics_if_appropriate();
3307+ }
3308 }
3309
3310 void detail::CachedRadioCell::execute_cell_change_heuristics_if_appropriate()
3311@@ -504,9 +498,9 @@
3312 // whenever the cell identity changes, we start a timer and invalidate the
3313 // cell to account for situations where the underlying modem firmware does not
3314 // report cell changes when on a 3G data connection.
3315- if (cell_change_heuristics.needed && // Only carry out this step if it is actually required
3316+ if (cell_change_heuristics.needed && // Only carry out this step if it is actually required
3317 (radio_type == com::ubuntu::location::connectivity::RadioCell::Type::umts ||
3318- also_apply_cell_change_heuristics_to_gsm_cells)) // and if it's a 3G cell.
3319+ also_apply_cell_change_heuristics_to_gsm_cells)) // and if it's a 3G cell.
3320 {
3321 static const boost::posix_time::seconds timeout{timeout_in_seconds()};
3322
3323@@ -514,10 +508,12 @@
3324
3325 cell_change_heuristics.invalidation_timer.expires_from_now(timeout);
3326 cell_change_heuristics.invalidation_timer.async_wait([this](boost::system::error_code ec)
3327- {
3328- if (not ec)
3329- cell_change_heuristics.valid = false;
3330- });
3331+ {
3332+ if (not ec)
3333+ {
3334+ cell_change_heuristics.valid = false;
3335+ }
3336+ });
3337
3338 cell_change_heuristics.valid = is_cell_details_valid();
3339 }
3340@@ -526,32 +522,42 @@
3341 // Queries the status from the Ofono NetworkRegistration.
3342 org::Ofono::Manager::Modem::NetworkRegistration::Status::Value detail::CachedRadioCell::query_status()
3343 {
3344- auto status =
3345- modem.network_registration.get
3346- <
3347- org::Ofono::Manager::Modem::NetworkRegistration::Status
3348- >();
3349+ auto status = modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::Status>();
3350
3351 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::unregistered)
3352+ {
3353 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::unregistered;
3354+ }
3355
3356 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::registered)
3357+ {
3358 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::registered;
3359+ }
3360
3361 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::searching)
3362+ {
3363 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::searching;
3364+ }
3365
3366 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::denied)
3367+ {
3368 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::denied;
3369+ }
3370
3371 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::unknown)
3372+ {
3373 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::unknown;
3374+ }
3375
3376 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::unregistered)
3377+ {
3378 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::unregistered;
3379+ }
3380
3381 if (status == org::Ofono::Manager::Modem::NetworkRegistration::Status::roaming)
3382+ {
3383 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::roaming;
3384+ }
3385
3386 return org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::unknown;
3387 }
3388@@ -559,15 +565,14 @@
3389 // Queries the technology from the Ofono NetworkRegistration.
3390 com::ubuntu::location::connectivity::RadioCell::Type detail::CachedRadioCell::query_technology()
3391 {
3392- auto technology =
3393- modem.network_registration.get<
3394- org::Ofono::Manager::Modem::NetworkRegistration::Technology
3395- >();
3396+ auto technology = modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::Technology>();
3397
3398 auto it = type_lut().find(technology);
3399
3400 if (it == type_lut().end())
3401+ {
3402 return com::ubuntu::location::connectivity::RadioCell::Type::unknown;
3403+ }
3404
3405 return it->second;
3406 }
3407@@ -575,60 +580,44 @@
3408 // Queries the cell id from the Ofono NetworkRegistration.
3409 int detail::CachedRadioCell::query_cid()
3410 {
3411- return modem.network_registration.get
3412- <
3413- org::Ofono::Manager::Modem::NetworkRegistration::CellId
3414- >();
3415+ return modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::CellId>();
3416 }
3417
3418 // Queries the location area code from the Ofono NetworkRegistration.
3419 std::uint16_t detail::CachedRadioCell::query_lac()
3420 {
3421- return modem.network_registration.get
3422- <
3423- org::Ofono::Manager::Modem::NetworkRegistration::LocationAreaCode
3424- >();
3425+ return modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::LocationAreaCode>();
3426 }
3427
3428 // Queries the mobile network code from the Ofono NetworkRegistration.
3429 int detail::CachedRadioCell::query_mnc()
3430 {
3431- std::stringstream ssmnc
3432- {
3433- modem.network_registration.get
3434- <
3435- org::Ofono::Manager::Modem::NetworkRegistration::MobileNetworkCode
3436- >()
3437- };
3438- int mnc{0}; ssmnc >> mnc;
3439+ std::stringstream ssmnc{
3440+ modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::MobileNetworkCode>()};
3441+ int mnc{0};
3442+ ssmnc >> mnc;
3443 return mnc;
3444 }
3445
3446 // Queries the mobile country code from the Ofono NetworkRegistration.
3447 int detail::CachedRadioCell::query_mcc()
3448 {
3449- std::stringstream ssmcc
3450- {
3451- modem.network_registration.get
3452- <
3453- org::Ofono::Manager::Modem::NetworkRegistration::MobileCountryCode
3454- >()
3455- };
3456- int mcc{0}; ssmcc >> mcc;
3457+ std::stringstream ssmcc{
3458+ modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::MobileCountryCode>()};
3459+ int mcc{0};
3460+ ssmcc >> mcc;
3461 return mcc;
3462 }
3463
3464 // Queries the signal strength from the Ofono NetworkRegistration.
3465 std::int8_t detail::CachedRadioCell::query_strength()
3466 {
3467- return modem.network_registration.get
3468- <
3469- org::Ofono::Manager::Modem::NetworkRegistration::Strength
3470- >();
3471+ return modem.network_registration.get<org::Ofono::Manager::Modem::NetworkRegistration::Strength>();
3472 }
3473
3474 // Returns true iff status is either roaming or registered.
3475-bool detail::CachedRadioCell::is_registered_or_roaming(org::Ofono::Manager::Modem::NetworkRegistration::Status::Value status)
3476+bool detail::CachedRadioCell::is_registered_or_roaming(
3477+ org::Ofono::Manager::Modem::NetworkRegistration::Status::Value status)
3478 {
3479 return status == org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::registered ||
3480 status == org::Ofono::Manager::Modem::NetworkRegistration::Status::Value::roaming;
3481@@ -637,16 +626,16 @@
3482 // Returns true iff all the parts of the cell are populated with valid values.
3483 bool detail::CachedRadioCell::is_cell_details_valid()
3484 {
3485- switch(radio_type)
3486+ switch (radio_type)
3487 {
3488- case com::ubuntu::location::connectivity::RadioCell::Type::unknown:
3489- return false;
3490- case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3491- return is_gsm_valid();
3492- case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3493- return is_umts_valid();
3494- case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3495- return is_lte_valid();
3496+ case com::ubuntu::location::connectivity::RadioCell::Type::unknown:
3497+ return false;
3498+ case com::ubuntu::location::connectivity::RadioCell::Type::gsm:
3499+ return is_gsm_valid();
3500+ case com::ubuntu::location::connectivity::RadioCell::Type::umts:
3501+ return is_umts_valid();
3502+ case com::ubuntu::location::connectivity::RadioCell::Type::lte:
3503+ return is_lte_valid();
3504 }
3505
3506 return false;
3507@@ -655,46 +644,41 @@
3508 // Retuns true iff the GSM cell details are valid.
3509 bool detail::CachedRadioCell::is_gsm_valid()
3510 {
3511- return gsm().mobile_country_code.is_valid() &&
3512- gsm().mobile_network_code.is_valid() &&
3513- gsm().location_area_code.is_valid() &&
3514- gsm().id.is_valid() &&
3515- gsm().strength.is_valid();
3516+ return gsm().mobile_country_code.is_valid() && gsm().mobile_network_code.is_valid() &&
3517+ gsm().location_area_code.is_valid() && gsm().id.is_valid() && gsm().strength.is_valid();
3518 }
3519
3520 // Returns true iff the Umts cell details are valid.
3521 bool detail::CachedRadioCell::is_umts_valid()
3522 {
3523- return umts().mobile_country_code.is_valid() &&
3524- umts().mobile_network_code.is_valid() &&
3525- umts().location_area_code.is_valid() &&
3526- umts().id.is_valid() &&
3527- umts().strength.is_valid();
3528+ return umts().mobile_country_code.is_valid() && umts().mobile_network_code.is_valid() &&
3529+ umts().location_area_code.is_valid() && umts().id.is_valid() && umts().strength.is_valid();
3530 }
3531
3532 // Returns true iff the Lte cell details are valid.
3533 bool detail::CachedRadioCell::is_lte_valid()
3534 {
3535- return lte().mobile_country_code.is_valid() &&
3536- lte().mobile_network_code.is_valid() &&
3537- lte().tracking_area_code.is_valid() &&
3538- lte().id.is_valid() &&
3539- lte().physical_id.is_valid() &&
3540+ return lte().mobile_country_code.is_valid() && lte().mobile_network_code.is_valid() &&
3541+ lte().tracking_area_code.is_valid() && lte().id.is_valid() && lte().physical_id.is_valid() &&
3542 lte().strength.is_valid();
3543 }
3544
3545-detail::CachedRadioCell::Detail::Detail() : none(detail::CachedRadioCell::None{})
3546-{
3547-}
3548-
3549-detail::CachedRadioCell::Detail::Detail(const com::ubuntu::location::connectivity::RadioCell::Gsm& gsm) : gsm(gsm)
3550-{
3551-}
3552-
3553-detail::CachedRadioCell::Detail::Detail(const com::ubuntu::location::connectivity::RadioCell::Umts& umts) : umts(umts)
3554-{
3555-}
3556-
3557-detail::CachedRadioCell::Detail::Detail(const com::ubuntu::location::connectivity::RadioCell::Lte& lte) : lte(lte)
3558+detail::CachedRadioCell::Detail::Detail()
3559+ : none(detail::CachedRadioCell::None{})
3560+{
3561+}
3562+
3563+detail::CachedRadioCell::Detail::Detail(const com::ubuntu::location::connectivity::RadioCell::Gsm& gsm)
3564+ : gsm(gsm)
3565+{
3566+}
3567+
3568+detail::CachedRadioCell::Detail::Detail(const com::ubuntu::location::connectivity::RadioCell::Umts& umts)
3569+ : umts(umts)
3570+{
3571+}
3572+
3573+detail::CachedRadioCell::Detail::Detail(const com::ubuntu::location::connectivity::RadioCell::Lte& lte)
3574+ : lte(lte)
3575 {
3576 }
3577
3578=== modified file 'src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.h'
3579--- src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.h 2014-10-13 12:38:40 +0000
3580+++ src/location_service/com/ubuntu/location/connectivity/cached_radio_cell.h 2015-04-23 17:23:49 +0000
3581@@ -72,8 +72,7 @@
3582 // cell change heuristics go here.
3583 struct CellChangeHeuristics
3584 {
3585- CellChangeHeuristics(boost::asio::io_service& io_service,
3586- bool needed);
3587+ CellChangeHeuristics(boost::asio::io_service& io_service, bool needed);
3588 // True if the heuristic is needed
3589 const bool needed;
3590 // The io_service for setting up timeouts.
3591@@ -86,7 +85,7 @@
3592 // Property to indicate whether the current cell is
3593 // still valid according to the cell change heuristics.
3594 core::Property<bool> valid;
3595- } cell_change_heuristics;
3596+ } cell_change_heuristics;
3597 // Executes the cell change heuristics if precondition is met.
3598 void execute_cell_change_heuristics_if_appropriate();
3599
3600@@ -123,15 +122,15 @@
3601 // Encapsulates all event connections that have to be cut on destruction.
3602 struct
3603 {
3604- core::dbus::Signal
3605- <
3606- org::Ofono::Manager::Modem::NetworkRegistration::PropertyChanged,
3607- org::Ofono::Manager::Modem::NetworkRegistration::PropertyChanged::ArgumentType
3608- >::SubscriptionToken network_registration_properties_changed;
3609+ core::dbus::Signal<org::Ofono::Manager::Modem::NetworkRegistration::PropertyChanged,
3610+ org::Ofono::Manager::Modem::NetworkRegistration::PropertyChanged::ArgumentType>::
3611+ SubscriptionToken network_registration_properties_changed;
3612 } connections;
3613
3614 // Marks the unset type in a variant.
3615- struct None {};
3616+ struct None
3617+ {
3618+ };
3619
3620 // Our custom variant handling the different known cell identity details.
3621 union Detail
3622@@ -154,4 +153,4 @@
3623 };
3624 }
3625
3626-#endif // CACHED_RADIO_CELL_H_
3627+#endif // CACHED_RADIO_CELL_H_
3628
3629=== modified file 'src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.cpp'
3630--- src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.cpp 2014-08-14 20:33:37 +0000
3631+++ src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.cpp 2015-04-23 17:23:49 +0000
3632@@ -27,25 +27,23 @@
3633 return std::string(ssid.begin(), ssid.end());
3634 }
3635
3636-com::ubuntu::location::connectivity::WirelessNetwork::Mode
3637-wifi_mode_from_ap_mode(org::freedesktop::NetworkManager::AccessPoint::Mode::ValueType value)
3638+com::ubuntu::location::connectivity::WirelessNetwork::Mode wifi_mode_from_ap_mode(
3639+ org::freedesktop::NetworkManager::AccessPoint::Mode::ValueType value)
3640 {
3641- com::ubuntu::location::connectivity::WirelessNetwork::Mode mode
3642- {
3643- com::ubuntu::location::connectivity::WirelessNetwork::Mode::unknown
3644- };
3645+ com::ubuntu::location::connectivity::WirelessNetwork::Mode mode{
3646+ com::ubuntu::location::connectivity::WirelessNetwork::Mode::unknown};
3647
3648 switch (value)
3649 {
3650- case org::freedesktop::NetworkManager::AccessPoint::Mode::Value::unknown:
3651- mode = com::ubuntu::location::connectivity::WirelessNetwork::Mode::unknown;
3652- break;
3653- case org::freedesktop::NetworkManager::AccessPoint::Mode::Value::adhoc:
3654- mode = com::ubuntu::location::connectivity::WirelessNetwork::Mode::adhoc;
3655- break;
3656- case org::freedesktop::NetworkManager::AccessPoint::Mode::Value::infra:
3657- mode = com::ubuntu::location::connectivity::WirelessNetwork::Mode::infrastructure;
3658- break;
3659+ case org::freedesktop::NetworkManager::AccessPoint::Mode::Value::unknown:
3660+ mode = com::ubuntu::location::connectivity::WirelessNetwork::Mode::unknown;
3661+ break;
3662+ case org::freedesktop::NetworkManager::AccessPoint::Mode::Value::adhoc:
3663+ mode = com::ubuntu::location::connectivity::WirelessNetwork::Mode::adhoc;
3664+ break;
3665+ case org::freedesktop::NetworkManager::AccessPoint::Mode::Value::infra:
3666+ mode = com::ubuntu::location::connectivity::WirelessNetwork::Mode::infrastructure;
3667+ break;
3668 }
3669
3670 return mode;
3671@@ -77,101 +75,76 @@
3672 return frequency_;
3673 }
3674
3675-const core::Property<connectivity::WirelessNetwork::SignalStrength>& detail::CachedWirelessNetwork::signal_strength() const
3676+const core::Property<connectivity::WirelessNetwork::SignalStrength>& detail::CachedWirelessNetwork::signal_strength()
3677+ const
3678 {
3679 return signal_strength_;
3680 }
3681
3682-detail::CachedWirelessNetwork::CachedWirelessNetwork(
3683- const org::freedesktop::NetworkManager::Device& device,
3684- const org::freedesktop::NetworkManager::AccessPoint& ap)
3685- : device_(device),
3686- access_point_(ap)
3687+detail::CachedWirelessNetwork::CachedWirelessNetwork(const org::freedesktop::NetworkManager::Device& device,
3688+ const org::freedesktop::NetworkManager::AccessPoint& ap)
3689+ : device_(device)
3690+ , access_point_(ap)
3691 {
3692- last_seen_ = std::chrono::system_clock::time_point
3693- {
3694- std::chrono::system_clock::duration{access_point_.last_seen->get()}
3695- };
3696+ last_seen_ =
3697+ std::chrono::system_clock::time_point{std::chrono::system_clock::duration{access_point_.last_seen->get()}};
3698
3699 bssid_ = access_point_.hw_address->get();
3700 ssid_ = utf8_ssid_to_string(access_point_.ssid->get());
3701 mode_ = wifi_mode_from_ap_mode(access_point_.mode->get());
3702- frequency_ = com::ubuntu::location::connectivity::WirelessNetwork::Frequency
3703- {
3704- static_cast<int>(access_point_.frequency->get())
3705- };
3706- signal_strength_ = com::ubuntu::location::connectivity::WirelessNetwork::SignalStrength
3707- {
3708- static_cast<int>(access_point_.strength->get())
3709- };
3710+ frequency_ = com::ubuntu::location::connectivity::WirelessNetwork::Frequency{
3711+ static_cast<int>(access_point_.frequency->get())};
3712+ signal_strength_ = com::ubuntu::location::connectivity::WirelessNetwork::SignalStrength{
3713+ static_cast<int>(access_point_.strength->get())};
3714
3715 // Wire up all the connections
3716 access_point_.properties_changed->connect([this](const std::map<std::string, core::dbus::types::Variant>& dict)
3717- {
3718- on_access_point_properties_changed(dict);
3719- });
3720+ {
3721+ on_access_point_properties_changed(dict);
3722+ });
3723 }
3724
3725-void detail::CachedWirelessNetwork::on_access_point_properties_changed(const std::map<std::string, core::dbus::types::Variant>& dict)
3726+void detail::CachedWirelessNetwork::on_access_point_properties_changed(
3727+ const std::map<std::string, core::dbus::types::Variant>& dict)
3728 {
3729 // We route by string
3730- static const std::unordered_map<std::string, std::function<void(CachedWirelessNetwork&, const core::dbus::types::Variant&)> > lut
3731- {
3732- {
3733- org::freedesktop::NetworkManager::AccessPoint::HwAddress::name(),
3734- [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3735- {
3736- thiz.bssid_ = value.as<org::freedesktop::NetworkManager::AccessPoint::HwAddress::ValueType>();
3737- }
3738- },
3739- {
3740- org::freedesktop::NetworkManager::AccessPoint::Ssid::name(),
3741- [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3742- {
3743- thiz.ssid_ = utf8_ssid_to_string(value.as<org::freedesktop::NetworkManager::AccessPoint::Ssid::ValueType>());
3744- }
3745- },
3746- {
3747- org::freedesktop::NetworkManager::AccessPoint::Strength::name(),
3748- [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3749- {
3750- thiz.signal_strength_ = com::ubuntu::location::connectivity::WirelessNetwork::SignalStrength
3751- {
3752- value.as<org::freedesktop::NetworkManager::AccessPoint::Strength::ValueType>()
3753- };
3754- }
3755- },
3756- {
3757- org::freedesktop::NetworkManager::AccessPoint::Frequency::name(),
3758- [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3759- {
3760- thiz.frequency_ = com::ubuntu::location::connectivity::WirelessNetwork::Frequency
3761- {
3762- static_cast<int>(value.as<org::freedesktop::NetworkManager::AccessPoint::Frequency::ValueType>())
3763- };
3764- }
3765- },
3766- {
3767- org::freedesktop::NetworkManager::AccessPoint::Mode::name(),
3768- [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3769- {
3770- thiz.mode_ = wifi_mode_from_ap_mode(value.as<org::freedesktop::NetworkManager::AccessPoint::Mode::ValueType>());
3771- }
3772- },
3773- {
3774- org::freedesktop::NetworkManager::AccessPoint::LastSeen::name(),
3775- [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3776- {
3777- thiz.last_seen_ = std::chrono::system_clock::time_point
3778- {
3779- std::chrono::system_clock::duration
3780- {
3781- value.as<org::freedesktop::NetworkManager::AccessPoint::LastSeen::ValueType>()
3782- }
3783- };
3784- }
3785- }
3786- };
3787+ static const std::unordered_map<std::string,
3788+ std::function<void(CachedWirelessNetwork&, const core::dbus::types::Variant&)>> lut{
3789+ {org::freedesktop::NetworkManager::AccessPoint::HwAddress::name(),
3790+ [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3791+ {
3792+ thiz.bssid_ = value.as<org::freedesktop::NetworkManager::AccessPoint::HwAddress::ValueType>();
3793+ }},
3794+ {org::freedesktop::NetworkManager::AccessPoint::Ssid::name(),
3795+ [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3796+ {
3797+ thiz.ssid_ =
3798+ utf8_ssid_to_string(value.as<org::freedesktop::NetworkManager::AccessPoint::Ssid::ValueType>());
3799+ }},
3800+ {org::freedesktop::NetworkManager::AccessPoint::Strength::name(),
3801+ [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3802+ {
3803+ thiz.signal_strength_ = com::ubuntu::location::connectivity::WirelessNetwork::SignalStrength{
3804+ value.as<org::freedesktop::NetworkManager::AccessPoint::Strength::ValueType>()};
3805+ }},
3806+ {org::freedesktop::NetworkManager::AccessPoint::Frequency::name(),
3807+ [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3808+ {
3809+ thiz.frequency_ = com::ubuntu::location::connectivity::WirelessNetwork::Frequency{
3810+ static_cast<int>(value.as<org::freedesktop::NetworkManager::AccessPoint::Frequency::ValueType>())};
3811+ }},
3812+ {org::freedesktop::NetworkManager::AccessPoint::Mode::name(),
3813+ [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3814+ {
3815+ thiz.mode_ =
3816+ wifi_mode_from_ap_mode(value.as<org::freedesktop::NetworkManager::AccessPoint::Mode::ValueType>());
3817+ }},
3818+ {org::freedesktop::NetworkManager::AccessPoint::LastSeen::name(),
3819+ [](CachedWirelessNetwork& thiz, const core::dbus::types::Variant& value)
3820+ {
3821+ thiz.last_seen_ = std::chrono::system_clock::time_point{std::chrono::system_clock::duration{
3822+ value.as<org::freedesktop::NetworkManager::AccessPoint::LastSeen::ValueType>()}};
3823+ }}};
3824
3825 for (const auto& pair : dict)
3826 {
3827@@ -182,8 +155,12 @@
3828 // log the issue for later analysis.
3829 try
3830 {
3831- if (lut.count(pair.first) > 0) lut.at(pair.first)(*this, pair.second);
3832- } catch (...)
3833+ if (lut.count(pair.first) > 0)
3834+ {
3835+ lut.at(pair.first)(*this, pair.second);
3836+ }
3837+ }
3838+ catch (...)
3839 {
3840 VLOG(1) << "Exception while updating state for property change: " << pair.first;
3841 }
3842
3843=== modified file 'src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.h'
3844--- src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.h 2014-08-14 20:25:22 +0000
3845+++ src/location_service/com/ubuntu/location/connectivity/cached_wireless_network.h 2015-04-23 17:23:49 +0000
3846@@ -37,9 +37,8 @@
3847 // Constructs a new instance associated with the ap and the (remote) device
3848 // it belongs to. Please note that the caching nature of the class ensures that
3849 // ap and device stubs are kept alive.
3850- CachedWirelessNetwork(
3851- const org::freedesktop::NetworkManager::Device& device,
3852- const org::freedesktop::NetworkManager::AccessPoint& ap);
3853+ CachedWirelessNetwork(const org::freedesktop::NetworkManager::Device& device,
3854+ const org::freedesktop::NetworkManager::AccessPoint& ap);
3855
3856 // Timestamp when the network became visible.
3857 const core::Property<std::chrono::system_clock::time_point>& last_seen() const override;
3858@@ -76,4 +75,4 @@
3859 };
3860 }
3861
3862-#endif // CACHED_WIRELESS_NETWORK_H_
3863+#endif // CACHED_WIRELESS_NETWORK_H_
3864
3865=== modified file 'src/location_service/com/ubuntu/location/connectivity/dummy_connectivity_manager.h'
3866--- src/location_service/com/ubuntu/location/connectivity/dummy_connectivity_manager.h 2014-10-08 20:51:25 +0000
3867+++ src/location_service/com/ubuntu/location/connectivity/dummy_connectivity_manager.h 2015-04-23 17:23:49 +0000
3868@@ -50,7 +50,8 @@
3869 return properties.is_wwan_hardware_enabled;
3870 }
3871
3872- const core::Property<com::ubuntu::location::connectivity::Characteristics>& active_connection_characteristics() const
3873+ const core::Property<com::ubuntu::location::connectivity::Characteristics>& active_connection_characteristics()
3874+ const
3875 {
3876 return properties.active_connection_characteristics;
3877 }
3878@@ -74,7 +75,8 @@
3879 return sigs.wireless_network_removed;
3880 }
3881
3882- void enumerate_visible_wireless_networks(const std::function<void(const com::ubuntu::location::connectivity::WirelessNetwork::Ptr&)>&) const
3883+ void enumerate_visible_wireless_networks(
3884+ const std::function<void(const com::ubuntu::location::connectivity::WirelessNetwork::Ptr&)>&) const
3885 {
3886 }
3887
3888@@ -88,7 +90,8 @@
3889 return sigs.connected_cell_removed;
3890 }
3891
3892- void enumerate_connected_radio_cells(const std::function<void(const com::ubuntu::location::connectivity::RadioCell::Ptr&)>&) const
3893+ void enumerate_connected_radio_cells(
3894+ const std::function<void(const com::ubuntu::location::connectivity::RadioCell::Ptr&)>&) const
3895 {
3896 }
3897
3898@@ -98,7 +101,8 @@
3899 core::Property<bool> is_wwan_enabled{false};
3900 core::Property<bool> is_wifi_hardware_enabled{false};
3901 core::Property<bool> is_wwan_hardware_enabled{false};
3902- core::Property<com::ubuntu::location::connectivity::State> state{com::ubuntu::location::connectivity::State::unknown};
3903+ core::Property<com::ubuntu::location::connectivity::State> state{
3904+ com::ubuntu::location::connectivity::State::unknown};
3905 core::Property<com::ubuntu::location::connectivity::Characteristics> active_connection_characteristics{};
3906 } properties;
3907
3908@@ -113,4 +117,4 @@
3909 };
3910 }
3911
3912-#endif // DUMMY_CONNECTIVITY_MANAGER_H_
3913+#endif // DUMMY_CONNECTIVITY_MANAGER_H_
3914
3915=== modified file 'src/location_service/com/ubuntu/location/connectivity/manager.cpp'
3916--- src/location_service/com/ubuntu/location/connectivity/manager.cpp 2014-10-02 06:59:46 +0000
3917+++ src/location_service/com/ubuntu/location/connectivity/manager.cpp 2015-04-23 17:23:49 +0000
3918@@ -24,14 +24,30 @@
3919 {
3920 switch (state)
3921 {
3922- case State::unknown: out << "State::unknown"; break;
3923- case State::asleep: out << "State::asleep"; break;
3924- case State::disconnected: out << "State::disconnected"; break;
3925- case State::disconnecting: out << "State::disconnecting"; break;
3926- case State::connecting: out << "State::connecting"; break;
3927- case State::connected_local: out << "State::connected_local"; break;
3928- case State::connected_site: out << "State::connected_site"; break;
3929- case State::connected_global: out << "State::connected_global"; break;
3930+ case State::unknown:
3931+ out << "State::unknown";
3932+ break;
3933+ case State::asleep:
3934+ out << "State::asleep";
3935+ break;
3936+ case State::disconnected:
3937+ out << "State::disconnected";
3938+ break;
3939+ case State::disconnecting:
3940+ out << "State::disconnecting";
3941+ break;
3942+ case State::connecting:
3943+ out << "State::connecting";
3944+ break;
3945+ case State::connected_local:
3946+ out << "State::connected_local";
3947+ break;
3948+ case State::connected_site:
3949+ out << "State::connected_site";
3950+ break;
3951+ case State::connected_global:
3952+ out << "State::connected_global";
3953+ break;
3954 }
3955
3956 return out;
3957@@ -53,18 +69,41 @@
3958
3959 out << "[";
3960
3961- if ((characteristics & connectivity::Characteristics::connection_goes_via_wifi) != connectivity::Characteristics::none)
3962- { out << "connection_goes_via_wifi"; first = false; }
3963- if ((characteristics & connectivity::Characteristics::connection_goes_via_wwan) != connectivity::Characteristics::none)
3964- { out << (first ? "" : ", ") << "connection_goes_via_wwan"; first = false; }
3965+ if ((characteristics & connectivity::Characteristics::connection_goes_via_wifi) !=
3966+ connectivity::Characteristics::none)
3967+ {
3968+ out << "connection_goes_via_wifi";
3969+ first = false;
3970+ }
3971+ if ((characteristics & connectivity::Characteristics::connection_goes_via_wwan) !=
3972+ connectivity::Characteristics::none)
3973+ {
3974+ out << (first ? "" : ", ") << "connection_goes_via_wwan";
3975+ first = false;
3976+ }
3977 if ((characteristics & connectivity::Characteristics::connection_is_roaming) != connectivity::Characteristics::none)
3978- { out << (first ? "" : ", ") << "connection_is_roaming"; first = false; }
3979- if ((characteristics & connectivity::Characteristics::connection_has_monetary_costs) != connectivity::Characteristics::none)
3980- { out << (first ? "" : ", ") << "connection_has_monetary_costs"; first = false; }
3981- if ((characteristics & connectivity::Characteristics::connection_is_bandwith_limited) != connectivity::Characteristics::none)
3982- { out << (first ? "" : ", ") << "connection_is_bandwidth_limited"; first = false; }
3983- if ((characteristics & connectivity::Characteristics::connection_is_volume_limited) != connectivity::Characteristics::none)
3984- { out << (first ? "" : ", ") << "connection_is_volume_limited"; first = false; }
3985+ {
3986+ out << (first ? "" : ", ") << "connection_is_roaming";
3987+ first = false;
3988+ }
3989+ if ((characteristics & connectivity::Characteristics::connection_has_monetary_costs) !=
3990+ connectivity::Characteristics::none)
3991+ {
3992+ out << (first ? "" : ", ") << "connection_has_monetary_costs";
3993+ first = false;
3994+ }
3995+ if ((characteristics & connectivity::Characteristics::connection_is_bandwith_limited) !=
3996+ connectivity::Characteristics::none)
3997+ {
3998+ out << (first ? "" : ", ") << "connection_is_bandwidth_limited";
3999+ first = false;
4000+ }
4001+ if ((characteristics & connectivity::Characteristics::connection_is_volume_limited) !=
4002+ connectivity::Characteristics::none)
4003+ {
4004+ out << (first ? "" : ", ") << "connection_is_volume_limited";
4005+ first = false;
4006+ }
4007
4008 out << "]";
4009 return out;
4010
4011=== modified file 'src/location_service/com/ubuntu/location/connectivity/nm.h'
4012--- src/location_service/com/ubuntu/location/connectivity/nm.h 2015-02-26 10:59:22 +0000
4013+++ src/location_service/com/ubuntu/location/connectivity/nm.h 2015-04-23 17:23:49 +0000
4014@@ -151,14 +151,14 @@
4015 };
4016
4017 AccessPoint(const std::shared_ptr<core::dbus::Object>& object)
4018- : object(object),
4019- frequency(object->get_property<Frequency>()),
4020- last_seen(object->get_property<LastSeen>()),
4021- mode(object->get_property<Mode>()),
4022- hw_address(object->get_property<HwAddress>()),
4023- ssid(object->get_property<Ssid>()),
4024- strength(object->get_property<Strength>()),
4025- properties_changed(object->get_signal<PropertiesChanged>())
4026+ : object(object)
4027+ , frequency(object->get_property<Frequency>())
4028+ , last_seen(object->get_property<LastSeen>())
4029+ , mode(object->get_property<Mode>())
4030+ , hw_address(object->get_property<HwAddress>())
4031+ , ssid(object->get_property<Ssid>())
4032+ , strength(object->get_property<Strength>())
4033+ , properties_changed(object->get_signal<PropertiesChanged>())
4034 {
4035 }
4036
4037@@ -291,17 +291,13 @@
4038 static const bool writable = false;
4039 };
4040
4041- Device(const std::shared_ptr<core::dbus::Service>& service,
4042- const std::shared_ptr<core::dbus::Object>& object)
4043- : service(service),
4044- object(object),
4045- device_type(object->get_property<DeviceType>()),
4046- signals
4047- {
4048- object->get_signal<Wireless::Signals::ScanDone>(),
4049- object->get_signal<Wireless::Signals::AccessPointAdded>(),
4050- object->get_signal<Wireless::Signals::AccessPointRemoved>()
4051- }
4052+ Device(const std::shared_ptr<core::dbus::Service>& service, const std::shared_ptr<core::dbus::Object>& object)
4053+ : service(service)
4054+ , object(object)
4055+ , device_type(object->get_property<DeviceType>())
4056+ , signals{object->get_signal<Wireless::Signals::ScanDone>(),
4057+ object->get_signal<Wireless::Signals::AccessPointAdded>(),
4058+ object->get_signal<Wireless::Signals::AccessPointRemoved>()}
4059 {
4060 }
4061
4062@@ -316,10 +312,14 @@
4063 auto result = object->transact_method<Wireless::GetAccessPoints, ResultType>();
4064
4065 if (result.is_error())
4066+ {
4067 throw std::runtime_error(result.error().print());
4068+ }
4069
4070 for (const auto& path : result.value())
4071+ {
4072 f(path);
4073+ }
4074 }
4075
4076 std::vector<AccessPoint> get_access_points() const
4077@@ -328,12 +328,16 @@
4078 auto result = object->invoke_method_synchronously<Wireless::GetAccessPoints, ResultType>();
4079
4080 if (result.is_error())
4081+ {
4082 throw std::runtime_error(result.error().print());
4083+ }
4084
4085 std::vector<AccessPoint> aps;
4086
4087 for (const auto& path : result.value())
4088+ {
4089 aps.push_back(AccessPoint(service->object_for_path(path)));
4090+ }
4091
4092 return aps;
4093 }
4094@@ -350,8 +354,10 @@
4095 struct
4096 {
4097 core::dbus::Signal<Wireless::Signals::ScanDone, Wireless::Signals::ScanDone::ArgumentType>::Ptr scan_done;
4098- core::dbus::Signal<Wireless::Signals::AccessPointAdded, Wireless::Signals::AccessPointAdded::ArgumentType>::Ptr ap_added;
4099- core::dbus::Signal<Wireless::Signals::AccessPointRemoved, Wireless::Signals::AccessPointRemoved::ArgumentType>::Ptr ap_removed;
4100+ core::dbus::Signal<Wireless::Signals::AccessPointAdded,
4101+ Wireless::Signals::AccessPointAdded::ArgumentType>::Ptr ap_added;
4102+ core::dbus::Signal<Wireless::Signals::AccessPointRemoved,
4103+ Wireless::Signals::AccessPointRemoved::ArgumentType>::Ptr ap_removed;
4104 } signals;
4105 };
4106
4107@@ -382,12 +388,9 @@
4108
4109 ActiveConnection(const std::shared_ptr<core::dbus::Service>& service,
4110 const std::shared_ptr<core::dbus::Object>& object)
4111- : service{service},
4112- object{object},
4113- properties
4114- {
4115- object->get_property<Properties::Devices>()
4116- }
4117+ : service{service}
4118+ , object{object}
4119+ , properties{object->get_property<Properties::Devices>()}
4120 {
4121 }
4122
4123@@ -396,14 +399,16 @@
4124 auto device_paths = properties.devices->get();
4125
4126 for (const auto& device_path : device_paths)
4127+ {
4128 functor(device_path);
4129+ }
4130 }
4131
4132 std::shared_ptr<core::dbus::Service> service;
4133 std::shared_ptr<core::dbus::Object> object;
4134 struct
4135 {
4136- std::shared_ptr<core::dbus::Property<Properties::Devices> > devices;
4137+ std::shared_ptr<core::dbus::Property<Properties::Devices>> devices;
4138 } properties;
4139 };
4140
4141@@ -603,41 +608,35 @@
4142 };
4143
4144 NetworkManager(const core::dbus::Bus::Ptr& bus)
4145- : service(core::dbus::Service::use_service<NetworkManager>(bus)),
4146- object(service->object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/NetworkManager"))),
4147- properties
4148- {
4149- object->get_property<Properties::Connectivity>(),
4150- object->get_property<Properties::PrimaryConnection>(),
4151- object->get_property<Properties::State>(),
4152- object->get_property<Properties::WirelessEnabled>(),
4153- object->get_property<Properties::WirelessHardwareEnabled>(),
4154- object->get_property<Properties::WwanEnabled>(),
4155- object->get_property<Properties::WwanHardwareEnabled>()
4156- },
4157- signals
4158- {
4159- object->get_signal<Signals::DeviceAdded>(),
4160- object->get_signal<Signals::DeviceRemoved>(),
4161- object->get_signal<Signals::PropertiesChanged>(),
4162- object->get_signal<Signals::StateChanged>()
4163- }
4164+ : service(core::dbus::Service::use_service<NetworkManager>(bus))
4165+ , object(service->object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/NetworkManager")))
4166+ , properties{object->get_property<Properties::Connectivity>(),
4167+ object->get_property<Properties::PrimaryConnection>(),
4168+ object->get_property<Properties::State>(),
4169+ object->get_property<Properties::WirelessEnabled>(),
4170+ object->get_property<Properties::WirelessHardwareEnabled>(),
4171+ object->get_property<Properties::WwanEnabled>(),
4172+ object->get_property<Properties::WwanHardwareEnabled>()}
4173+ , signals{object->get_signal<Signals::DeviceAdded>(),
4174+ object->get_signal<Signals::DeviceRemoved>(),
4175+ object->get_signal<Signals::PropertiesChanged>(),
4176+ object->get_signal<Signals::StateChanged>()}
4177 {
4178 }
4179
4180 void for_each_device(const std::function<void(const core::dbus::types::ObjectPath&)>& f)
4181 {
4182- auto result =
4183- object->transact_method<
4184- NetworkManager::GetDevices,
4185- std::vector<core::dbus::types::ObjectPath>
4186- >();
4187+ auto result = object->transact_method<NetworkManager::GetDevices, std::vector<core::dbus::types::ObjectPath>>();
4188
4189 if (result.is_error())
4190+ {
4191 throw std::runtime_error(result.error().print());
4192+ }
4193
4194 for (const auto& path : result.value())
4195+ {
4196 f(path);
4197+ }
4198 }
4199
4200 Device device_for_path(const core::dbus::types::ObjectPath& path)
4201@@ -648,20 +647,18 @@
4202 std::vector<Device> get_devices()
4203 {
4204 auto result =
4205- object->invoke_method_synchronously<
4206- NetworkManager::GetDevices,
4207- std::vector<core::dbus::types::ObjectPath>>();
4208+ object
4209+ ->invoke_method_synchronously<NetworkManager::GetDevices, std::vector<core::dbus::types::ObjectPath>>();
4210
4211 if (result.is_error())
4212+ {
4213 throw std::runtime_error(result.error().print());
4214+ }
4215
4216 std::vector<Device> devices;
4217 for (const auto& path : result.value())
4218 {
4219- devices.emplace_back(
4220- Device(
4221- service,
4222- service->object_for_path(path)));
4223+ devices.emplace_back(Device(service, service->object_for_path(path)));
4224 }
4225
4226 return devices;
4227@@ -672,23 +669,24 @@
4228
4229 struct
4230 {
4231- std::shared_ptr<core::dbus::Property<Properties::Connectivity> > connectivity;
4232- std::shared_ptr<core::dbus::Property<Properties::PrimaryConnection> > primary_connection;
4233- std::shared_ptr<core::dbus::Property<Properties::State> > state;
4234- std::shared_ptr<core::dbus::Property<Properties::WirelessEnabled> > is_wifi_enabled;
4235- std::shared_ptr<core::dbus::Property<Properties::WirelessHardwareEnabled> > is_wifi_hardware_enabled;
4236- std::shared_ptr<core::dbus::Property<Properties::WwanEnabled> > is_wwan_enabled;
4237- std::shared_ptr<core::dbus::Property<Properties::WwanHardwareEnabled> > is_wwan_hardware_enabled;
4238+ std::shared_ptr<core::dbus::Property<Properties::Connectivity>> connectivity;
4239+ std::shared_ptr<core::dbus::Property<Properties::PrimaryConnection>> primary_connection;
4240+ std::shared_ptr<core::dbus::Property<Properties::State>> state;
4241+ std::shared_ptr<core::dbus::Property<Properties::WirelessEnabled>> is_wifi_enabled;
4242+ std::shared_ptr<core::dbus::Property<Properties::WirelessHardwareEnabled>> is_wifi_hardware_enabled;
4243+ std::shared_ptr<core::dbus::Property<Properties::WwanEnabled>> is_wwan_enabled;
4244+ std::shared_ptr<core::dbus::Property<Properties::WwanHardwareEnabled>> is_wwan_hardware_enabled;
4245 } properties;
4246 struct
4247 {
4248 core::dbus::Signal<Signals::DeviceAdded, Signals::DeviceAdded::ArgumentType>::Ptr device_added;
4249 core::dbus::Signal<Signals::DeviceRemoved, Signals::DeviceRemoved::ArgumentType>::Ptr device_removed;
4250- core::dbus::Signal<Signals::PropertiesChanged, Signals::PropertiesChanged::ArgumentType>::Ptr properties_changed;
4251+ core::dbus::Signal<Signals::PropertiesChanged, Signals::PropertiesChanged::ArgumentType>::Ptr
4252+ properties_changed;
4253 core::dbus::Signal<Signals::StateChanged, Signals::StateChanged::ArgumentType>::Ptr state_changed;
4254 } signals;
4255 };
4256 }
4257 }
4258
4259-#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_NM_H
4260+#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CONNECTIVITY_NM_H
4261
4262=== modified file 'src/location_service/com/ubuntu/location/connectivity/ofono.h'
4263--- src/location_service/com/ubuntu/location/connectivity/ofono.h 2015-01-06 12:35:02 +0000
4264+++ src/location_service/com/ubuntu/location/connectivity/ofono.h 2015-04-23 17:23:49 +0000
4265@@ -36,84 +36,31 @@
4266 {
4267 struct Ofono
4268 {
4269-static const std::string& name()
4270-{
4271- static const std::string s{"org.ofono"};
4272- return s;
4273-}
4274-struct Manager
4275-{
4276- typedef std::shared_ptr<Manager> Ptr;
4277-
4278 static const std::string& name()
4279 {
4280- static const std::string s{"org.ofono.Manager"};
4281+ static const std::string s{"org.ofono"};
4282 return s;
4283 }
4284-
4285- struct GetModems
4286- {
4287- static const std::string& name()
4288- {
4289- static const std::string s{"GetModems"};
4290- return s;
4291- }
4292-
4293- typedef Manager Interface;
4294- typedef std::vector<
4295- core::dbus::types::Struct<
4296- core::dbus::types::ObjectPath
4297- >
4298- > ResultType;
4299-
4300- static std::chrono::milliseconds default_timeout()
4301- {
4302- return std::chrono::seconds{1};
4303- }
4304- };
4305-
4306- struct ModemAdded
4307- {
4308- static const std::string& name()
4309- {
4310- static const std::string s{"ModemAdded"};
4311- return s;
4312- }
4313-
4314- typedef Manager Interface;
4315- typedef std::tuple<core::dbus::types::ObjectPath, std::map<std::string, std::string>> ArgumentType;
4316- };
4317-
4318- struct ModemRemoved
4319- {
4320- static const std::string& name()
4321- {
4322- static const std::string s{"ModemRemoved"};
4323- return s;
4324- }
4325-
4326- typedef Manager Interface;
4327- typedef core::dbus::types::ObjectPath ArgumentType;
4328- };
4329-
4330- struct Modem
4331- {
4332- static const std::string& name()
4333- {
4334- static const std::string s{"org.ofono.Modem"};
4335- return s;
4336- }
4337-
4338- struct GetProperties
4339+ struct Manager
4340+ {
4341+ typedef std::shared_ptr<Manager> Ptr;
4342+
4343+ static const std::string& name()
4344+ {
4345+ static const std::string s{"org.ofono.Manager"};
4346+ return s;
4347+ }
4348+
4349+ struct GetModems
4350 {
4351 static const std::string& name()
4352 {
4353- static const std::string s{"GetProperties"};
4354+ static const std::string s{"GetModems"};
4355 return s;
4356 }
4357
4358- typedef Modem Interface;
4359- typedef std::map<std::string, core::dbus::types::Variant> ValueType;
4360+ typedef Manager Interface;
4361+ typedef std::vector<core::dbus::types::Struct<core::dbus::types::ObjectPath>> ResultType;
4362
4363 static std::chrono::milliseconds default_timeout()
4364 {
4365@@ -121,287 +68,37 @@
4366 }
4367 };
4368
4369- struct PropertyChanged
4370- {
4371- inline static std::string name()
4372- {
4373- return "PropertyChanged";
4374- }
4375-
4376- typedef Modem Interface;
4377-
4378- typedef std::tuple<std::string, core::dbus::types::Variant> ArgumentType;
4379- };
4380-
4381- struct Properties
4382- {
4383- struct Powered
4384- {
4385- static const std::string& name()
4386- {
4387- static const std::string s{"Powered"};
4388- return s;
4389- }
4390-
4391- typedef Modem Interface;
4392- typedef bool ValueType;
4393- static const bool readable = true;
4394- static const bool writable = true;
4395- };
4396-
4397- struct Online
4398- {
4399- static const std::string& name()
4400- {
4401- static const std::string s{"Online"};
4402- return s;
4403- }
4404-
4405- typedef Modem Interface;
4406- typedef bool ValueType;
4407- static const bool readable = true;
4408- static const bool writable = true;
4409- };
4410-
4411- struct Lockdown
4412- {
4413- static const std::string& name()
4414- {
4415- static const std::string s{"Lockdown"};
4416- return s;
4417- }
4418-
4419- typedef Modem Interface;
4420- typedef bool ValueType;
4421- static const bool readable = true;
4422- static const bool writable = true;
4423- };
4424-
4425- struct Name
4426- {
4427- static const std::string& name()
4428- {
4429- static const std::string s{"Name"};
4430- return s;
4431- }
4432-
4433- typedef Modem Interface;
4434- typedef std::string ValueType;
4435- static const bool readable = true;
4436- static const bool writable = false;
4437- };
4438-
4439- struct Manufacturer
4440- {
4441- static const std::string& name()
4442- {
4443- static const std::string s{"Manufacturer"};
4444- return s;
4445- }
4446-
4447- typedef Modem Interface;
4448- typedef std::string ValueType;
4449- static const bool readable = true;
4450- static const bool writable = false;
4451- };
4452-
4453- struct Model
4454- {
4455- static const std::string& name()
4456- {
4457- static const std::string s{"Model"};
4458- return s;
4459- }
4460-
4461- typedef Modem Interface;
4462- typedef std::string ValueType;
4463- static const bool readable = true;
4464- static const bool writable = false;
4465- };
4466-
4467- struct Revision
4468- {
4469- static const std::string& name()
4470- {
4471- static const std::string s{"Revision"};
4472- return s;
4473- }
4474-
4475- typedef Modem Interface;
4476- typedef std::string ValueType;
4477- static const bool readable = true;
4478- static const bool writable = false;
4479- };
4480-
4481- struct Serial
4482- {
4483- static const std::string& name()
4484- {
4485- static const std::string s{"Serial"};
4486- return s;
4487- }
4488-
4489- typedef Modem Interface;
4490- typedef std::string ValueType;
4491- static const bool readable = true;
4492- static const bool writable = false;
4493- };
4494-
4495- struct Features
4496- {
4497- static constexpr const char* net{"net"};
4498- static constexpr const char* rat{"rat"};
4499- static constexpr const char* cbs{"cbs"};
4500- static constexpr const char* sms{"sms"};
4501- static constexpr const char* sim{"sim"};
4502- static constexpr const char* stk{"stk"};
4503- static constexpr const char* ussd{"ussd"};
4504- static constexpr const char* gprs{"gprs"};
4505- static constexpr const char* tty{"tty"};
4506- static constexpr const char* gps{"gps"};
4507-
4508- static const std::string& name()
4509- {
4510- static const std::string s{"Features"};
4511- return s;
4512- }
4513-
4514- typedef Modem Interface;
4515- typedef std::vector<std::string> ValueType;
4516- static const bool readable = true;
4517- static const bool writable = false;
4518- };
4519-
4520- struct Interfaces
4521- {
4522- static constexpr const char* assisted_satellite_navigation
4523- {
4524- "org.ofono.AssistedSatelliteNavigation"
4525- };
4526- static constexpr const char* audio_settings
4527- {
4528- "org.ofono.AudioSettings"
4529- };
4530- static constexpr const char* call_barring
4531- {
4532- "org.ofono.CallBarring"
4533- };
4534- static constexpr const char* call_forwarding
4535- {
4536- "org.ofono.CallForwarding"
4537- };
4538- static constexpr const char* call_meter
4539- {
4540- "org.ofono.CallMeter"
4541- };
4542- static constexpr const char* call_settings
4543- {
4544- "org.ofono.CallSettings"
4545- };
4546- static constexpr const char* call_volume
4547- {
4548- "org.ofono.CallVolume"
4549- };
4550- static constexpr const char* cell_broadcast
4551- {
4552- "org.ofono.CellBroadcast"
4553- };
4554- static constexpr const char* hands_free
4555- {
4556- "org.ofono.Handsfree"
4557- };
4558- static constexpr const char* location_reporting
4559- {
4560- "org.ofono.LocationReporting"
4561- };
4562- static constexpr const char* message_manager
4563- {
4564- "org.ofono.MessageManager"
4565- };
4566- static constexpr const char* message_waiting
4567- {
4568- "org.ofono.MessageWaiting"
4569- };
4570- static constexpr const char* network_registration
4571- {
4572- "org.ofono.NetworkRegistration"
4573- };
4574- static constexpr const char* phonebook
4575- {
4576- "org.ofono.Phonebook"
4577- };
4578- static constexpr const char* push_notification
4579- {
4580- "org.ofono.PushNotification"
4581- };
4582- static constexpr const char* radio_settings
4583- {
4584- "org.ofono.RadioSettings"
4585- };
4586- static constexpr const char* sim_manager
4587- {
4588- "org.ofono.SimManager"
4589- };
4590- static constexpr const char* smart_messaging
4591- {
4592- "org.ofono.SmartMessaging"
4593- };
4594- static constexpr const char* sim_toolkit
4595- {
4596- "org.ofono.SimToolkit"
4597- };
4598- static constexpr const char* supplementary_services
4599- {
4600- "org.ofono.SupplementaryServices"
4601- };
4602- static constexpr const char* text_telephony
4603- {
4604- "org.ofono.TextTelephony"
4605- };
4606- static constexpr const char* voice_call_manager
4607- {
4608- "org.ofono.VoiceCallManager"
4609- };
4610-
4611- static const std::string& name()
4612- {
4613- static const std::string s{"Interfaces"};
4614- return s;
4615- }
4616-
4617- typedef Modem Interface;
4618- typedef std::vector<std::string> ValueType;
4619- static const bool readable = true;
4620- static const bool writable = false;
4621- };
4622-
4623- struct Type
4624- {
4625- static constexpr const char* test{"test"};
4626- static constexpr const char* hfp{"hfp"};
4627- static constexpr const char* sap{"sap"};
4628- static constexpr const char* hardware{"hardware"};
4629-
4630- static const std::string& name()
4631- {
4632- static const std::string s{"Type"};
4633- return s;
4634- }
4635-
4636- typedef Modem Interface;
4637- typedef std::string ValueType;
4638- static const bool readable = true;
4639- static const bool writable = false;
4640- };
4641- };
4642-
4643- struct NetworkRegistration
4644- {
4645- static const std::string& name()
4646- {
4647- static const std::string s{"org.ofono.NetworkRegistration"};
4648- return s;
4649- }
4650+ struct ModemAdded
4651+ {
4652+ static const std::string& name()
4653+ {
4654+ static const std::string s{"ModemAdded"};
4655+ return s;
4656+ }
4657+
4658+ typedef Manager Interface;
4659+ typedef std::tuple<core::dbus::types::ObjectPath, std::map<std::string, std::string>> ArgumentType;
4660+ };
4661+
4662+ struct ModemRemoved
4663+ {
4664+ static const std::string& name()
4665+ {
4666+ static const std::string s{"ModemRemoved"};
4667+ return s;
4668+ }
4669+
4670+ typedef Manager Interface;
4671+ typedef core::dbus::types::ObjectPath ArgumentType;
4672+ };
4673+
4674+ struct Modem
4675+ {
4676+ static const std::string& name()
4677+ {
4678+ static const std::string s{"org.ofono.Modem"};
4679+ return s;
4680+ }
4681
4682 struct GetProperties
4683 {
4684@@ -411,7 +108,7 @@
4685 return s;
4686 }
4687
4688- typedef NetworkRegistration Interface;
4689+ typedef Modem Interface;
4690 typedef std::map<std::string, core::dbus::types::Variant> ValueType;
4691
4692 static std::chrono::milliseconds default_timeout()
4693@@ -427,229 +124,498 @@
4694 return "PropertyChanged";
4695 }
4696
4697- typedef NetworkRegistration Interface;
4698+ typedef Modem Interface;
4699
4700 typedef std::tuple<std::string, core::dbus::types::Variant> ArgumentType;
4701 };
4702
4703- struct Status
4704- {
4705- enum class Value
4706- {
4707- unregistered,
4708- registered,
4709- searching,
4710- denied,
4711- unknown,
4712- roaming
4713- };
4714-
4715- static constexpr const char* unregistered
4716- {
4717- "unregistered"
4718- };
4719- static constexpr const char* registered
4720- {
4721- "registered"
4722- };
4723- static constexpr const char* searching
4724- {
4725- "searching"
4726- };
4727- static constexpr const char* denied
4728- {
4729- "denied"
4730- };
4731- static constexpr const char* unknown
4732- {
4733- "unknown"
4734- };
4735- static constexpr const char* roaming
4736- {
4737- "roaming"
4738- };
4739-
4740- static const char* value_to_string(Value value)
4741- {
4742- switch (value)
4743- {
4744- case Value::unregistered: return unregistered;
4745- case Value::registered: return registered;
4746- case Value::searching: return searching;
4747- case Value::denied: return denied;
4748- case Value::unknown: return unknown;
4749- case Value::roaming: return roaming;
4750- }
4751-
4752- return nullptr;
4753- }
4754-
4755- static const std::string& name()
4756- {
4757- static const std::string s{"Status"};
4758- return s;
4759- }
4760-
4761- typedef NetworkRegistration Interface;
4762- typedef std::string ValueType;
4763- static const bool readable = true;
4764- static const bool writable = false;
4765- };
4766-
4767- struct LocationAreaCode
4768- {
4769- static const std::string& name()
4770- {
4771- static const std::string s{"LocationAreaCode"};
4772- return s;
4773- }
4774-
4775- typedef NetworkRegistration Interface;
4776- typedef std::uint16_t ValueType;
4777- static const bool readable = true;
4778- static const bool writable = false;
4779- };
4780-
4781- struct CellId
4782- {
4783- static const std::string& name()
4784- {
4785- static const std::string s{"CellId"};
4786- return s;
4787- }
4788-
4789- typedef NetworkRegistration Interface;
4790- typedef std::uint32_t ValueType;
4791- static const bool readable = true;
4792- static const bool writable = false;
4793- };
4794-
4795- struct MobileCountryCode
4796- {
4797- static const std::string& name()
4798- {
4799- static const std::string s{"MobileCountryCode"};
4800- return s;
4801- }
4802-
4803- typedef NetworkRegistration Interface;
4804- typedef std::string ValueType;
4805- static const bool readable = true;
4806- static const bool writable = false;
4807- };
4808-
4809- struct MobileNetworkCode
4810- {
4811- static const std::string& name()
4812- {
4813- static const std::string s{"MobileNetworkCode"};
4814- return s;
4815- }
4816-
4817- typedef NetworkRegistration Interface;
4818- typedef std::string ValueType;
4819- static const bool readable = true;
4820- static const bool writable = false;
4821- };
4822-
4823- struct Technology
4824- {
4825- static const char* gsm() { return "gsm"; }
4826- static const char* edge() { return "edge"; }
4827- static const char* umts() { return "umts"; }
4828- static const char* hspa() { return "hspa"; }
4829- static const char* lte() { return "lte"; }
4830-
4831- static const std::string& name()
4832- {
4833- static const std::string s{"Technology"};
4834- return s;
4835- }
4836-
4837- typedef NetworkRegistration Interface;
4838- typedef std::string ValueType;
4839- static const bool readable = true;
4840- static const bool writable = false;
4841- };
4842-
4843- struct Strength
4844- {
4845- static const std::string& name()
4846- {
4847- static const std::string s{"Strength"};
4848- return s;
4849- }
4850-
4851- typedef NetworkRegistration Interface;
4852- typedef std::int8_t ValueType;
4853- static const bool readable = true;
4854- static const bool writable = false;
4855- };
4856-
4857- NetworkRegistration(const std::shared_ptr<core::dbus::Object>& object)
4858- : object(object),
4859- signals
4860- {
4861- object->get_signal<PropertyChanged>()
4862- }
4863- {
4864- }
4865-
4866- // Calling this function might fail. However, we do not throw and only log
4867- // the issue for later forensics.
4868- bool refresh_properties() const
4869- {
4870- auto result = object->invoke_method_synchronously<GetProperties, GetProperties::ValueType>();
4871-
4872- if (result.is_error())
4873- {
4874- LOG(WARNING) << "Could not refresh properties for org::Ofono::Modem::NetworkRegistration: " << result.error().print();
4875- return false;
4876- }
4877-
4878- properties = result.value();
4879- return true;
4880- }
4881-
4882- template<typename Property>
4883- typename Property::ValueType get(bool refresh = true) const
4884- {
4885- if (refresh)
4886- {
4887- if (not refresh_properties())
4888+ struct Properties
4889+ {
4890+ struct Powered
4891+ {
4892+ static const std::string& name()
4893+ {
4894+ static const std::string s{"Powered"};
4895+ return s;
4896+ }
4897+
4898+ typedef Modem Interface;
4899+ typedef bool ValueType;
4900+ static const bool readable = true;
4901+ static const bool writable = true;
4902+ };
4903+
4904+ struct Online
4905+ {
4906+ static const std::string& name()
4907+ {
4908+ static const std::string s{"Online"};
4909+ return s;
4910+ }
4911+
4912+ typedef Modem Interface;
4913+ typedef bool ValueType;
4914+ static const bool readable = true;
4915+ static const bool writable = true;
4916+ };
4917+
4918+ struct Lockdown
4919+ {
4920+ static const std::string& name()
4921+ {
4922+ static const std::string s{"Lockdown"};
4923+ return s;
4924+ }
4925+
4926+ typedef Modem Interface;
4927+ typedef bool ValueType;
4928+ static const bool readable = true;
4929+ static const bool writable = true;
4930+ };
4931+
4932+ struct Name
4933+ {
4934+ static const std::string& name()
4935+ {
4936+ static const std::string s{"Name"};
4937+ return s;
4938+ }
4939+
4940+ typedef Modem Interface;
4941+ typedef std::string ValueType;
4942+ static const bool readable = true;
4943+ static const bool writable = false;
4944+ };
4945+
4946+ struct Manufacturer
4947+ {
4948+ static const std::string& name()
4949+ {
4950+ static const std::string s{"Manufacturer"};
4951+ return s;
4952+ }
4953+
4954+ typedef Modem Interface;
4955+ typedef std::string ValueType;
4956+ static const bool readable = true;
4957+ static const bool writable = false;
4958+ };
4959+
4960+ struct Model
4961+ {
4962+ static const std::string& name()
4963+ {
4964+ static const std::string s{"Model"};
4965+ return s;
4966+ }
4967+
4968+ typedef Modem Interface;
4969+ typedef std::string ValueType;
4970+ static const bool readable = true;
4971+ static const bool writable = false;
4972+ };
4973+
4974+ struct Revision
4975+ {
4976+ static const std::string& name()
4977+ {
4978+ static const std::string s{"Revision"};
4979+ return s;
4980+ }
4981+
4982+ typedef Modem Interface;
4983+ typedef std::string ValueType;
4984+ static const bool readable = true;
4985+ static const bool writable = false;
4986+ };
4987+
4988+ struct Serial
4989+ {
4990+ static const std::string& name()
4991+ {
4992+ static const std::string s{"Serial"};
4993+ return s;
4994+ }
4995+
4996+ typedef Modem Interface;
4997+ typedef std::string ValueType;
4998+ static const bool readable = true;
4999+ static const bool writable = false;
5000+ };
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches