Merge lp:~unity-api-team/indicator-network/port-to-qdbus-14.09 into lp:indicator-network/14.09
- port-to-qdbus-14.09
- Merge into trunk.14.09
Proposed by
Pete Woods
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Pete Woods | ||||||||||||
Approved revision: | 475 | ||||||||||||
Merged at revision: | 473 | ||||||||||||
Proposed branch: | lp:~unity-api-team/indicator-network/port-to-qdbus-14.09 | ||||||||||||
Merge into: | lp:indicator-network/14.09 | ||||||||||||
Diff against target: |
24141 lines (+12119/-8529) 143 files modified
CMakeLists.txt (+8/-15) cmake/FindGObjectIntrospection.cmake (+0/-61) cmake/FindValgrind.cmake (+13/-13) cmake/UseGObjectIntrospection.cmake (+0/-100) data/com.ubuntu.connectivity1.NetworkingStatus.xml (+11/-0) data/com.ubuntu.connectivity1.Private.xml (+15/-0) data/nm-access-point.xml (+93/-0) data/nm-active-connection.xml (+145/-0) data/nm-device-wifi.xml (+132/-0) data/nm-device.xml (+598/-0) data/nm-manager.xml (+412/-0) data/nm-settings-connection.xml (+157/-0) data/org.freedesktop.URfkill.Device.xml (+143/-0) data/org.freedesktop.URfkill.Killswitch.xml (+78/-0) data/org.freedesktop.URfkill.xml (+388/-0) debian/control (+6/-8) sniffer/CMakeLists.txt (+36/-0) sniffer/eventprinter.h (+70/-0) sniffer/i-n-extractor.cpp (+152/-0) src/CMakeLists.txt (+3/-2) src/connectivity-cpp/CMakeLists.txt (+6/-16) src/connectivity-cpp/dbus-cpp/services/nm.h (+0/-979) src/connectivity-cpp/dbus-cpp/services/ofono.h (+0/-339) src/connectivity-cpp/dbus-cpp/services/urfkill.h (+0/-338) src/connectivity-cpp/dbus-cpp/services/util.h (+0/-36) src/connectivity-cpp/include/connectivity/networking/service.h (+0/-83) src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h (+0/-59) src/connectivity-cpp/include/connectivity/networking/service/tor/service.h (+0/-46) src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h (+0/-49) src/connectivity-cpp/src/CMakeLists.txt (+24/-5) src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt (+0/-42) src/connectivity-cpp/src/platform/nmofono/bounded_integer.h (+0/-178) src/connectivity-cpp/src/platform/nmofono/manager_ref.h (+0/-483) src/connectivity-cpp/src/platform/nmofono/ofono_nm_connectivity_manager.cpp (+0/-338) src/connectivity-cpp/src/platform/nmofono/service.cpp (+0/-18) src/connectivity-cpp/src/platform/nmofono/service.h (+0/-47) src/connectivity-cpp/src/platform/nmofono/set_name_for_thread.cpp (+0/-24) src/connectivity-cpp/src/platform/nmofono/set_name_for_thread.h (+0/-28) src/connectivity-cpp/src/platform/util.cpp (+0/-33) src/dbus-cpp/CMakeLists.txt (+0/-1) src/dbus-cpp/services/ofono.h (+0/-1574) src/indicator/CMakeLists.txt (+97/-28) src/indicator/connectivity-service/connectivity-service.cpp (+155/-337) src/indicator/connectivity-service/connectivity-service.h (+55/-19) src/indicator/factory.cpp (+129/-0) src/indicator/factory.h (+67/-0) src/indicator/indicator-menu.cpp (+99/-0) src/indicator/indicator-menu.h (+14/-63) src/indicator/main.cpp (+27/-69) src/indicator/menu-builder.cpp (+143/-0) src/indicator/menu-builder.h (+19/-154) src/indicator/menuitems/access-point-item.cpp (+15/-44) src/indicator/menuitems/access-point-item.h (+6/-2) src/indicator/menuitems/item.h (+2/-1) src/indicator/menuitems/modem-info-item.cpp (+23/-33) src/indicator/menuitems/modem-info-item.h (+11/-9) src/indicator/menuitems/switch-item.cpp (+75/-0) src/indicator/menuitems/switch-item.h (+22/-50) src/indicator/menuitems/text-item.cpp (+42/-0) src/indicator/menuitems/text-item.h (+7/-27) src/indicator/menuitems/wifi-link-item.cpp (+14/-30) src/indicator/menuitems/wifi-link-item.h (+1/-1) src/indicator/menuitems/wwan-link-item.cpp (+38/-42) src/indicator/modem-manager.cpp (+97/-175) src/indicator/modem-manager.h (+15/-9) src/indicator/modem.cpp (+527/-282) src/indicator/modem.h (+110/-74) src/indicator/nmofono/kill-switch-impl.cpp (+90/-46) src/indicator/nmofono/kill-switch-impl.h (+23/-13) src/indicator/nmofono/link.h (+15/-5) src/indicator/nmofono/manager-impl.cpp (+186/-193) src/indicator/nmofono/manager-impl.h (+19/-20) src/indicator/nmofono/manager.cpp (+1/-18) src/indicator/nmofono/manager.h (+37/-36) src/indicator/nmofono/wifi/access-point-impl.cpp (+50/-32) src/indicator/nmofono/wifi/access-point-impl.h (+24/-22) src/indicator/nmofono/wifi/access-point.cpp (+36/-0) src/indicator/nmofono/wifi/access-point.h (+16/-6) src/indicator/nmofono/wifi/grouped-access-point-impl.cpp (+67/-81) src/indicator/nmofono/wifi/grouped-access-point-impl.h (+14/-16) src/indicator/nmofono/wifi/wifi-link-impl.cpp (+346/-325) src/indicator/nmofono/wifi/wifi-link-impl.h (+25/-31) src/indicator/nmofono/wifi/wifi-link.h (+14/-6) src/indicator/root-state.cpp (+93/-90) src/indicator/root-state.h (+10/-4) src/indicator/sections/quick-access-section.cpp (+58/-55) src/indicator/sections/quick-access-section.h (+4/-3) src/indicator/sections/wifi-section.cpp (+51/-54) src/indicator/sections/wifi-section.h (+4/-2) src/indicator/sections/wwan-section.cpp (+24/-23) src/indicator/sections/wwan-section.h (+1/-1) src/indicator/sim-unlock-dialog.cpp (+163/-144) src/indicator/sim-unlock-dialog.h (+16/-5) src/indicator/util/unix-signal-handler.cpp (+101/-0) src/indicator/util/unix-signal-handler.h (+59/-0) src/menumodel-cpp/CMakeLists.txt (+6/-0) src/menumodel-cpp/action-group-exporter.cpp (+128/-0) src/menumodel-cpp/action-group-exporter.h (+17/-51) src/menumodel-cpp/action-group-merger.cpp (+108/-0) src/menumodel-cpp/action-group-merger.h (+18/-101) src/menumodel-cpp/action-group.cpp (+59/-0) src/menumodel-cpp/action-group.h (+22/-59) src/menumodel-cpp/action.cpp (+31/-39) src/menumodel-cpp/action.h (+15/-13) src/menumodel-cpp/gio-helpers/util.cpp (+19/-37) src/menumodel-cpp/gio-helpers/util.h (+4/-50) src/menumodel-cpp/gio-helpers/variant.h (+21/-2) src/menumodel-cpp/menu-exporter.h (+1/-0) src/menumodel-cpp/menu-item.cpp (+119/-0) src/menumodel-cpp/menu-item.h (+25/-107) src/menumodel-cpp/menu-merger.h (+9/-12) src/menumodel-cpp/menu-model.h (+4/-1) src/menumodel-cpp/menu.cpp (+170/-0) src/menumodel-cpp/menu.h (+24/-160) src/notify-cpp/notification.cpp (+92/-58) src/notify-cpp/notification.h (+39/-17) src/notify-cpp/snapdecision/sim-unlock.cpp (+122/-85) src/notify-cpp/snapdecision/sim-unlock.h (+45/-23) src/qdbus-stubs/CMakeLists.txt (+115/-0) src/qdbus-stubs/DBusTypes.h (+51/-0) src/qdbus-stubs/backend-utils.h (+42/-0) src/secret-agent/CMakeLists.txt (+0/-1) tests/CMakeLists.txt (+1/-0) tests/autopilot/indicator_network/data/pin-unlock.xml (+3/-3) tests/data/phonesim/pin-unlock.xml (+3/-3) tests/integration/CMakeLists.txt (+2/-35) tests/integration/indicator/CMakeLists.txt (+34/-0) tests/integration/indicator/TestIndicatorNetworkService.cpp (+3258/-23) tests/menuharness/CMakeLists.txt (+15/-0) tests/menuharness/MatchResult.cpp (+179/-0) tests/menuharness/MatchResult.h (+61/-0) tests/menuharness/MatchUtils.cpp (+72/-0) tests/menuharness/MatchUtils.h (+35/-0) tests/menuharness/MenuItemMatcher.cpp (+837/-0) tests/menuharness/MenuItemMatcher.h (+122/-0) tests/menuharness/MenuMatcher.cpp (+201/-0) tests/menuharness/MenuMatcher.h (+90/-0) tests/unit/CMakeLists.txt (+5/-1) tests/unit/indicator/menuitems/CMakeLists.txt (+1/-4) tests/unit/indicator/menuitems/test-access-point-item.cpp (+6/-11) tests/unit/menumodel-cpp/test-menu-exporter.cpp (+11/-23) tests/unit/secret-agent/CMakeLists.txt (+0/-1) tests/utils/main.cpp (+30/-14) |
||||||||||||
To merge this branch: | bzr merge lp:~unity-api-team/indicator-network/port-to-qdbus-14.09 | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Indicator Applet Developers | Pending | ||
Review via email: mp+254772@code.launchpad.net |
Commit message
Port all dbus interactions to QDBus
Description of the change
Port all dbus interactions to QDBus
To post a comment you must log in.
- 474. By Pete Woods
-
Insert the WifiLinkItem before the settings item
- 475. By Pete Woods
-
Cleanup
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 2015-02-16 18:34:37 +0000 | |||
3 | +++ CMakeLists.txt 2015-04-01 15:30:55 +0000 | |||
4 | @@ -18,6 +18,10 @@ | |||
5 | 18 | add_definitions(-DINDICATOR_NETWORK_TRACE_MESSAGES) | 18 | add_definitions(-DINDICATOR_NETWORK_TRACE_MESSAGES) |
6 | 19 | endif() | 19 | endif() |
7 | 20 | 20 | ||
8 | 21 | add_definitions( | ||
9 | 22 | -DQT_NO_KEYWORDS=1 | ||
10 | 23 | ) | ||
11 | 24 | |||
12 | 21 | find_package(PkgConfig REQUIRED) | 25 | find_package(PkgConfig REQUIRED) |
13 | 22 | include(EnableCoverageReport) | 26 | include(EnableCoverageReport) |
14 | 23 | include(GNUInstallDirs) | 27 | include(GNUInstallDirs) |
15 | @@ -44,14 +48,6 @@ | |||
16 | 44 | ) | 48 | ) |
17 | 45 | include_directories(${GLIB_INCLUDE_DIRS}) | 49 | include_directories(${GLIB_INCLUDE_DIRS}) |
18 | 46 | 50 | ||
19 | 47 | set(NM_REQUIRED_VERSION 0.9) | ||
20 | 48 | pkg_check_modules( | ||
21 | 49 | NM REQUIRED | ||
22 | 50 | libnm-glib>=${NM_REQUIRED_VERSION} | ||
23 | 51 | libnm-util>=${NM_REQUIRED_VERSION} | ||
24 | 52 | ) | ||
25 | 53 | include_directories(${NM_INCLUDE_DIRS}) | ||
26 | 54 | |||
27 | 55 | set(OFONO_REQUIRED_VERSION 1.12) | 51 | set(OFONO_REQUIRED_VERSION 1.12) |
28 | 56 | pkg_check_modules( | 52 | pkg_check_modules( |
29 | 57 | OFONO REQUIRED | 53 | OFONO REQUIRED |
30 | @@ -85,16 +81,12 @@ | |||
31 | 85 | pkg_check_modules(QTDBUSMOCK REQUIRED libqtdbusmock-1 REQUIRED) | 81 | pkg_check_modules(QTDBUSMOCK REQUIRED libqtdbusmock-1 REQUIRED) |
32 | 86 | include_directories(${QTDBUSMOCK_INCLUDE_DIRS}) | 82 | include_directories(${QTDBUSMOCK_INCLUDE_DIRS}) |
33 | 87 | 83 | ||
34 | 88 | pkg_check_modules(QMENUMODEL REQUIRED qmenumodel REQUIRED) | ||
35 | 89 | include_directories(${QMENUMODEL_INCLUDE_DIRS}) | ||
36 | 90 | |||
37 | 91 | pkg_check_modules(GIO REQUIRED gio-2.0>=${GLIB_REQUIRED_VERSION}) | 84 | pkg_check_modules(GIO REQUIRED gio-2.0>=${GLIB_REQUIRED_VERSION}) |
38 | 92 | include_directories(${GIO_INCLUDE_DIRS}) | 85 | include_directories(${GIO_INCLUDE_DIRS}) |
39 | 93 | 86 | ||
40 | 87 | set(CMAKE_AUTOMOC ON) | ||
41 | 94 | set(CMAKE_INCLUDE_CURRENT_DIR ON) | 88 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
42 | 95 | 89 | ||
43 | 96 | find_package(GObjectIntrospection 0.9.12) | ||
44 | 97 | |||
45 | 98 | include_directories(${CMAKE_BINARY_DIR}) | 90 | include_directories(${CMAKE_BINARY_DIR}) |
46 | 99 | 91 | ||
47 | 100 | set(COMMON_FLAGS "-Wall -Wextra -Wpedantic -fno-permissive -fPIC -fvisibility=hidden -pthread") | 92 | set(COMMON_FLAGS "-Wall -Wextra -Wpedantic -fno-permissive -fPIC -fvisibility=hidden -pthread") |
48 | @@ -102,7 +94,7 @@ | |||
49 | 102 | # "nice bug" in cmake... http://www.cmake.org/Bug/view.php?id=15058 | 94 | # "nice bug" in cmake... http://www.cmake.org/Bug/view.php?id=15058 |
50 | 103 | # let's not set C_FLAGS as it will break pthreads detection \o/ | 95 | # let's not set C_FLAGS as it will break pthreads detection \o/ |
51 | 104 | #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${COMMON_FLAGS}") | 96 | #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${COMMON_FLAGS}") |
53 | 105 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${COMMON_FLAGS} -fno-strict-aliasing -fvisibility-inlines-hidden") | 97 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 ${COMMON_FLAGS} -fno-strict-aliasing -fvisibility-inlines-hidden") |
54 | 106 | 98 | ||
55 | 107 | configure_file( | 99 | configure_file( |
56 | 108 | "config.h.in" | 100 | "config.h.in" |
57 | @@ -136,5 +128,6 @@ | |||
58 | 136 | ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure | 128 | ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure |
59 | 137 | ) | 129 | ) |
60 | 138 | 130 | ||
62 | 139 | enable_coverage_report(TARGETS menumodel_cpp connectivity-cpp indicator-secret-agent | 131 | #///! TODO: The following needs to be updated once this project takes form again and new unit tests are written |
63 | 132 | enable_coverage_report(TARGETS menumodel_cpp indicator-secret-agent | ||
64 | 140 | FILTER ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) | 133 | FILTER ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) |
65 | 141 | 134 | ||
66 | === removed file 'cmake/FindGObjectIntrospection.cmake' | |||
67 | --- cmake/FindGObjectIntrospection.cmake 2013-08-27 13:48:41 +0000 | |||
68 | +++ cmake/FindGObjectIntrospection.cmake 1970-01-01 00:00:00 +0000 | |||
69 | @@ -1,61 +0,0 @@ | |||
70 | 1 | # - try to find gobject-introspection | ||
71 | 2 | # | ||
72 | 3 | # Once done this will define | ||
73 | 4 | # | ||
74 | 5 | # INTROSPECTION_FOUND - system has gobject-introspection | ||
75 | 6 | # INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner | ||
76 | 7 | # INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler | ||
77 | 8 | # INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate | ||
78 | 9 | # INTROSPECTION_GIRDIR | ||
79 | 10 | # INTROSPECTION_TYPELIBDIR | ||
80 | 11 | # INTROSPECTION_CFLAGS | ||
81 | 12 | # INTROSPECTION_LIBS | ||
82 | 13 | # | ||
83 | 14 | # Copyright (C) 2010, Pino Toscano, <pino@kde.org> | ||
84 | 15 | # | ||
85 | 16 | # Redistribution and use is allowed according to the terms of the BSD license. | ||
86 | 17 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
87 | 18 | |||
88 | 19 | macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname) | ||
89 | 20 | execute_process( | ||
90 | 21 | COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0 | ||
91 | 22 | OUTPUT_VARIABLE _result | ||
92 | 23 | RESULT_VARIABLE _null | ||
93 | 24 | ) | ||
94 | 25 | |||
95 | 26 | if (_null) | ||
96 | 27 | else() | ||
97 | 28 | string(REGEX REPLACE "[\r\n]" " " _result "${_result}") | ||
98 | 29 | string(REGEX REPLACE " +$" "" _result "${_result}") | ||
99 | 30 | separate_arguments(_result) | ||
100 | 31 | set(${_outvar} ${_result} CACHE INTERNAL "") | ||
101 | 32 | endif() | ||
102 | 33 | endmacro(_GIR_GET_PKGCONFIG_VAR) | ||
103 | 34 | |||
104 | 35 | find_package(PkgConfig) | ||
105 | 36 | if(PKG_CONFIG_FOUND) | ||
106 | 37 | if(PACKAGE_FIND_VERSION_COUNT GREATER 0) | ||
107 | 38 | set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") | ||
108 | 39 | endif() | ||
109 | 40 | pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) | ||
110 | 41 | if(_pc_gir_FOUND) | ||
111 | 42 | set(INTROSPECTION_FOUND TRUE) | ||
112 | 43 | _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner") | ||
113 | 44 | _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler") | ||
114 | 45 | _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate") | ||
115 | 46 | _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir") | ||
116 | 47 | _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir") | ||
117 | 48 | set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}") | ||
118 | 49 | set(INTROSPECTION_LIBS "${_pc_gir_LIBS}") | ||
119 | 50 | endif() | ||
120 | 51 | endif() | ||
121 | 52 | |||
122 | 53 | mark_as_advanced( | ||
123 | 54 | INTROSPECTION_SCANNER | ||
124 | 55 | INTROSPECTION_COMPILER | ||
125 | 56 | INTROSPECTION_GENERATE | ||
126 | 57 | INTROSPECTION_GIRDIR | ||
127 | 58 | INTROSPECTION_TYPELIBDIR | ||
128 | 59 | INTROSPECTION_CFLAGS | ||
129 | 60 | INTROSPECTION_LIBS | ||
130 | 61 | ) | ||
131 | 62 | 0 | ||
132 | === modified file 'cmake/FindValgrind.cmake' | |||
133 | --- cmake/FindValgrind.cmake 2013-09-17 13:43:54 +0000 | |||
134 | +++ cmake/FindValgrind.cmake 2015-04-01 15:30:55 +0000 | |||
135 | @@ -14,10 +14,7 @@ | |||
136 | 14 | set(VALGRIND_PROGRAM_OPTIONS | 14 | set(VALGRIND_PROGRAM_OPTIONS |
137 | 15 | "--suppressions=${CMAKE_SOURCE_DIR}/tests/data/valgrind.suppression" | 15 | "--suppressions=${CMAKE_SOURCE_DIR}/tests/data/valgrind.suppression" |
138 | 16 | "--error-exitcode=1" | 16 | "--error-exitcode=1" |
139 | 17 | "--trace-children=yes" | ||
140 | 18 | "--trace-children-skip=*/python*,python*" | ||
141 | 19 | "--leak-check=full" | 17 | "--leak-check=full" |
142 | 20 | "--leak-resolution=high" | ||
143 | 21 | "--gen-suppressions=all" | 18 | "--gen-suppressions=all" |
144 | 22 | "--quiet" | 19 | "--quiet" |
145 | 23 | ) | 20 | ) |
146 | @@ -28,14 +25,17 @@ | |||
147 | 28 | VALGRIND_PROGRAM | 25 | VALGRIND_PROGRAM |
148 | 29 | ) | 26 | ) |
149 | 30 | 27 | ||
160 | 31 | function(add_valgrind_test NAME EXECUTABLE) | 28 | function(add_valgrind_test) |
161 | 32 | if(ENABLE_MEMCHECK_OPTION) | 29 | foreach(_arg ${ARGN}) |
162 | 33 | add_test(${NAME} ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS} "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}") | 30 | if ("VALGRIND" STREQUAL ${_arg}) |
163 | 34 | set_tests_properties( | 31 | if(ENABLE_MEMCHECK_OPTION AND VALGRIND_PROGRAM) |
164 | 35 | ${NAME} | 32 | list(APPEND _vgargs ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS}) |
165 | 36 | PROPERTIES ENVIRONMENT "G_SLICE=always-malloc G_DEBUG=gc-friendly" | 33 | endif() |
166 | 37 | ) | 34 | else() |
167 | 38 | else() | 35 | list(APPEND _vgargs ${_arg}) |
168 | 39 | add_test(${NAME} ${EXECUTABLE}) | 36 | endif() |
169 | 40 | endif() | 37 | endforeach() |
170 | 38 | |||
171 | 39 | add_test(${_vgargs}) | ||
172 | 41 | endfunction() | 40 | endfunction() |
173 | 41 | |||
174 | 42 | 42 | ||
175 | === removed file 'cmake/UseGObjectIntrospection.cmake' | |||
176 | --- cmake/UseGObjectIntrospection.cmake 2013-08-27 13:48:41 +0000 | |||
177 | +++ cmake/UseGObjectIntrospection.cmake 1970-01-01 00:00:00 +0000 | |||
178 | @@ -1,100 +0,0 @@ | |||
179 | 1 | # Copyright (C) 2010, Pino Toscano, <pino@kde.org> | ||
180 | 2 | # | ||
181 | 3 | # Redistribution and use is allowed according to the terms of the BSD license. | ||
182 | 4 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
183 | 5 | |||
184 | 6 | include(ListOperations) | ||
185 | 7 | |||
186 | 8 | macro(_gir_list_prefix _outvar _listvar _prefix) | ||
187 | 9 | set(${_outvar}) | ||
188 | 10 | foreach(_item IN LISTS ${_listvar}) | ||
189 | 11 | list(APPEND ${_outvar} ${_prefix}${_item}) | ||
190 | 12 | endforeach() | ||
191 | 13 | endmacro(_gir_list_prefix) | ||
192 | 14 | |||
193 | 15 | macro(gir_add_introspections introspections_girs) | ||
194 | 16 | |||
195 | 17 | foreach(gir IN LISTS ${introspections_girs}) | ||
196 | 18 | |||
197 | 19 | set(_gir_name "${gir}") | ||
198 | 20 | |||
199 | 21 | ## Transform the gir filename to something which can reference through a variable | ||
200 | 22 | ## without automake/make complaining, eg Gtk-2.0.gir -> Gtk_2_0_gir | ||
201 | 23 | string(REPLACE "-" "_" _gir_name "${_gir_name}") | ||
202 | 24 | string(REPLACE "." "_" _gir_name "${_gir_name}") | ||
203 | 25 | |||
204 | 26 | # Namespace and Version is either fetched from the gir filename | ||
205 | 27 | # or the _NAMESPACE/_VERSION variable combo | ||
206 | 28 | set(_gir_namespace "${${_gir_name}_NAMESPACE}") | ||
207 | 29 | if (_gir_namespace STREQUAL "") | ||
208 | 30 | string(REGEX REPLACE "([^-]+)-.*" "\\1" _gir_namespace "${gir}") | ||
209 | 31 | endif () | ||
210 | 32 | set(_gir_version "${${_gir_name}_VERSION}") | ||
211 | 33 | if (_gir_version STREQUAL "") | ||
212 | 34 | string(REGEX REPLACE ".*-([^-]+).gir" "\\1" _gir_version "${gir}") | ||
213 | 35 | endif () | ||
214 | 36 | |||
215 | 37 | # _PROGRAM is an optional variable which needs it's own --program argument | ||
216 | 38 | set(_gir_program "${${_gir_name}_PROGRAM}") | ||
217 | 39 | if (NOT _gir_program STREQUAL "") | ||
218 | 40 | set(_gir_program "--program=${_gir_program}") | ||
219 | 41 | endif () | ||
220 | 42 | |||
221 | 43 | # Variables which provides a list of things | ||
222 | 44 | _gir_list_prefix(_gir_libraries ${_gir_name}_LIBS "--library=") | ||
223 | 45 | _gir_list_prefix(_gir_packages ${_gir_name}_PACKAGES "--pkg=") | ||
224 | 46 | _gir_list_prefix(_gir_includes ${_gir_name}_INCLUDES "--include=") | ||
225 | 47 | _gir_list_prefix(_gir_export_packages ${_gir_name}_EXPORT_PACKAGES "--pkg-export=") | ||
226 | 48 | |||
227 | 49 | # Reuse the LIBTOOL variable from by automake if it's set | ||
228 | 50 | set(_gir_libtool "--no-libtool") | ||
229 | 51 | |||
230 | 52 | add_custom_command( | ||
231 | 53 | COMMAND ${INTROSPECTION_SCANNER} | ||
232 | 54 | ${INTROSPECTION_SCANNER_ARGS} | ||
233 | 55 | --namespace=${_gir_namespace} | ||
234 | 56 | --nsversion=${_gir_version} | ||
235 | 57 | ${_gir_libtool} | ||
236 | 58 | ${_gir_program} | ||
237 | 59 | ${_gir_libraries} | ||
238 | 60 | ${_gir_packages} | ||
239 | 61 | ${_gir_includes} | ||
240 | 62 | ${_gir_export_packages} | ||
241 | 63 | ${${_gir_name}_SCANNERFLAGS} | ||
242 | 64 | ${${_gir_name}_CFLAGS} | ||
243 | 65 | ${${_gir_name}_FILES} | ||
244 | 66 | --output ${CMAKE_CURRENT_BINARY_DIR}/${gir} | ||
245 | 67 | DEPENDS ${${_gir_name}_FILES} | ||
246 | 68 | ${${_gir_name}_LIBS} | ||
247 | 69 | OUTPUT ${gir} | ||
248 | 70 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
249 | 71 | VERBATIM | ||
250 | 72 | ) | ||
251 | 73 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${gir} DESTINATION share/gir-1.0) | ||
252 | 74 | |||
253 | 75 | string(REPLACE ".gir" ".typelib" _typelib "${gir}") | ||
254 | 76 | add_custom_command( | ||
255 | 77 | COMMAND ${INTROSPECTION_COMPILER} | ||
256 | 78 | ${INTROSPECTION_COMPILER_ARGS} | ||
257 | 79 | --includedir=. | ||
258 | 80 | ${CMAKE_CURRENT_BINARY_DIR}/${gir} | ||
259 | 81 | -o ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} | ||
260 | 82 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir} | ||
261 | 83 | OUTPUT ${_typelib} | ||
262 | 84 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
263 | 85 | ) | ||
264 | 86 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/girepository-1.0) | ||
265 | 87 | |||
266 | 88 | add_custom_target(gir-${gir} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir}) | ||
267 | 89 | add_custom_target(gir-typelibs-${_typelib} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_typelib}) | ||
268 | 90 | endforeach() | ||
269 | 91 | |||
270 | 92 | endmacro(gir_add_introspections) | ||
271 | 93 | |||
272 | 94 | macro(gir_get_cflags _output) | ||
273 | 95 | get_directory_property(_tmp_includes INCLUDE_DIRECTORIES) | ||
274 | 96 | list_prefix(_includes _tmp_includes "-I") | ||
275 | 97 | get_directory_property(_tmp_compile_definitions COMPILE_DEFINITIONS) | ||
276 | 98 | list_prefix(_compile_definitions _tmp_compile_definitions "-D") | ||
277 | 99 | set(${_output} ${_includes} ${_compile_definitions}) | ||
278 | 100 | endmacro(gir_get_cflags) | ||
279 | 101 | 0 | ||
280 | === added file 'data/com.ubuntu.connectivity1.NetworkingStatus.xml' | |||
281 | --- data/com.ubuntu.connectivity1.NetworkingStatus.xml 1970-01-01 00:00:00 +0000 | |||
282 | +++ data/com.ubuntu.connectivity1.NetworkingStatus.xml 2015-04-01 15:30:55 +0000 | |||
283 | @@ -0,0 +1,11 @@ | |||
284 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
285 | 2 | |||
286 | 3 | <node name="/com/ubuntu/connectivity1/NetworkingStatus" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
287 | 4 | <interface name="com.ubuntu.connectivity1.NetworkingStatus"> | ||
288 | 5 | |||
289 | 6 | <property name="Limitations" type="as" access="read"/> | ||
290 | 7 | <property name="Status" type="s" access="read"/> | ||
291 | 8 | |||
292 | 9 | </interface> | ||
293 | 10 | </node> | ||
294 | 11 | |||
295 | 0 | 12 | ||
296 | === added file 'data/com.ubuntu.connectivity1.Private.xml' | |||
297 | --- data/com.ubuntu.connectivity1.Private.xml 1970-01-01 00:00:00 +0000 | |||
298 | +++ data/com.ubuntu.connectivity1.Private.xml 2015-04-01 15:30:55 +0000 | |||
299 | @@ -0,0 +1,15 @@ | |||
300 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
301 | 2 | |||
302 | 3 | <node name="/com/ubuntu/connectivity1/Private" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
303 | 4 | <interface name="com.ubuntu.connectivity1.Private"> | ||
304 | 5 | |||
305 | 6 | <method name="UnlockAllModems"> | ||
306 | 7 | </method> | ||
307 | 8 | |||
308 | 9 | <method name="UnlockModem"> | ||
309 | 10 | <arg type="s" direction="in" name="modem"/> | ||
310 | 11 | </method> | ||
311 | 12 | |||
312 | 13 | </interface> | ||
313 | 14 | </node> | ||
314 | 15 | |||
315 | 0 | 16 | ||
316 | === added file 'data/nm-access-point.xml' | |||
317 | --- data/nm-access-point.xml 1970-01-01 00:00:00 +0000 | |||
318 | +++ data/nm-access-point.xml 2015-04-01 15:30:55 +0000 | |||
319 | @@ -0,0 +1,93 @@ | |||
320 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
321 | 2 | |||
322 | 3 | <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
323 | 4 | <interface name="org.freedesktop.NetworkManager.AccessPoint"> | ||
324 | 5 | <property name="Flags" type="u" access="read" tp:type="NM_802_11_AP_FLAGS"> | ||
325 | 6 | <tp:docstring>Flags describing the capabilities of the access point.</tp:docstring> | ||
326 | 7 | </property> | ||
327 | 8 | <property name="WpaFlags" type="u" access="read" tp:type="NM_802_11_AP_SEC"> | ||
328 | 9 | <tp:docstring>Flags describing the access point's capabilities according to WPA (Wifi Protected Access).</tp:docstring> | ||
329 | 10 | </property> | ||
330 | 11 | <property name="RsnFlags" type="u" access="read" tp:type="NM_802_11_AP_SEC"> | ||
331 | 12 | <tp:docstring>Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol.</tp:docstring> | ||
332 | 13 | </property> | ||
333 | 14 | <property name="Ssid" type="ay" access="read"> | ||
334 | 15 | <tp:docstring>The Service Set Identifier identifying the access point.</tp:docstring> | ||
335 | 16 | </property> | ||
336 | 17 | <property name="Frequency" type="u" access="read"> | ||
337 | 18 | <tp:docstring>The radio channel frequency in use by the access point, in MHz.</tp:docstring> | ||
338 | 19 | </property> | ||
339 | 20 | <property name="HwAddress" type="s" access="read"> | ||
340 | 21 | <tp:docstring>The hardware address (BSSID) of the access point.</tp:docstring> | ||
341 | 22 | </property> | ||
342 | 23 | |||
343 | 24 | <property name="Mode" type="u" access="read" tp:type="NM_802_11_MODE"> | ||
344 | 25 | <tp:docstring>Describes the operating mode of the access point.</tp:docstring> | ||
345 | 26 | </property> | ||
346 | 27 | <property name="MaxBitrate" type="u" access="read"> | ||
347 | 28 | <tp:docstring>The maximum bitrate this access point is capable of, in kilobits/second (Kb/s).</tp:docstring> | ||
348 | 29 | </property> | ||
349 | 30 | <property name="Strength" type="y" access="read"> | ||
350 | 31 | <tp:docstring>The current signal quality of the access point, in percent.</tp:docstring> | ||
351 | 32 | </property> | ||
352 | 33 | |||
353 | 34 | <signal name="PropertiesChanged"> | ||
354 | 35 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
355 | 36 | <arg name="properties" type="a{sv}" tp:type="String_Variant_Map"> | ||
356 | 37 | <tp:docstring> | ||
357 | 38 | A dictionary mapping property names to variant boxed values | ||
358 | 39 | </tp:docstring> | ||
359 | 40 | </arg> | ||
360 | 41 | </signal> | ||
361 | 42 | <tp:flags name="NM_802_11_AP_FLAGS" value-prefix="NM_802_11_AP_FLAGS" type="u"> | ||
362 | 43 | <tp:docstring> | ||
363 | 44 | Flags describing the general capabilities of the access point. | ||
364 | 45 | </tp:docstring> | ||
365 | 46 | <tp:flag suffix="NONE" value="0x0"> | ||
366 | 47 | <tp:docstring>Null capability - says nothing about the access point.</tp:docstring> | ||
367 | 48 | </tp:flag> | ||
368 | 49 | <tp:flag suffix="PRIVACY" value="0x1"> | ||
369 | 50 | <tp:docstring>Access point supports privacy measures.</tp:docstring> | ||
370 | 51 | </tp:flag> | ||
371 | 52 | </tp:flags> | ||
372 | 53 | <tp:flags name="NM_802_11_AP_SEC" value-prefix="NM_802_11_AP_SEC" type="u"> | ||
373 | 54 | <tp:docstring> | ||
374 | 55 | Flags describing the security capabilities of the access point. | ||
375 | 56 | </tp:docstring> | ||
376 | 57 | <tp:flag suffix="NONE" value="0x0"> | ||
377 | 58 | <tp:docstring>Null flag.</tp:docstring> | ||
378 | 59 | </tp:flag> | ||
379 | 60 | <tp:flag suffix="PAIR_WEP40" value="0x1"> | ||
380 | 61 | <tp:docstring>Access point supports pairwise 40-bit WEP encryption.</tp:docstring> | ||
381 | 62 | </tp:flag> | ||
382 | 63 | <tp:flag suffix="PAIR_WEP104" value="0x2"> | ||
383 | 64 | <tp:docstring>Access point supports pairwise 104-bit WEP encryption.</tp:docstring> | ||
384 | 65 | </tp:flag> | ||
385 | 66 | <tp:flag suffix="PAIR_TKIP" value="0x4"> | ||
386 | 67 | <tp:docstring>Access point supports pairwise TKIP encryption.</tp:docstring> | ||
387 | 68 | </tp:flag> | ||
388 | 69 | <tp:flag suffix="PAIR_CCMP" value="0x8"> | ||
389 | 70 | <tp:docstring>Access point supports pairwise CCMP encryption.</tp:docstring> | ||
390 | 71 | </tp:flag> | ||
391 | 72 | <tp:flag suffix="GROUP_WEP40" value="0x10"> | ||
392 | 73 | <tp:docstring>Access point supports a group 40-bit WEP cipher.</tp:docstring> | ||
393 | 74 | </tp:flag> | ||
394 | 75 | <tp:flag suffix="GROUP_WEP104" value="0x20"> | ||
395 | 76 | <tp:docstring>Access point supports a group 104-bit WEP cipher.</tp:docstring> | ||
396 | 77 | </tp:flag> | ||
397 | 78 | <tp:flag suffix="GROUP_TKIP" value="0x40"> | ||
398 | 79 | <tp:docstring>Access point supports a group TKIP cipher.</tp:docstring> | ||
399 | 80 | </tp:flag> | ||
400 | 81 | <tp:flag suffix="GROUP_CCMP" value="0x80"> | ||
401 | 82 | <tp:docstring>Access point supports a group CCMP cipher.</tp:docstring> | ||
402 | 83 | </tp:flag> | ||
403 | 84 | <tp:flag suffix="KEY_MGMT_PSK" value="0x100"> | ||
404 | 85 | <tp:docstring>Access point supports PSK key management.</tp:docstring> | ||
405 | 86 | </tp:flag> | ||
406 | 87 | <tp:flag suffix="KEY_MGMT_802_1X" value="0x200"> | ||
407 | 88 | <tp:docstring>Access point supports 802.1x key management.</tp:docstring> | ||
408 | 89 | </tp:flag> | ||
409 | 90 | </tp:flags> | ||
410 | 91 | </interface> | ||
411 | 92 | </node> | ||
412 | 93 | |||
413 | 0 | 94 | ||
414 | === added file 'data/nm-active-connection.xml' | |||
415 | --- data/nm-active-connection.xml 1970-01-01 00:00:00 +0000 | |||
416 | +++ data/nm-active-connection.xml 2015-04-01 15:30:55 +0000 | |||
417 | @@ -0,0 +1,145 @@ | |||
418 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
419 | 2 | |||
420 | 3 | <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
421 | 4 | <interface name="org.freedesktop.NetworkManager.Connection.Active"> | ||
422 | 5 | <tp:docstring> | ||
423 | 6 | Objects that implement the Connection.Active interface represent an attempt | ||
424 | 7 | to connect to a network using the details provided by a Connection object. | ||
425 | 8 | The Connection.Active object tracks the life-cycle of the connection | ||
426 | 9 | attempt and if successful indicates whether the connected network is the | ||
427 | 10 | "default" or preferred network for access. | ||
428 | 11 | </tp:docstring> | ||
429 | 12 | |||
430 | 13 | <property name="Connection" type="o" access="read"> | ||
431 | 14 | <tp:docstring> | ||
432 | 15 | The path of the connection. | ||
433 | 16 | </tp:docstring> | ||
434 | 17 | </property> | ||
435 | 18 | <property name="SpecificObject" type="o" access="read"> | ||
436 | 19 | <tp:docstring> | ||
437 | 20 | A specific object associated with the active connection. This property | ||
438 | 21 | reflects the specific object used during connection activation, and will | ||
439 | 22 | not change over the lifetime of the ActiveConnection once set. | ||
440 | 23 | </tp:docstring> | ||
441 | 24 | </property> | ||
442 | 25 | <property name="Id" type="s" access="read"> | ||
443 | 26 | <tp:docstring> | ||
444 | 27 | The ID of the connection, provided as a convenience so that clients | ||
445 | 28 | do not have to retrieve all connection details. | ||
446 | 29 | </tp:docstring> | ||
447 | 30 | </property> | ||
448 | 31 | <property name="Uuid" type="s" access="read"> | ||
449 | 32 | <tp:docstring> | ||
450 | 33 | The UUID of the connection, provided as a convenience so that clients | ||
451 | 34 | do not have to retrieve all connection details. | ||
452 | 35 | </tp:docstring> | ||
453 | 36 | </property> | ||
454 | 37 | <property name="Type" type="s" access="read"> | ||
455 | 38 | <tp:docstring> | ||
456 | 39 | The type of the connection, provided as a convenience so that clients | ||
457 | 40 | do not have to retrieve all connection details. | ||
458 | 41 | </tp:docstring> | ||
459 | 42 | </property> | ||
460 | 43 | <property name="Devices" type="ao" access="read"> | ||
461 | 44 | <tp:docstring> | ||
462 | 45 | Array of object paths representing devices which are part of this active | ||
463 | 46 | connection. | ||
464 | 47 | </tp:docstring> | ||
465 | 48 | </property> | ||
466 | 49 | <property name="State" type="u" access="read" tp:type="NM_ACTIVE_CONNECTION_STATE"> | ||
467 | 50 | <tp:docstring> | ||
468 | 51 | The state of this active connection. | ||
469 | 52 | </tp:docstring> | ||
470 | 53 | </property> | ||
471 | 54 | <!--property name="Default" type="b" access="read"> | ||
472 | 55 | <tp:docstring> | ||
473 | 56 | Whether this active connection is the default IPv4 connection, i.e. | ||
474 | 57 | whether it currently owns the default IPv4 route. | ||
475 | 58 | </tp:docstring> | ||
476 | 59 | </property--> | ||
477 | 60 | <property name="Ip4Config" type="o" access="read"> | ||
478 | 61 | <tp:docstring> | ||
479 | 62 | Object path of the Ip4Config object describing the configuration of the | ||
480 | 63 | connection. Only valid when the connection is in the | ||
481 | 64 | NM_ACTIVE_CONNECTION_STATE_ACTIVATED state. | ||
482 | 65 | </tp:docstring> | ||
483 | 66 | </property> | ||
484 | 67 | <property name="Dhcp4Config" type="o" access="read"> | ||
485 | 68 | <tp:docstring> | ||
486 | 69 | Object path of the Dhcp4Config object describing the DHCP options | ||
487 | 70 | returned by the DHCP server (assuming the connection used DHCP). Only | ||
488 | 71 | valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED | ||
489 | 72 | state. | ||
490 | 73 | </tp:docstring> | ||
491 | 74 | </property> | ||
492 | 75 | <property name="Default6" type="b" access="read"> | ||
493 | 76 | <tp:docstring> | ||
494 | 77 | Whether this active connection is the default IPv6 connection, i.e. | ||
495 | 78 | whether it currently owns the default IPv6 route. | ||
496 | 79 | </tp:docstring> | ||
497 | 80 | </property> | ||
498 | 81 | <property name="Ip6Config" type="o" access="read"> | ||
499 | 82 | <tp:docstring> | ||
500 | 83 | Object path of the Ip6Config object describing the configuration of the | ||
501 | 84 | connection. Only valid when the connection is in the | ||
502 | 85 | NM_ACTIVE_CONNECTION_STATE_ACTIVATED state. | ||
503 | 86 | </tp:docstring> | ||
504 | 87 | </property> | ||
505 | 88 | <property name="Dhcp6Config" type="o" access="read"> | ||
506 | 89 | <tp:docstring> | ||
507 | 90 | Object path of the Dhcp6Config object describing the DHCP options | ||
508 | 91 | returned by the DHCP server (assuming the connection used DHCP). Only | ||
509 | 92 | valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED | ||
510 | 93 | state. | ||
511 | 94 | </tp:docstring> | ||
512 | 95 | </property> | ||
513 | 96 | <property name="Vpn" type="b" access="read"> | ||
514 | 97 | <tp:docstring> | ||
515 | 98 | Whether this active connection is also a VPN connection. | ||
516 | 99 | </tp:docstring> | ||
517 | 100 | </property> | ||
518 | 101 | <property name="Master" type="o" access="read"> | ||
519 | 102 | <tp:docstring> | ||
520 | 103 | The path to the master device if the connection is a slave. | ||
521 | 104 | </tp:docstring> | ||
522 | 105 | </property> | ||
523 | 106 | |||
524 | 107 | <signal name="PropertiesChanged"> | ||
525 | 108 | <arg name="properties" type="a{sv}" tp:type="String_Variant_Map"> | ||
526 | 109 | <tp:docstring> | ||
527 | 110 | A dictionary mapping property names to variant boxed values | ||
528 | 111 | </tp:docstring> | ||
529 | 112 | </arg> | ||
530 | 113 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
531 | 114 | </signal> | ||
532 | 115 | |||
533 | 116 | <tp:enum name="NM_ACTIVE_CONNECTION_STATE" type="u"> | ||
534 | 117 | <tp:enumvalue suffix="UNKNOWN" value="0"> | ||
535 | 118 | <tp:docstring> | ||
536 | 119 | The active connection is in an unknown state. | ||
537 | 120 | </tp:docstring> | ||
538 | 121 | </tp:enumvalue> | ||
539 | 122 | <tp:enumvalue suffix="ACTIVATING" value="1"> | ||
540 | 123 | <tp:docstring> | ||
541 | 124 | The connection is activating. | ||
542 | 125 | </tp:docstring> | ||
543 | 126 | </tp:enumvalue> | ||
544 | 127 | <tp:enumvalue suffix="ACTIVATED" value="2"> | ||
545 | 128 | <tp:docstring> | ||
546 | 129 | The connection is activated. | ||
547 | 130 | </tp:docstring> | ||
548 | 131 | </tp:enumvalue> | ||
549 | 132 | <tp:enumvalue suffix="DEACTIVATING" value="3"> | ||
550 | 133 | <tp:docstring> | ||
551 | 134 | The connection is being torn down and cleaned up. | ||
552 | 135 | </tp:docstring> | ||
553 | 136 | </tp:enumvalue> | ||
554 | 137 | <tp:enumvalue suffix="DEACTIVATED" value="4"> | ||
555 | 138 | <tp:docstring> | ||
556 | 139 | The connection is no longer active. | ||
557 | 140 | </tp:docstring> | ||
558 | 141 | </tp:enumvalue> | ||
559 | 142 | </tp:enum> | ||
560 | 143 | </interface> | ||
561 | 144 | </node> | ||
562 | 145 | |||
563 | 0 | 146 | ||
564 | === added file 'data/nm-device-wifi.xml' | |||
565 | --- data/nm-device-wifi.xml 1970-01-01 00:00:00 +0000 | |||
566 | +++ data/nm-device-wifi.xml 2015-04-01 15:30:55 +0000 | |||
567 | @@ -0,0 +1,132 @@ | |||
568 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
569 | 2 | |||
570 | 3 | <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
571 | 4 | <interface name="org.freedesktop.NetworkManager.Device.Wireless"> | ||
572 | 5 | <method name="GetAccessPoints"> | ||
573 | 6 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_access_points"/> | ||
574 | 7 | <arg name="access_points" type="ao" direction="out"> | ||
575 | 8 | <tp:docstring> | ||
576 | 9 | List of access point object paths | ||
577 | 10 | </tp:docstring> | ||
578 | 11 | </arg> | ||
579 | 12 | <tp:docstring> | ||
580 | 13 | Get the list of access points visible to this device. | ||
581 | 14 | </tp:docstring> | ||
582 | 15 | </method> | ||
583 | 16 | |||
584 | 17 | <method name="RequestScan"> | ||
585 | 18 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_request_scan"/> | ||
586 | 19 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
587 | 20 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
588 | 21 | <arg name="options" type="a{sv}" direction="in"> | ||
589 | 22 | <tp:docstring> | ||
590 | 23 | Options of scan | ||
591 | 24 | </tp:docstring> | ||
592 | 25 | </arg> | ||
593 | 26 | <tp:docstring> | ||
594 | 27 | Request the device to scan | ||
595 | 28 | </tp:docstring> | ||
596 | 29 | </method> | ||
597 | 30 | |||
598 | 31 | <property name="HwAddress" type="s" access="read"> | ||
599 | 32 | <tp:docstring> | ||
600 | 33 | The active hardware address of the device. | ||
601 | 34 | </tp:docstring> | ||
602 | 35 | </property> | ||
603 | 36 | |||
604 | 37 | <property name="PermHwAddress" type="s" access="read"> | ||
605 | 38 | <tp:docstring> | ||
606 | 39 | The permanent hardware address of the device. | ||
607 | 40 | </tp:docstring> | ||
608 | 41 | </property> | ||
609 | 42 | |||
610 | 43 | <property name="Mode" type="u" access="read" tp:type="NM_802_11_MODE"> | ||
611 | 44 | <tp:docstring> | ||
612 | 45 | The operating mode of the wireless device. | ||
613 | 46 | </tp:docstring> | ||
614 | 47 | </property> | ||
615 | 48 | |||
616 | 49 | <property name="Bitrate" type="u" access="read"> | ||
617 | 50 | <tp:docstring> | ||
618 | 51 | The bit rate currently used by the wireless device, in kilobits/second (Kb/s). | ||
619 | 52 | </tp:docstring> | ||
620 | 53 | </property> | ||
621 | 54 | <property name="ActiveAccessPoint" type="o" access="read"> | ||
622 | 55 | <tp:docstring> | ||
623 | 56 | Object path of the access point currently used by the wireless device. | ||
624 | 57 | </tp:docstring> | ||
625 | 58 | </property> | ||
626 | 59 | <property name="WirelessCapabilities" type="u" access="read" tp:type="NM_802_11_DEVICE_CAP"> | ||
627 | 60 | <tp:docstring> | ||
628 | 61 | The capabilities of the wireless device. | ||
629 | 62 | </tp:docstring> | ||
630 | 63 | </property> | ||
631 | 64 | |||
632 | 65 | <signal name="PropertiesChanged"> | ||
633 | 66 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
634 | 67 | <arg name="properties" type="a{sv}" tp:type="String_Variant_Map"> | ||
635 | 68 | <tp:docstring> | ||
636 | 69 | A dictionary containing the FIXME: check changed parameters. | ||
637 | 70 | </tp:docstring> | ||
638 | 71 | </arg> | ||
639 | 72 | <tp:docstring> | ||
640 | 73 | Emitted when the wireless device's properties changed. | ||
641 | 74 | </tp:docstring> | ||
642 | 75 | </signal> | ||
643 | 76 | |||
644 | 77 | <signal name="AccessPointAdded"> | ||
645 | 78 | <arg name="access_point" type="o"> | ||
646 | 79 | <tp:docstring> | ||
647 | 80 | The object path of the newly found access point. | ||
648 | 81 | </tp:docstring> | ||
649 | 82 | </arg> | ||
650 | 83 | <tp:docstring> | ||
651 | 84 | Emitted when a new access point is found by the device. | ||
652 | 85 | </tp:docstring> | ||
653 | 86 | </signal> | ||
654 | 87 | |||
655 | 88 | <signal name="AccessPointRemoved"> | ||
656 | 89 | <arg name="access_point" type="o"> | ||
657 | 90 | <tp:docstring> | ||
658 | 91 | The object path of the access point that has disappeared. | ||
659 | 92 | </tp:docstring> | ||
660 | 93 | </arg> | ||
661 | 94 | <tp:docstring> | ||
662 | 95 | Emitted when an access point disappears from view of the device. | ||
663 | 96 | </tp:docstring> | ||
664 | 97 | </signal> | ||
665 | 98 | |||
666 | 99 | <tp:flags name="NM_802_11_DEVICE_CAP" type="u"> | ||
667 | 100 | <tp:docstring> | ||
668 | 101 | Flags describing the capabilities of a wireless device. | ||
669 | 102 | </tp:docstring> | ||
670 | 103 | <tp:flag suffix="NONE" value="0x0"> | ||
671 | 104 | <tp:docstring>Null capability - syntactic sugar for no capabilities supported. Do not AND this with other capabilities!</tp:docstring> | ||
672 | 105 | </tp:flag> | ||
673 | 106 | <tp:flag suffix="CIPHER_WEP40" value="0x1"> | ||
674 | 107 | <tp:docstring>The device supports the 40-bit WEP cipher.</tp:docstring> | ||
675 | 108 | </tp:flag> | ||
676 | 109 | <tp:flag suffix="CIPHER_WEP104" value="0x2"> | ||
677 | 110 | <tp:docstring>The device supports the 104-bit WEP cipher.</tp:docstring> | ||
678 | 111 | </tp:flag> | ||
679 | 112 | <tp:flag suffix="CIPHER_TKIP" value="0x4"> | ||
680 | 113 | <tp:docstring>The device supports the TKIP cipher.</tp:docstring> | ||
681 | 114 | </tp:flag> | ||
682 | 115 | <tp:flag suffix="CIPHER_CCMP" value="0x8"> | ||
683 | 116 | <tp:docstring>The device supports the CCMP cipher.</tp:docstring> | ||
684 | 117 | </tp:flag> | ||
685 | 118 | <tp:flag suffix="WPA" value="0x10"> | ||
686 | 119 | <tp:docstring>The device supports the WPA encryption/authentication protocol.</tp:docstring> | ||
687 | 120 | </tp:flag> | ||
688 | 121 | <tp:flag suffix="RSN" value="0x20"> | ||
689 | 122 | <tp:docstring>The device supports the RSN encryption/authentication protocol.</tp:docstring> | ||
690 | 123 | </tp:flag> | ||
691 | 124 | <tp:flag suffix="AP" value="0x40"> | ||
692 | 125 | <tp:docstring>The device supports Access Point mode.</tp:docstring> | ||
693 | 126 | </tp:flag> | ||
694 | 127 | <tp:flag suffix="ADHOC" value="0x80"> | ||
695 | 128 | <tp:docstring>The device supports Ad-Hoc mode.</tp:docstring> | ||
696 | 129 | </tp:flag> | ||
697 | 130 | </tp:flags> | ||
698 | 131 | </interface> | ||
699 | 132 | </node> | ||
700 | 0 | 133 | ||
701 | === added file 'data/nm-device.xml' | |||
702 | --- data/nm-device.xml 1970-01-01 00:00:00 +0000 | |||
703 | +++ data/nm-device.xml 2015-04-01 15:30:55 +0000 | |||
704 | @@ -0,0 +1,598 @@ | |||
705 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
706 | 2 | |||
707 | 3 | <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
708 | 4 | <interface name="org.freedesktop.NetworkManager.Device"> | ||
709 | 5 | <property name="Udi" type="s" access="read"> | ||
710 | 6 | <tp:docstring> | ||
711 | 7 | Operating-system specific transient device hardware identifier. This | ||
712 | 8 | is an opaque string representing the underlying hardware for the device, | ||
713 | 9 | and shouldn't be used to keep track of individual devices. For some | ||
714 | 10 | device types (Bluetooth, Modems) it is an identifier used by the | ||
715 | 11 | hardware service (ie bluez or ModemManager) to refer to that device, | ||
716 | 12 | and client programs use it get additional information from those | ||
717 | 13 | services which NM does not provide. The Udi is not guaranteed to be | ||
718 | 14 | consistent across reboots or hotplugs of the hardware. If you're looking | ||
719 | 15 | for a way to uniquely track each device in your application, use the | ||
720 | 16 | object path. If you're looking for a way to track a specific piece of | ||
721 | 17 | hardware across reboot or hotplug, use a MAC address or USB serial | ||
722 | 18 | number. | ||
723 | 19 | </tp:docstring> | ||
724 | 20 | </property> | ||
725 | 21 | <property name="Interface" type="s" access="read"> | ||
726 | 22 | <tp:docstring> | ||
727 | 23 | The name of the device's control (and often data) interface. | ||
728 | 24 | </tp:docstring> | ||
729 | 25 | </property> | ||
730 | 26 | <property name="IpInterface" type="s" access="read"> | ||
731 | 27 | <tp:docstring> | ||
732 | 28 | The name of the device's data interface when available. This property | ||
733 | 29 | may not refer to the actual data interface until the device has | ||
734 | 30 | successfully established a data connection, indicated by the device's | ||
735 | 31 | State becoming ACTIVATED. | ||
736 | 32 | </tp:docstring> | ||
737 | 33 | </property> | ||
738 | 34 | <property name="Driver" type="s" access="read"> | ||
739 | 35 | <tp:docstring> | ||
740 | 36 | The driver handling the device. | ||
741 | 37 | </tp:docstring> | ||
742 | 38 | </property> | ||
743 | 39 | <property name="DriverVersion" type="s" access="read"> | ||
744 | 40 | <tp:docstring> | ||
745 | 41 | The version of the driver handling the device. | ||
746 | 42 | </tp:docstring> | ||
747 | 43 | </property> | ||
748 | 44 | <property name="FirmwareVersion" type="s" access="read"> | ||
749 | 45 | <tp:docstring> | ||
750 | 46 | The firmware version for the device. | ||
751 | 47 | </tp:docstring> | ||
752 | 48 | </property> | ||
753 | 49 | <property name="Capabilities" type="u" access="read" tp:type="NM_DEVICE_CAP"> | ||
754 | 50 | <tp:docstring> | ||
755 | 51 | Flags describing the capabilities of the device. | ||
756 | 52 | </tp:docstring> | ||
757 | 53 | </property> | ||
758 | 54 | <property name="Ip4Address" type="i" access="read"> | ||
759 | 55 | <tp:docstring> | ||
760 | 56 | The IPv4 address bound to the device. FIXME: what about devices with >1 IP address? | ||
761 | 57 | </tp:docstring> | ||
762 | 58 | </property> | ||
763 | 59 | <property name="State" type="u" access="read" tp:type="NM_DEVICE_STATE"> | ||
764 | 60 | <tp:docstring> | ||
765 | 61 | The current state of the device. | ||
766 | 62 | </tp:docstring> | ||
767 | 63 | </property> | ||
768 | 64 | <property name="StateReason" type="(uu)" access="read" tp:type="NM_DEVICE_STATE_REASON_STRUCT"> | ||
769 | 65 | <annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariant"/> | ||
770 | 66 | <tp:docstring> | ||
771 | 67 | The current state and reason for changing to that state. | ||
772 | 68 | </tp:docstring> | ||
773 | 69 | </property> | ||
774 | 70 | <property name="ActiveConnection" type="o" access="read"> | ||
775 | 71 | <tp:docstring> | ||
776 | 72 | Object path of an ActiveConnection object that "owns" this device during | ||
777 | 73 | activation. The ActiveConnection object tracks the life-cycle of a | ||
778 | 74 | connection to a specific network and implements the | ||
779 | 75 | org.freedesktop.NetworkManager.Connection.Active D-Bus interface. | ||
780 | 76 | </tp:docstring> | ||
781 | 77 | </property> | ||
782 | 78 | <property name="Ip4Config" type="o" access="read"> | ||
783 | 79 | <tp:docstring> | ||
784 | 80 | Object path of the Ip4Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. | ||
785 | 81 | </tp:docstring> | ||
786 | 82 | </property> | ||
787 | 83 | <property name="Dhcp4Config" type="o" access="read"> | ||
788 | 84 | <tp:docstring> | ||
789 | 85 | Object path of the Dhcp4Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. | ||
790 | 86 | </tp:docstring> | ||
791 | 87 | </property> | ||
792 | 88 | <property name="Ip6Config" type="o" access="read"> | ||
793 | 89 | <tp:docstring> | ||
794 | 90 | Object path of the Ip6Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. | ||
795 | 91 | </tp:docstring> | ||
796 | 92 | </property> | ||
797 | 93 | <property name="Dhcp6Config" type="o" access="read"> | ||
798 | 94 | <tp:docstring> | ||
799 | 95 | Object path of the Dhcp6Config object describing the DHCP options | ||
800 | 96 | returned by the DHCP server. Only valid when the device is in the | ||
801 | 97 | NM_DEVICE_STATE_ACTIVATED state. | ||
802 | 98 | </tp:docstring> | ||
803 | 99 | </property> | ||
804 | 100 | <property name="Managed" type="b" access="read"> | ||
805 | 101 | <tp:docstring> | ||
806 | 102 | Whether or not this device is managed by NetworkManager. | ||
807 | 103 | </tp:docstring> | ||
808 | 104 | </property> | ||
809 | 105 | <property name="Autoconnect" type="b" access="readwrite"> | ||
810 | 106 | <tp:docstring> | ||
811 | 107 | If TRUE, indicates the device is allowed to autoconnect. If FALSE, | ||
812 | 108 | manual intervention is required before the device will automatically | ||
813 | 109 | connect to a known network, such as activating a connection using the | ||
814 | 110 | device, or setting this property to TRUE. | ||
815 | 111 | </tp:docstring> | ||
816 | 112 | </property> | ||
817 | 113 | <property name="FirmwareMissing" type="b" access="read"> | ||
818 | 114 | <tp:docstring> | ||
819 | 115 | If TRUE, indicates the device is likely missing firmware necessary for | ||
820 | 116 | its operation. | ||
821 | 117 | </tp:docstring> | ||
822 | 118 | </property> | ||
823 | 119 | <property name="DeviceType" type="u" access="read" tp:type="NM_DEVICE_TYPE"> | ||
824 | 120 | <tp:docstring> | ||
825 | 121 | The general type of the network device; ie Ethernet, WiFi, etc. | ||
826 | 122 | </tp:docstring> | ||
827 | 123 | </property> | ||
828 | 124 | <property name="AvailableConnections" type="ao" access="read"> | ||
829 | 125 | <tp:docstring> | ||
830 | 126 | An array of object paths of every configured connection that is currently 'available' through this device. | ||
831 | 127 | </tp:docstring> | ||
832 | 128 | </property> | ||
833 | 129 | |||
834 | 130 | <method name="Disconnect"> | ||
835 | 131 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_disconnect"/> | ||
836 | 132 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
837 | 133 | <tp:docstring> | ||
838 | 134 | Disconnects a device and prevents the device from automatically activating further connections without user intervention. | ||
839 | 135 | </tp:docstring> | ||
840 | 136 | </method> | ||
841 | 137 | |||
842 | 138 | <signal name="StateChanged"> | ||
843 | 139 | <arg name="new_state" type="u" tp:type="NM_DEVICE_STATE"> | ||
844 | 140 | <tp:docstring> | ||
845 | 141 | The new state of the device. | ||
846 | 142 | </tp:docstring> | ||
847 | 143 | </arg> | ||
848 | 144 | <arg name="old_state" type="u" tp:type="NM_DEVICE_STATE"> | ||
849 | 145 | <tp:docstring> | ||
850 | 146 | The previous state of the device. | ||
851 | 147 | </tp:docstring> | ||
852 | 148 | </arg> | ||
853 | 149 | <arg name="reason" type="u" tp:type="NM_DEVICE_STATE_REASON"> | ||
854 | 150 | <tp:docstring> | ||
855 | 151 | A reason for the state transition. | ||
856 | 152 | </tp:docstring> | ||
857 | 153 | </arg> | ||
858 | 154 | </signal> | ||
859 | 155 | |||
860 | 156 | <tp:enum name="NM_DEVICE_STATE" type="u"> | ||
861 | 157 | <tp:enumvalue suffix="UNKNOWN" value="0"> | ||
862 | 158 | <tp:docstring> | ||
863 | 159 | The device is in an unknown state. | ||
864 | 160 | </tp:docstring> | ||
865 | 161 | </tp:enumvalue> | ||
866 | 162 | <tp:enumvalue suffix="UNMANAGED" value="10"> | ||
867 | 163 | <tp:docstring> | ||
868 | 164 | The device is recognized but not managed by NetworkManager. | ||
869 | 165 | </tp:docstring> | ||
870 | 166 | </tp:enumvalue> | ||
871 | 167 | <tp:enumvalue suffix="UNAVAILABLE" value="20"> | ||
872 | 168 | <tp:docstring> | ||
873 | 169 | The device cannot be used (carrier off, rfkill, etc). | ||
874 | 170 | </tp:docstring> | ||
875 | 171 | </tp:enumvalue> | ||
876 | 172 | <tp:enumvalue suffix="DISCONNECTED" value="30"> | ||
877 | 173 | <tp:docstring> | ||
878 | 174 | The device is not connected. | ||
879 | 175 | </tp:docstring> | ||
880 | 176 | </tp:enumvalue> | ||
881 | 177 | <tp:enumvalue suffix="PREPARE" value="40"> | ||
882 | 178 | <tp:docstring> | ||
883 | 179 | The device is preparing to connect. | ||
884 | 180 | </tp:docstring> | ||
885 | 181 | </tp:enumvalue> | ||
886 | 182 | <tp:enumvalue suffix="CONFIG" value="50"> | ||
887 | 183 | <tp:docstring> | ||
888 | 184 | The device is being configured. | ||
889 | 185 | </tp:docstring> | ||
890 | 186 | </tp:enumvalue> | ||
891 | 187 | <tp:enumvalue suffix="NEED_AUTH" value="60"> | ||
892 | 188 | <tp:docstring> | ||
893 | 189 | The device is awaiting secrets necessary to continue connection. | ||
894 | 190 | </tp:docstring> | ||
895 | 191 | </tp:enumvalue> | ||
896 | 192 | <tp:enumvalue suffix="IP_CONFIG" value="70"> | ||
897 | 193 | <tp:docstring> | ||
898 | 194 | The IP settings of the device are being requested and configured. | ||
899 | 195 | </tp:docstring> | ||
900 | 196 | </tp:enumvalue> | ||
901 | 197 | <tp:enumvalue suffix="IP_CHECK" value="80"> | ||
902 | 198 | <tp:docstring> | ||
903 | 199 | The device's IP connectivity ability is being determined. | ||
904 | 200 | </tp:docstring> | ||
905 | 201 | </tp:enumvalue> | ||
906 | 202 | <tp:enumvalue suffix="SECONDARIES" value="90"> | ||
907 | 203 | <tp:docstring> | ||
908 | 204 | The device is waiting for secondary connections to be activated. | ||
909 | 205 | </tp:docstring> | ||
910 | 206 | </tp:enumvalue> | ||
911 | 207 | <tp:enumvalue suffix="ACTIVATED" value="100"> | ||
912 | 208 | <tp:docstring> | ||
913 | 209 | The device is active. | ||
914 | 210 | </tp:docstring> | ||
915 | 211 | </tp:enumvalue> | ||
916 | 212 | <tp:enumvalue suffix="DEACTIVATING" value="110"> | ||
917 | 213 | <tp:docstring> | ||
918 | 214 | The device's network connection is being torn down. | ||
919 | 215 | </tp:docstring> | ||
920 | 216 | </tp:enumvalue> | ||
921 | 217 | <tp:enumvalue suffix="FAILED" value="120"> | ||
922 | 218 | <tp:docstring> | ||
923 | 219 | The device is in a failure state following an attempt to activate it. | ||
924 | 220 | </tp:docstring> | ||
925 | 221 | </tp:enumvalue> | ||
926 | 222 | </tp:enum> | ||
927 | 223 | |||
928 | 224 | <tp:enum name="NM_DEVICE_TYPE" type="u"> | ||
929 | 225 | <tp:enumvalue suffix="UNKNOWN" value="0"> | ||
930 | 226 | <tp:docstring> | ||
931 | 227 | The device type is unknown. | ||
932 | 228 | </tp:docstring> | ||
933 | 229 | </tp:enumvalue> | ||
934 | 230 | <tp:enumvalue suffix="ETHERNET" value="1"> | ||
935 | 231 | <tp:docstring> | ||
936 | 232 | The device is wired Ethernet device. | ||
937 | 233 | </tp:docstring> | ||
938 | 234 | </tp:enumvalue> | ||
939 | 235 | <tp:enumvalue suffix="WIFI" value="2"> | ||
940 | 236 | <tp:docstring> | ||
941 | 237 | The device is an 802.11 WiFi device. | ||
942 | 238 | </tp:docstring> | ||
943 | 239 | </tp:enumvalue> | ||
944 | 240 | <tp:enumvalue suffix="UNUSED1" value="3"> | ||
945 | 241 | <tp:docstring>Unused</tp:docstring> | ||
946 | 242 | </tp:enumvalue> | ||
947 | 243 | <tp:enumvalue suffix="UNUSED2" value="4"> | ||
948 | 244 | <tp:docstring>Unused</tp:docstring> | ||
949 | 245 | </tp:enumvalue> | ||
950 | 246 | <tp:enumvalue suffix="BT" value="5"> | ||
951 | 247 | <tp:docstring> | ||
952 | 248 | The device is Bluetooth device that provides PAN or DUN capabilities. | ||
953 | 249 | </tp:docstring> | ||
954 | 250 | </tp:enumvalue> | ||
955 | 251 | <tp:enumvalue suffix="OLPC_MESH" value="6"> | ||
956 | 252 | <tp:docstring> | ||
957 | 253 | The device is an OLPC mesh networking device. | ||
958 | 254 | </tp:docstring> | ||
959 | 255 | </tp:enumvalue> | ||
960 | 256 | <tp:enumvalue suffix="WIMAX" value="7"> | ||
961 | 257 | <tp:docstring> | ||
962 | 258 | The device is an 802.16e Mobile WiMAX device. | ||
963 | 259 | </tp:docstring> | ||
964 | 260 | </tp:enumvalue> | ||
965 | 261 | <tp:enumvalue suffix="MODEM" value="8"> | ||
966 | 262 | <tp:docstring> | ||
967 | 263 | The device is a modem supporting one or more of analog telephone, | ||
968 | 264 | CDMA/EVDO, GSM/UMTS/HSPA, or LTE standards to access a cellular or | ||
969 | 265 | wireline data network. | ||
970 | 266 | </tp:docstring> | ||
971 | 267 | </tp:enumvalue> | ||
972 | 268 | <tp:enumvalue suffix="INFINIBAND" value="9"> | ||
973 | 269 | <tp:docstring> | ||
974 | 270 | The device is an IP-capable InfiniBand interface. | ||
975 | 271 | </tp:docstring> | ||
976 | 272 | </tp:enumvalue> | ||
977 | 273 | <tp:enumvalue suffix="BOND" value="10"> | ||
978 | 274 | <tp:docstring> | ||
979 | 275 | The device is a bond master interface. | ||
980 | 276 | </tp:docstring> | ||
981 | 277 | </tp:enumvalue> | ||
982 | 278 | <tp:enumvalue suffix="VLAN" value="11"> | ||
983 | 279 | <tp:docstring> | ||
984 | 280 | The device is a VLAN interface. | ||
985 | 281 | </tp:docstring> | ||
986 | 282 | </tp:enumvalue> | ||
987 | 283 | <tp:enumvalue suffix="ADSL" value="12"> | ||
988 | 284 | <tp:docstring> | ||
989 | 285 | The device is an ADSL device supporting PPPoE and PPPoATM protocols. | ||
990 | 286 | </tp:docstring> | ||
991 | 287 | </tp:enumvalue> | ||
992 | 288 | <tp:enumvalue suffix="BRIDGE" value="13"> | ||
993 | 289 | <tp:docstring> | ||
994 | 290 | The device is a bridge interface. | ||
995 | 291 | </tp:docstring> | ||
996 | 292 | </tp:enumvalue> | ||
997 | 293 | </tp:enum> | ||
998 | 294 | |||
999 | 295 | <tp:flags name="NM_DEVICE_CAP" value-prefix="NM_DEVICE_CAP" type="u"> | ||
1000 | 296 | <tp:flag suffix="NONE" value="0x0"> | ||
1001 | 297 | <tp:docstring>Null capability.</tp:docstring> | ||
1002 | 298 | </tp:flag> | ||
1003 | 299 | <tp:flag suffix="NM_SUPPORTED" value="0x1"> | ||
1004 | 300 | <tp:docstring>The device is supported by NetworkManager.</tp:docstring> | ||
1005 | 301 | </tp:flag> | ||
1006 | 302 | <tp:flag suffix="CARRIER_DETECT" value="0x2"> | ||
1007 | 303 | <tp:docstring>The device supports carrier detection.</tp:docstring> | ||
1008 | 304 | </tp:flag> | ||
1009 | 305 | </tp:flags> | ||
1010 | 306 | |||
1011 | 307 | <tp:enum name="NM_DEVICE_STATE_REASON" type="u"> | ||
1012 | 308 | <tp:enumvalue suffix="UNKNOWN" value="0"> | ||
1013 | 309 | <tp:docstring> | ||
1014 | 310 | The reason for the device state change is unknown. | ||
1015 | 311 | </tp:docstring> | ||
1016 | 312 | </tp:enumvalue> | ||
1017 | 313 | <tp:enumvalue suffix="NONE" value="1"> | ||
1018 | 314 | <tp:docstring> | ||
1019 | 315 | The state change is normal. | ||
1020 | 316 | </tp:docstring> | ||
1021 | 317 | </tp:enumvalue> | ||
1022 | 318 | <tp:enumvalue suffix="NOW_MANAGED" value="2"> | ||
1023 | 319 | <tp:docstring> | ||
1024 | 320 | The device is now managed. | ||
1025 | 321 | </tp:docstring> | ||
1026 | 322 | </tp:enumvalue> | ||
1027 | 323 | <tp:enumvalue suffix="NOW_UNMANAGED" value="3"> | ||
1028 | 324 | <tp:docstring> | ||
1029 | 325 | The device is no longer managed. | ||
1030 | 326 | </tp:docstring> | ||
1031 | 327 | </tp:enumvalue> | ||
1032 | 328 | <tp:enumvalue suffix="CONFIG_FAILED" value="4"> | ||
1033 | 329 | <tp:docstring> | ||
1034 | 330 | The device could not be readied for configuration. | ||
1035 | 331 | </tp:docstring> | ||
1036 | 332 | </tp:enumvalue> | ||
1037 | 333 | <tp:enumvalue suffix="CONFIG_UNAVAILABLE" value="5"> | ||
1038 | 334 | <tp:docstring> | ||
1039 | 335 | IP configuration could not be reserved (no available address, timeout, etc). | ||
1040 | 336 | </tp:docstring> | ||
1041 | 337 | </tp:enumvalue> | ||
1042 | 338 | <tp:enumvalue suffix="CONFIG_EXPIRED" value="6"> | ||
1043 | 339 | <tp:docstring> | ||
1044 | 340 | The IP configuration is no longer valid. | ||
1045 | 341 | </tp:docstring> | ||
1046 | 342 | </tp:enumvalue> | ||
1047 | 343 | <tp:enumvalue suffix="NO_SECRETS" value="7"> | ||
1048 | 344 | <tp:docstring> | ||
1049 | 345 | Secrets were required, but not provided. | ||
1050 | 346 | </tp:docstring> | ||
1051 | 347 | </tp:enumvalue> | ||
1052 | 348 | <tp:enumvalue suffix="SUPPLICANT_DISCONNECT" value="8"> | ||
1053 | 349 | <tp:docstring> | ||
1054 | 350 | The 802.1X supplicant disconnected from the access point or authentication server. | ||
1055 | 351 | </tp:docstring> | ||
1056 | 352 | </tp:enumvalue> | ||
1057 | 353 | <tp:enumvalue suffix="SUPPLICANT_CONFIG_FAILED" value="9"> | ||
1058 | 354 | <tp:docstring> | ||
1059 | 355 | Configuration of the 802.1X supplicant failed. | ||
1060 | 356 | </tp:docstring> | ||
1061 | 357 | </tp:enumvalue> | ||
1062 | 358 | <tp:enumvalue suffix="SUPPLICANT_FAILED" value="10"> | ||
1063 | 359 | <tp:docstring> | ||
1064 | 360 | The 802.1X supplicant quit or failed unexpectedly. | ||
1065 | 361 | </tp:docstring> | ||
1066 | 362 | </tp:enumvalue> | ||
1067 | 363 | <tp:enumvalue suffix="SUPPLICANT_TIMEOUT" value="11"> | ||
1068 | 364 | <tp:docstring> | ||
1069 | 365 | The 802.1X supplicant took too long to authenticate. | ||
1070 | 366 | </tp:docstring> | ||
1071 | 367 | </tp:enumvalue> | ||
1072 | 368 | <tp:enumvalue suffix="PPP_START_FAILED" value="12"> | ||
1073 | 369 | <tp:docstring> | ||
1074 | 370 | The PPP service failed to start within the allowed time. | ||
1075 | 371 | </tp:docstring> | ||
1076 | 372 | </tp:enumvalue> | ||
1077 | 373 | <tp:enumvalue suffix="PPP_DISCONNECT" value="13"> | ||
1078 | 374 | <tp:docstring> | ||
1079 | 375 | The PPP service disconnected unexpectedly. | ||
1080 | 376 | </tp:docstring> | ||
1081 | 377 | </tp:enumvalue> | ||
1082 | 378 | <tp:enumvalue suffix="PPP_FAILED" value="14"> | ||
1083 | 379 | <tp:docstring> | ||
1084 | 380 | The PPP service quit or failed unexpectedly. | ||
1085 | 381 | </tp:docstring> | ||
1086 | 382 | </tp:enumvalue> | ||
1087 | 383 | <tp:enumvalue suffix="DHCP_START_FAILED" value="15"> | ||
1088 | 384 | <tp:docstring> | ||
1089 | 385 | The DHCP service failed to start within the allowed time. | ||
1090 | 386 | </tp:docstring> | ||
1091 | 387 | </tp:enumvalue> | ||
1092 | 388 | <tp:enumvalue suffix="DHCP_ERROR" value="16"> | ||
1093 | 389 | <tp:docstring> | ||
1094 | 390 | The DHCP service reported an unexpected error. | ||
1095 | 391 | </tp:docstring> | ||
1096 | 392 | </tp:enumvalue> | ||
1097 | 393 | <tp:enumvalue suffix="DHCP_FAILED" value="17"> | ||
1098 | 394 | <tp:docstring> | ||
1099 | 395 | The DHCP service quit or failed unexpectedly. | ||
1100 | 396 | </tp:docstring> | ||
1101 | 397 | </tp:enumvalue> | ||
1102 | 398 | <tp:enumvalue suffix="SHARED_START_FAILED" value="18"> | ||
1103 | 399 | <tp:docstring> | ||
1104 | 400 | The shared connection service failed to start. | ||
1105 | 401 | </tp:docstring> | ||
1106 | 402 | </tp:enumvalue> | ||
1107 | 403 | <tp:enumvalue suffix="SHARED_FAILED" value="19"> | ||
1108 | 404 | <tp:docstring> | ||
1109 | 405 | The shared connection service quit or failed unexpectedly. | ||
1110 | 406 | </tp:docstring> | ||
1111 | 407 | </tp:enumvalue> | ||
1112 | 408 | <tp:enumvalue suffix="AUTOIP_START_FAILED" value="20"> | ||
1113 | 409 | <tp:docstring> | ||
1114 | 410 | The AutoIP service failed to start. | ||
1115 | 411 | </tp:docstring> | ||
1116 | 412 | </tp:enumvalue> | ||
1117 | 413 | <tp:enumvalue suffix="AUTOIP_ERROR" value="21"> | ||
1118 | 414 | <tp:docstring> | ||
1119 | 415 | The AutoIP service reported an unexpected error. | ||
1120 | 416 | </tp:docstring> | ||
1121 | 417 | </tp:enumvalue> | ||
1122 | 418 | <tp:enumvalue suffix="AUTOIP_FAILED" value="22"> | ||
1123 | 419 | <tp:docstring> | ||
1124 | 420 | The AutoIP service quit or failed unexpectedly. | ||
1125 | 421 | </tp:docstring> | ||
1126 | 422 | </tp:enumvalue> | ||
1127 | 423 | <tp:enumvalue suffix="MODEM_BUSY" value="23"> | ||
1128 | 424 | <tp:docstring> | ||
1129 | 425 | Dialing failed because the line was busy. | ||
1130 | 426 | </tp:docstring> | ||
1131 | 427 | </tp:enumvalue> | ||
1132 | 428 | <tp:enumvalue suffix="MODEM_NO_DIAL_TONE" value="24"> | ||
1133 | 429 | <tp:docstring> | ||
1134 | 430 | Dialing failed because there was no dial tone. | ||
1135 | 431 | </tp:docstring> | ||
1136 | 432 | </tp:enumvalue> | ||
1137 | 433 | <tp:enumvalue suffix="MODEM_NO_CARRIER" value="25"> | ||
1138 | 434 | <tp:docstring> | ||
1139 | 435 | Dialing failed because there was carrier. | ||
1140 | 436 | </tp:docstring> | ||
1141 | 437 | </tp:enumvalue> | ||
1142 | 438 | <tp:enumvalue suffix="MODEM_DIAL_TIMEOUT" value="26"> | ||
1143 | 439 | <tp:docstring> | ||
1144 | 440 | Dialing timed out. | ||
1145 | 441 | </tp:docstring> | ||
1146 | 442 | </tp:enumvalue> | ||
1147 | 443 | <tp:enumvalue suffix="MODEM_DIAL_FAILED" value="27"> | ||
1148 | 444 | <tp:docstring> | ||
1149 | 445 | Dialing failed. | ||
1150 | 446 | </tp:docstring> | ||
1151 | 447 | </tp:enumvalue> | ||
1152 | 448 | <tp:enumvalue suffix="MODEM_INIT_FAILED" value="28"> | ||
1153 | 449 | <tp:docstring> | ||
1154 | 450 | Modem initialization failed. | ||
1155 | 451 | </tp:docstring> | ||
1156 | 452 | </tp:enumvalue> | ||
1157 | 453 | <tp:enumvalue suffix="GSM_APN_FAILED" value="29"> | ||
1158 | 454 | <tp:docstring> | ||
1159 | 455 | Failed to select the specified GSM APN. | ||
1160 | 456 | </tp:docstring> | ||
1161 | 457 | </tp:enumvalue> | ||
1162 | 458 | <tp:enumvalue suffix="GSM_REGISTRATION_NOT_SEARCHING" value="30"> | ||
1163 | 459 | <tp:docstring> | ||
1164 | 460 | Not searching for networks. | ||
1165 | 461 | </tp:docstring> | ||
1166 | 462 | </tp:enumvalue> | ||
1167 | 463 | <tp:enumvalue suffix="GSM_REGISTRATION_DENIED" value="31"> | ||
1168 | 464 | <tp:docstring> | ||
1169 | 465 | Network registration was denied. | ||
1170 | 466 | </tp:docstring> | ||
1171 | 467 | </tp:enumvalue> | ||
1172 | 468 | <tp:enumvalue suffix="GSM_REGISTRATION_TIMEOUT" value="32"> | ||
1173 | 469 | <tp:docstring> | ||
1174 | 470 | Network registration timed out. | ||
1175 | 471 | </tp:docstring> | ||
1176 | 472 | </tp:enumvalue> | ||
1177 | 473 | <tp:enumvalue suffix="GSM_REGISTRATION_FAILED" value="33"> | ||
1178 | 474 | <tp:docstring> | ||
1179 | 475 | Failed to register with the requested GSM network. | ||
1180 | 476 | </tp:docstring> | ||
1181 | 477 | </tp:enumvalue> | ||
1182 | 478 | <tp:enumvalue suffix="GSM_PIN_CHECK_FAILED" value="34"> | ||
1183 | 479 | <tp:docstring> | ||
1184 | 480 | PIN check failed. | ||
1185 | 481 | </tp:docstring> | ||
1186 | 482 | </tp:enumvalue> | ||
1187 | 483 | <tp:enumvalue suffix="FIRMWARE_MISSING" value="35"> | ||
1188 | 484 | <tp:docstring> | ||
1189 | 485 | Necessary firmware for the device may be missing. | ||
1190 | 486 | </tp:docstring> | ||
1191 | 487 | </tp:enumvalue> | ||
1192 | 488 | <tp:enumvalue suffix="REMOVED" value="36"> | ||
1193 | 489 | <tp:docstring> | ||
1194 | 490 | The device was removed. | ||
1195 | 491 | </tp:docstring> | ||
1196 | 492 | </tp:enumvalue> | ||
1197 | 493 | <tp:enumvalue suffix="SLEEPING" value="37"> | ||
1198 | 494 | <tp:docstring> | ||
1199 | 495 | NetworkManager went to sleep. | ||
1200 | 496 | </tp:docstring> | ||
1201 | 497 | </tp:enumvalue> | ||
1202 | 498 | <tp:enumvalue suffix="CONNECTION_REMOVED" value="38"> | ||
1203 | 499 | <tp:docstring> | ||
1204 | 500 | The device's active connection was removed or disappeared. | ||
1205 | 501 | </tp:docstring> | ||
1206 | 502 | </tp:enumvalue> | ||
1207 | 503 | <tp:enumvalue suffix="USER_REQUESTED" value="39"> | ||
1208 | 504 | <tp:docstring> | ||
1209 | 505 | A user or client requested the disconnection. | ||
1210 | 506 | </tp:docstring> | ||
1211 | 507 | </tp:enumvalue> | ||
1212 | 508 | <tp:enumvalue suffix="CARRIER" value="40"> | ||
1213 | 509 | <tp:docstring> | ||
1214 | 510 | The device's carrier/link changed. | ||
1215 | 511 | </tp:docstring> | ||
1216 | 512 | </tp:enumvalue> | ||
1217 | 513 | <tp:enumvalue suffix="CONNECTION_ASSUMED" value="41"> | ||
1218 | 514 | <tp:docstring> | ||
1219 | 515 | The device's existing connection was assumed. | ||
1220 | 516 | </tp:docstring> | ||
1221 | 517 | </tp:enumvalue> | ||
1222 | 518 | <tp:enumvalue suffix="SUPPLICANT_AVAILABLE" value="42"> | ||
1223 | 519 | <tp:docstring> | ||
1224 | 520 | The 802.1x supplicant is now available. | ||
1225 | 521 | </tp:docstring> | ||
1226 | 522 | </tp:enumvalue> | ||
1227 | 523 | <tp:enumvalue suffix="MODEM_NOT_FOUND" value="43"> | ||
1228 | 524 | <tp:docstring> | ||
1229 | 525 | The modem could not be found. | ||
1230 | 526 | </tp:docstring> | ||
1231 | 527 | </tp:enumvalue> | ||
1232 | 528 | <tp:enumvalue suffix="BT_FAILED" value="44"> | ||
1233 | 529 | <tp:docstring> | ||
1234 | 530 | The Bluetooth connection timed out or failed. | ||
1235 | 531 | </tp:docstring> | ||
1236 | 532 | </tp:enumvalue> | ||
1237 | 533 | <tp:enumvalue suffix="GSM_SIM_NOT_INSERTED" value="45"> | ||
1238 | 534 | <tp:docstring> | ||
1239 | 535 | GSM Modem's SIM Card not inserted. | ||
1240 | 536 | </tp:docstring> | ||
1241 | 537 | </tp:enumvalue> | ||
1242 | 538 | <tp:enumvalue suffix="GSM_SIM_PIN_REQUIRED" value="46"> | ||
1243 | 539 | <tp:docstring> | ||
1244 | 540 | GSM Modem's SIM Pin required. | ||
1245 | 541 | </tp:docstring> | ||
1246 | 542 | </tp:enumvalue> | ||
1247 | 543 | <tp:enumvalue suffix="GSM_SIM_PUK_REQUIRED" value="47"> | ||
1248 | 544 | <tp:docstring> | ||
1249 | 545 | GSM Modem's SIM Puk required. | ||
1250 | 546 | </tp:docstring> | ||
1251 | 547 | </tp:enumvalue> | ||
1252 | 548 | <tp:enumvalue suffix="GSM_SIM_WRONG" value="48"> | ||
1253 | 549 | <tp:docstring> | ||
1254 | 550 | GSM Modem's SIM wrong | ||
1255 | 551 | </tp:docstring> | ||
1256 | 552 | </tp:enumvalue> | ||
1257 | 553 | <tp:enumvalue suffix="INFINIBAND_MODE" value="49"> | ||
1258 | 554 | <tp:docstring> | ||
1259 | 555 | InfiniBand device does not support connected mode. | ||
1260 | 556 | </tp:docstring> | ||
1261 | 557 | </tp:enumvalue> | ||
1262 | 558 | <tp:enumvalue suffix="DEPENDENCY_FAILED" value="50"> | ||
1263 | 559 | <tp:docstring> | ||
1264 | 560 | A dependency of the connection failed. | ||
1265 | 561 | </tp:docstring> | ||
1266 | 562 | </tp:enumvalue> | ||
1267 | 563 | <tp:enumvalue suffix="BR2684_FAILED" value="51"> | ||
1268 | 564 | <tp:docstring> | ||
1269 | 565 | Problem with the RFC 2684 Ethernet over ADSL bridge. | ||
1270 | 566 | </tp:docstring> | ||
1271 | 567 | </tp:enumvalue> | ||
1272 | 568 | <tp:enumvalue suffix="MODEM_MANAGER_UNAVAILABLE" value="52"> | ||
1273 | 569 | <tp:docstring> | ||
1274 | 570 | ModemManager was not running or quit unexpectedly. | ||
1275 | 571 | </tp:docstring> | ||
1276 | 572 | </tp:enumvalue> | ||
1277 | 573 | <tp:enumvalue suffix="SSID_NOT_FOUND" value="53"> | ||
1278 | 574 | <tp:docstring> | ||
1279 | 575 | The 802.11 Wi-Fi network could not be found. | ||
1280 | 576 | </tp:docstring> | ||
1281 | 577 | </tp:enumvalue> | ||
1282 | 578 | <tp:enumvalue suffix="SECONDARY_CONNECTION_FAILED" value="54"> | ||
1283 | 579 | <tp:docstring> | ||
1284 | 580 | A secondary connection of the base connection failed. | ||
1285 | 581 | </tp:docstring> | ||
1286 | 582 | </tp:enumvalue> | ||
1287 | 583 | </tp:enum> | ||
1288 | 584 | |||
1289 | 585 | <tp:struct name="NM_DEVICE_STATE_REASON_STRUCT"> | ||
1290 | 586 | <tp:member type="u" name="state" tp:type="NM_DEVICE_STATE"> | ||
1291 | 587 | <tp:docstring> | ||
1292 | 588 | The device state. | ||
1293 | 589 | </tp:docstring> | ||
1294 | 590 | </tp:member> | ||
1295 | 591 | <tp:member type="u" name="reason" tp:type="NM_DEVICE_STATE_REASON"> | ||
1296 | 592 | <tp:docstring> | ||
1297 | 593 | The reason for originally changing to the device state. | ||
1298 | 594 | </tp:docstring> | ||
1299 | 595 | </tp:member> | ||
1300 | 596 | </tp:struct> | ||
1301 | 597 | </interface> | ||
1302 | 598 | </node> | ||
1303 | 0 | 599 | ||
1304 | === added file 'data/nm-manager.xml' | |||
1305 | --- data/nm-manager.xml 1970-01-01 00:00:00 +0000 | |||
1306 | +++ data/nm-manager.xml 2015-04-01 15:30:55 +0000 | |||
1307 | @@ -0,0 +1,412 @@ | |||
1308 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
1309 | 2 | |||
1310 | 3 | <node name="/org/freedesktop/NetworkManager" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
1311 | 4 | <interface name="org.freedesktop.NetworkManager"> | ||
1312 | 5 | <method name="GetDevices"> | ||
1313 | 6 | <tp:docstring> | ||
1314 | 7 | Get the list of network devices. | ||
1315 | 8 | </tp:docstring> | ||
1316 | 9 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_devices"/> | ||
1317 | 10 | <arg name="devices" type="ao" direction="out"> | ||
1318 | 11 | <tp:docstring> | ||
1319 | 12 | List of object paths of network devices known to the system. | ||
1320 | 13 | </tp:docstring> | ||
1321 | 14 | </arg> | ||
1322 | 15 | </method> | ||
1323 | 16 | |||
1324 | 17 | <method name="GetDeviceByIpIface"> | ||
1325 | 18 | <tp:docstring> | ||
1326 | 19 | Return the object path of the network device referenced by its IP | ||
1327 | 20 | interface name. Note that some devices (usually modems) only have an | ||
1328 | 21 | IP interface name when they are connected. | ||
1329 | 22 | </tp:docstring> | ||
1330 | 23 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_device_by_ip_iface"/> | ||
1331 | 24 | <arg name="iface" type="s" direction="in"> | ||
1332 | 25 | <tp:docstring> | ||
1333 | 26 | Interface name of the device to find. | ||
1334 | 27 | </tp:docstring> | ||
1335 | 28 | </arg> | ||
1336 | 29 | <arg name="device" type="o" direction="out"> | ||
1337 | 30 | <tp:docstring> | ||
1338 | 31 | Object path of the network device. | ||
1339 | 32 | </tp:docstring> | ||
1340 | 33 | </arg> | ||
1341 | 34 | </method> | ||
1342 | 35 | |||
1343 | 36 | <method name="ActivateConnection"> | ||
1344 | 37 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_activate_connection"/> | ||
1345 | 38 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1346 | 39 | <tp:docstring> | ||
1347 | 40 | Activate a connection using the supplied device. | ||
1348 | 41 | </tp:docstring> | ||
1349 | 42 | <arg name="connection" type="o" direction="in"> | ||
1350 | 43 | <tp:docstring> | ||
1351 | 44 | The connection to activate the devices with. | ||
1352 | 45 | </tp:docstring> | ||
1353 | 46 | </arg> | ||
1354 | 47 | <arg name="device" type="o" direction="in"> | ||
1355 | 48 | <tp:docstring> | ||
1356 | 49 | The object path of device to be activated for physical connections. This parameter is ignored for VPN connections, because the specific_object (if provided) specifies the device to use. | ||
1357 | 50 | </tp:docstring> | ||
1358 | 51 | </arg> | ||
1359 | 52 | <arg name="specific_object" type="o" direction="in"> | ||
1360 | 53 | <tp:docstring> | ||
1361 | 54 | The path of a connection-type-specific object this activation should use. | ||
1362 | 55 | This parameter is currently ignored for wired and mobile broadband connections, | ||
1363 | 56 | and the value of "/" should be used (ie, no specific object). For WiFi | ||
1364 | 57 | connections, pass the object path of a specific AP from the card's scan | ||
1365 | 58 | list, or "/" to pick and AP automatically. For VPN connections, pass | ||
1366 | 59 | the object path of an ActiveConnection object that should serve as the | ||
1367 | 60 | "base" connection (to which the VPN connections lifetime will be tied), | ||
1368 | 61 | or pass "/" and NM will automatically use the current default device. | ||
1369 | 62 | </tp:docstring> | ||
1370 | 63 | </arg> | ||
1371 | 64 | <arg name="active_connection" type="o" direction="out"> | ||
1372 | 65 | <tp:docstring> | ||
1373 | 66 | The path of the active connection object representing this active connection. | ||
1374 | 67 | </tp:docstring> | ||
1375 | 68 | </arg> | ||
1376 | 69 | <tp:possible-errors> | ||
1377 | 70 | <tp:error name="org.freedesktop.NetworkManager.Error.UnknownConnection"/> | ||
1378 | 71 | <tp:error name="org.freedesktop.NetworkManager.Error.UnknownDevice"/> | ||
1379 | 72 | <tp:error name="org.freedesktop.NetworkManager.Error.ConnectionActivating"> | ||
1380 | 73 | <tp:docstring>Another connection is already activating or the same connection is already active. FIXME: check if the error name is correct. FIXME: split into 2 errors?</tp:docstring> | ||
1381 | 74 | </tp:error> | ||
1382 | 75 | <tp:error name="org.freedesktop.NetworkManager.Error.ConnectionInvalid"> | ||
1383 | 76 | <tp:docstring>The connection is invalid for this device.</tp:docstring> | ||
1384 | 77 | </tp:error> | ||
1385 | 78 | </tp:possible-errors> | ||
1386 | 79 | </method> | ||
1387 | 80 | |||
1388 | 81 | <method name="AddAndActivateConnection"> | ||
1389 | 82 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_add_and_activate_connection"/> | ||
1390 | 83 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1391 | 84 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantDictMap"/> | ||
1392 | 85 | <tp:docstring> | ||
1393 | 86 | Adds a new connection using the given details (if any) as a template | ||
1394 | 87 | (automatically filling in missing settings with the capabilities of the | ||
1395 | 88 | given device and specific object), then activate the new connection. | ||
1396 | 89 | Cannot be used for VPN connections at this time. | ||
1397 | 90 | </tp:docstring> | ||
1398 | 91 | <arg name="connection" type="a{sa{sv}}" direction="in"> | ||
1399 | 92 | <tp:docstring> | ||
1400 | 93 | Connection settings and properties; if incomplete missing settings will | ||
1401 | 94 | be automatically completed using the given device and specific object. | ||
1402 | 95 | </tp:docstring> | ||
1403 | 96 | </arg> | ||
1404 | 97 | <arg name="device" type="o" direction="in"> | ||
1405 | 98 | <tp:docstring> | ||
1406 | 99 | The object path of device to be activated using the given connection. | ||
1407 | 100 | </tp:docstring> | ||
1408 | 101 | </arg> | ||
1409 | 102 | <arg name="specific_object" type="o" direction="in"> | ||
1410 | 103 | <tp:docstring> | ||
1411 | 104 | The path of a connection-type-specific object this activation should use. | ||
1412 | 105 | This parameter is currently ignored for wired and mobile broadband connections, | ||
1413 | 106 | and the value of "/" should be used (ie, no specific object). For WiFi | ||
1414 | 107 | connections, pass the object path of a specific AP from the card's scan | ||
1415 | 108 | list, which will be used to complete the details of the newly added | ||
1416 | 109 | connection. | ||
1417 | 110 | </tp:docstring> | ||
1418 | 111 | </arg> | ||
1419 | 112 | <arg name="path" type="o" direction="out"> | ||
1420 | 113 | <tp:docstring> | ||
1421 | 114 | Object path of the new connection that was just added. | ||
1422 | 115 | </tp:docstring> | ||
1423 | 116 | </arg> | ||
1424 | 117 | <arg name="active_connection" type="o" direction="out"> | ||
1425 | 118 | <tp:docstring> | ||
1426 | 119 | The path of the active connection object representing this active connection. | ||
1427 | 120 | </tp:docstring> | ||
1428 | 121 | </arg> | ||
1429 | 122 | <tp:possible-errors> | ||
1430 | 123 | <tp:error name="org.freedesktop.NetworkManager.Error.UnknownConnection"/> | ||
1431 | 124 | <tp:error name="org.freedesktop.NetworkManager.Error.UnknownDevice"/> | ||
1432 | 125 | <tp:error name="org.freedesktop.NetworkManager.Error.ConnectionInvalid"> | ||
1433 | 126 | <tp:docstring>The connection is invalid for this device.</tp:docstring> | ||
1434 | 127 | </tp:error> | ||
1435 | 128 | </tp:possible-errors> | ||
1436 | 129 | </method> | ||
1437 | 130 | |||
1438 | 131 | <method name="DeactivateConnection"> | ||
1439 | 132 | <tp:docstring> | ||
1440 | 133 | Deactivate an active connection. | ||
1441 | 134 | </tp:docstring> | ||
1442 | 135 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_deactivate_connection"/> | ||
1443 | 136 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1444 | 137 | <arg name="active_connection" type="o" direction="in"> | ||
1445 | 138 | <tp:docstring> | ||
1446 | 139 | The currently active connection to deactivate. | ||
1447 | 140 | </tp:docstring> | ||
1448 | 141 | </arg> | ||
1449 | 142 | </method> | ||
1450 | 143 | |||
1451 | 144 | <method name="Sleep"> | ||
1452 | 145 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_sleep"/> | ||
1453 | 146 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1454 | 147 | <tp:docstring> | ||
1455 | 148 | Control the NetworkManager daemon's sleep state. When asleep, all | ||
1456 | 149 | interfaces that it manages are deactivated. When awake, devices are | ||
1457 | 150 | available to be activated. This command should not be called directly | ||
1458 | 151 | by users or clients; it is intended for system suspend/resume tracking. | ||
1459 | 152 | </tp:docstring> | ||
1460 | 153 | <arg name="sleep" type="b" direction="in"> | ||
1461 | 154 | <tp:docstring> | ||
1462 | 155 | Indicates whether the NetworkManager daemon should sleep or wake. | ||
1463 | 156 | </tp:docstring> | ||
1464 | 157 | </arg> | ||
1465 | 158 | </method> | ||
1466 | 159 | |||
1467 | 160 | <method name="Enable"> | ||
1468 | 161 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_enable"/> | ||
1469 | 162 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1470 | 163 | <tp:docstring> | ||
1471 | 164 | Control whether overall networking is enabled or disabled. When | ||
1472 | 165 | disabled, all interfaces that NM manages are deactivated. When enabled, | ||
1473 | 166 | all managed interfaces are re-enabled and available to be activated. | ||
1474 | 167 | This command should be used by clients that provide to users the ability | ||
1475 | 168 | to enable/disable all networking. | ||
1476 | 169 | </tp:docstring> | ||
1477 | 170 | <arg name="enable" type="b" direction="in"> | ||
1478 | 171 | <tp:docstring> | ||
1479 | 172 | If FALSE, indicates that all networking should be disabled. If TRUE, | ||
1480 | 173 | indicates that NetworkManager should begin managing network devices. | ||
1481 | 174 | </tp:docstring> | ||
1482 | 175 | </arg> | ||
1483 | 176 | </method> | ||
1484 | 177 | |||
1485 | 178 | <method name="GetPermissions"> | ||
1486 | 179 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_permissions"/> | ||
1487 | 180 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1488 | 181 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
1489 | 182 | <tp:docstring> | ||
1490 | 183 | Returns the permissions a caller has for various authenticated operations | ||
1491 | 184 | that NetworkManager provides, like Enable/Disable networking, changing | ||
1492 | 185 | WiFi, WWAN, and WiMAX state, etc. | ||
1493 | 186 | </tp:docstring> | ||
1494 | 187 | <arg name="permissions" type="a{ss}" direction="out"> | ||
1495 | 188 | <tp:docstring> | ||
1496 | 189 | Dictionary of available permissions and results. Each permission | ||
1497 | 190 | is represented by a name (ie "org.freedesktop.NetworkManager.Foobar") | ||
1498 | 191 | and each result is one of the following values: "yes" (the permission | ||
1499 | 192 | is available), "auth" (the permission is available after a successful | ||
1500 | 193 | authentication), or "no" (the permission is denied). Clients may use | ||
1501 | 194 | these values in the UI to indicate the ability to perform certain | ||
1502 | 195 | operations. | ||
1503 | 196 | </tp:docstring> | ||
1504 | 197 | </arg> | ||
1505 | 198 | </method> | ||
1506 | 199 | |||
1507 | 200 | <signal name="CheckPermissions"> | ||
1508 | 201 | <tp:docstring> | ||
1509 | 202 | Emitted when system authorization details change, indicating that | ||
1510 | 203 | clients may wish to recheck permissions with GetPermissions. | ||
1511 | 204 | </tp:docstring> | ||
1512 | 205 | </signal> | ||
1513 | 206 | |||
1514 | 207 | <method name="SetLogging"> | ||
1515 | 208 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_set_logging"/> | ||
1516 | 209 | <tp:docstring> | ||
1517 | 210 | Set logging verbosity and which operations are logged. | ||
1518 | 211 | </tp:docstring> | ||
1519 | 212 | <arg name="level" type="s" direction="in"> | ||
1520 | 213 | <tp:docstring> | ||
1521 | 214 | One of [ERR, WARN, INFO, DEBUG]. | ||
1522 | 215 | </tp:docstring> | ||
1523 | 216 | </arg> | ||
1524 | 217 | <arg name="domains" type="s" direction="in"> | ||
1525 | 218 | <tp:docstring> | ||
1526 | 219 | A combination of logging domains separated by commas (','), or "NONE" | ||
1527 | 220 | to disable logging. Each domain enables logging for operations | ||
1528 | 221 | related to that domain. Available domains are: [HW, RFKILL, ETHER, | ||
1529 | 222 | WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, | ||
1530 | 223 | VPN, SHARING, SUPPLICANT, AGENTS, SETTINGS, SUSPEND, CORE, DEVICE, | ||
1531 | 224 | OLPC, WIMAX, INFINIBAND, FIREWALL, ADSL, BOND, VLAN]. In addition to | ||
1532 | 225 | these domains, the following special domains can be used: [NONE, ALL, | ||
1533 | 226 | DEFAULT, DHCP, IP]. If an empty string is given, the log level is | ||
1534 | 227 | changed but the current set of log domains remains unchanged. | ||
1535 | 228 | </tp:docstring> | ||
1536 | 229 | </arg> | ||
1537 | 230 | </method> | ||
1538 | 231 | |||
1539 | 232 | <method name="GetLogging"> | ||
1540 | 233 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_logging"/> | ||
1541 | 234 | <tp:docstring> | ||
1542 | 235 | Get current logging verbosity level and operations domains. | ||
1543 | 236 | </tp:docstring> | ||
1544 | 237 | <arg name="level" type="s" direction="out"> | ||
1545 | 238 | <tp:docstring> | ||
1546 | 239 | One of [ERR, WARN, INFO, DEBUG]. | ||
1547 | 240 | </tp:docstring> | ||
1548 | 241 | </arg> | ||
1549 | 242 | <arg name="domains" type="s" direction="out"> | ||
1550 | 243 | <tp:docstring> | ||
1551 | 244 | For available domains see SetLogging() call. | ||
1552 | 245 | </tp:docstring> | ||
1553 | 246 | </arg> | ||
1554 | 247 | </method> | ||
1555 | 248 | |||
1556 | 249 | <method name="state"> | ||
1557 | 250 | <tp:docstring> | ||
1558 | 251 | The overall networking state as determined by the NetworkManager daemon, | ||
1559 | 252 | based on the state of network devices under it's management. | ||
1560 | 253 | </tp:docstring> | ||
1561 | 254 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_state"/> | ||
1562 | 255 | <arg name="state" type="u" direction="out" tp:type="NM_STATE"/> | ||
1563 | 256 | </method> | ||
1564 | 257 | |||
1565 | 258 | <property name="NetworkingEnabled" type="b" access="read"> | ||
1566 | 259 | <tp:docstring> | ||
1567 | 260 | Indicates if overall networking is currently enabled or not. See the | ||
1568 | 261 | Enable() method. | ||
1569 | 262 | </tp:docstring> | ||
1570 | 263 | </property> | ||
1571 | 264 | |||
1572 | 265 | <property name="WirelessEnabled" type="b" access="readwrite"> | ||
1573 | 266 | <tp:docstring> | ||
1574 | 267 | Indicates if wireless is currently enabled or not. | ||
1575 | 268 | </tp:docstring> | ||
1576 | 269 | </property> | ||
1577 | 270 | |||
1578 | 271 | <property name="WirelessHardwareEnabled" type="b" access="read"> | ||
1579 | 272 | <tp:docstring> | ||
1580 | 273 | Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch. | ||
1581 | 274 | </tp:docstring> | ||
1582 | 275 | </property> | ||
1583 | 276 | |||
1584 | 277 | <property name="WwanEnabled" type="b" access="readwrite"> | ||
1585 | 278 | <tp:docstring> | ||
1586 | 279 | Indicates if mobile broadband devices are currently enabled or not. | ||
1587 | 280 | </tp:docstring> | ||
1588 | 281 | </property> | ||
1589 | 282 | |||
1590 | 283 | <property name="WwanHardwareEnabled" type="b" access="read"> | ||
1591 | 284 | <tp:docstring> | ||
1592 | 285 | Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch. | ||
1593 | 286 | </tp:docstring> | ||
1594 | 287 | </property> | ||
1595 | 288 | |||
1596 | 289 | <property name="WimaxEnabled" type="b" access="readwrite"> | ||
1597 | 290 | <tp:docstring> | ||
1598 | 291 | Indicates if WiMAX devices are currently enabled or not. | ||
1599 | 292 | </tp:docstring> | ||
1600 | 293 | </property> | ||
1601 | 294 | |||
1602 | 295 | <property name="WimaxHardwareEnabled" type="b" access="read"> | ||
1603 | 296 | <tp:docstring> | ||
1604 | 297 | Indicates if the WiMAX hardware is currently enabled, i.e. the state of the RF kill switch. | ||
1605 | 298 | </tp:docstring> | ||
1606 | 299 | </property> | ||
1607 | 300 | |||
1608 | 301 | <property name="ActiveConnections" type="ao" access="read"> | ||
1609 | 302 | <tp:docstring> | ||
1610 | 303 | List of active connection object paths. | ||
1611 | 304 | </tp:docstring> | ||
1612 | 305 | </property> | ||
1613 | 306 | |||
1614 | 307 | <property name="Version" type="s" access="read"> | ||
1615 | 308 | <tp:docstring> | ||
1616 | 309 | NetworkManager version. | ||
1617 | 310 | </tp:docstring> | ||
1618 | 311 | </property> | ||
1619 | 312 | |||
1620 | 313 | <property name="State" type="u" access="read" tp:type="NM_STATE"> | ||
1621 | 314 | <tp:docstring> | ||
1622 | 315 | The overall state of the NetworkManager daemon. | ||
1623 | 316 | </tp:docstring> | ||
1624 | 317 | </property> | ||
1625 | 318 | |||
1626 | 319 | <signal name="StateChanged"> | ||
1627 | 320 | <tp:docstring> | ||
1628 | 321 | NetworkManager's state changed. | ||
1629 | 322 | </tp:docstring> | ||
1630 | 323 | <arg name="state" type="u" tp:type="NM_STATE"> | ||
1631 | 324 | <tp:docstring> | ||
1632 | 325 | The new state of NetworkManager. | ||
1633 | 326 | </tp:docstring> | ||
1634 | 327 | </arg> | ||
1635 | 328 | </signal> | ||
1636 | 329 | |||
1637 | 330 | <signal name="PropertiesChanged"> | ||
1638 | 331 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
1639 | 332 | <tp:docstring> | ||
1640 | 333 | NetworkManager's properties changed. | ||
1641 | 334 | </tp:docstring> | ||
1642 | 335 | <arg name="properties" type="a{sv}" tp:type="String_Variant_Map"> | ||
1643 | 336 | <tp:docstring> | ||
1644 | 337 | The changed properties. | ||
1645 | 338 | </tp:docstring> | ||
1646 | 339 | </arg> | ||
1647 | 340 | </signal> | ||
1648 | 341 | |||
1649 | 342 | <signal name="DeviceAdded"> | ||
1650 | 343 | <tp:docstring> | ||
1651 | 344 | A device was added to the system | ||
1652 | 345 | </tp:docstring> | ||
1653 | 346 | <arg name="device_path" type="o"> | ||
1654 | 347 | <tp:docstring> | ||
1655 | 348 | The object path of the newly added device. | ||
1656 | 349 | </tp:docstring> | ||
1657 | 350 | </arg> | ||
1658 | 351 | </signal> | ||
1659 | 352 | |||
1660 | 353 | <signal name="DeviceRemoved"> | ||
1661 | 354 | <tp:docstring> | ||
1662 | 355 | A device was removed from the system, and is no longer available. | ||
1663 | 356 | </tp:docstring> | ||
1664 | 357 | <arg name="device_path" type="o"> | ||
1665 | 358 | <tp:docstring> | ||
1666 | 359 | The object path of the device that was just removed. | ||
1667 | 360 | </tp:docstring> | ||
1668 | 361 | </arg> | ||
1669 | 362 | </signal> | ||
1670 | 363 | |||
1671 | 364 | <tp:enum name="NM_STATE" type="u"> | ||
1672 | 365 | <tp:docstring> | ||
1673 | 366 | Describes the overall state of the daemon. | ||
1674 | 367 | </tp:docstring> | ||
1675 | 368 | <tp:enumvalue suffix="UNKNOWN" value="0"> | ||
1676 | 369 | <tp:docstring> | ||
1677 | 370 | Networking state is unknown. | ||
1678 | 371 | </tp:docstring> | ||
1679 | 372 | </tp:enumvalue> | ||
1680 | 373 | <tp:enumvalue suffix="ASLEEP" value="10"> | ||
1681 | 374 | <tp:docstring> | ||
1682 | 375 | Networking is inactive and all devices are disabled. | ||
1683 | 376 | </tp:docstring> | ||
1684 | 377 | </tp:enumvalue> | ||
1685 | 378 | <tp:enumvalue suffix="DISCONNECTED" value="20"> | ||
1686 | 379 | <tp:docstring> | ||
1687 | 380 | There is no active network connection. | ||
1688 | 381 | </tp:docstring> | ||
1689 | 382 | </tp:enumvalue> | ||
1690 | 383 | <tp:enumvalue suffix="DISCONNECTING" value="30"> | ||
1691 | 384 | <tp:docstring> | ||
1692 | 385 | Network connections are being cleaned up. | ||
1693 | 386 | </tp:docstring> | ||
1694 | 387 | </tp:enumvalue> | ||
1695 | 388 | <tp:enumvalue suffix="CONNECTING" value="40"> | ||
1696 | 389 | <tp:docstring> | ||
1697 | 390 | A network device is connecting to a network and there is no other | ||
1698 | 391 | available network connection. | ||
1699 | 392 | </tp:docstring> | ||
1700 | 393 | </tp:enumvalue> | ||
1701 | 394 | <tp:enumvalue suffix="CONNECTED_LOCAL" value="50"> | ||
1702 | 395 | <tp:docstring> | ||
1703 | 396 | A network device is connected, but there is only link-local connectivity. | ||
1704 | 397 | </tp:docstring> | ||
1705 | 398 | </tp:enumvalue> | ||
1706 | 399 | <tp:enumvalue suffix="CONNECTED_SITE" value="60"> | ||
1707 | 400 | <tp:docstring> | ||
1708 | 401 | A network device is connected, but there is only site-local connectivity. | ||
1709 | 402 | </tp:docstring> | ||
1710 | 403 | </tp:enumvalue> | ||
1711 | 404 | <tp:enumvalue suffix="CONNECTED_GLOBAL" value="70"> | ||
1712 | 405 | <tp:docstring> | ||
1713 | 406 | A network device is connected, with global network connectivity. | ||
1714 | 407 | </tp:docstring> | ||
1715 | 408 | </tp:enumvalue> | ||
1716 | 409 | </tp:enum> | ||
1717 | 410 | |||
1718 | 411 | </interface> | ||
1719 | 412 | </node> | ||
1720 | 0 | 413 | ||
1721 | === added file 'data/nm-settings-connection.xml' | |||
1722 | --- data/nm-settings-connection.xml 1970-01-01 00:00:00 +0000 | |||
1723 | +++ data/nm-settings-connection.xml 2015-04-01 15:30:55 +0000 | |||
1724 | @@ -0,0 +1,157 @@ | |||
1725 | 1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
1726 | 2 | |||
1727 | 3 | <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> | ||
1728 | 4 | |||
1729 | 5 | <interface name="org.freedesktop.NetworkManager.Settings.Connection"> | ||
1730 | 6 | <tp:docstring> | ||
1731 | 7 | Represents a single network connection configuration. | ||
1732 | 8 | </tp:docstring> | ||
1733 | 9 | |||
1734 | 10 | <method name="Update"> | ||
1735 | 11 | <tp:docstring> | ||
1736 | 12 | Update the connection with new settings and properties (replacing | ||
1737 | 13 | all previous settings and properties) and save the connection to | ||
1738 | 14 | disk. Secrets may be part of the update request, and will be either | ||
1739 | 15 | stored in persistent storage or sent to a Secret Agent for storage, | ||
1740 | 16 | depending on the flags associated with each secret. | ||
1741 | 17 | </tp:docstring> | ||
1742 | 18 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_update"/> | ||
1743 | 19 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1744 | 20 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantDictMap"/> | ||
1745 | 21 | <arg name="properties" type="a{sa{sv}}" direction="in"> | ||
1746 | 22 | <tp:docstring> | ||
1747 | 23 | New connection settings, properties, and (optionally) secrets. | ||
1748 | 24 | </tp:docstring> | ||
1749 | 25 | </arg> | ||
1750 | 26 | </method> | ||
1751 | 27 | |||
1752 | 28 | <method name="UpdateUnsaved"> | ||
1753 | 29 | <tp:docstring> | ||
1754 | 30 | Update the connection with new settings and properties (replacing | ||
1755 | 31 | all previous settings and properties) but do not immediately save | ||
1756 | 32 | the connection to disk. Secrets may be part of the update request | ||
1757 | 33 | and may sent to a Secret Agent for storage, depending on the | ||
1758 | 34 | flags associated with each secret. | ||
1759 | 35 | |||
1760 | 36 | Use the 'Save' method to save these changes to disk. Note | ||
1761 | 37 | that unsaved changes will be lost if the connection is | ||
1762 | 38 | reloaded from disk (either automatically on file change or | ||
1763 | 39 | due to an explicit ReloadConnections call). | ||
1764 | 40 | </tp:docstring> | ||
1765 | 41 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_update_unsaved"/> | ||
1766 | 42 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1767 | 43 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantDictMap"/> | ||
1768 | 44 | <arg name="properties" type="a{sa{sv}}" direction="in"> | ||
1769 | 45 | <tp:docstring> | ||
1770 | 46 | New connection settings, properties, and (optionally) secrets. | ||
1771 | 47 | </tp:docstring> | ||
1772 | 48 | </arg> | ||
1773 | 49 | </method> | ||
1774 | 50 | |||
1775 | 51 | <method name="Delete"> | ||
1776 | 52 | <tp:docstring> | ||
1777 | 53 | Delete the connection. | ||
1778 | 54 | </tp:docstring> | ||
1779 | 55 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_delete"/> | ||
1780 | 56 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1781 | 57 | </method> | ||
1782 | 58 | |||
1783 | 59 | <method name="GetSettings"> | ||
1784 | 60 | <tp:docstring> | ||
1785 | 61 | Get the settings maps describing this network configuration. | ||
1786 | 62 | This will never include any secrets required for connection | ||
1787 | 63 | to the network, as those are often protected. Secrets must | ||
1788 | 64 | be requested separately using the GetSecrets() call. | ||
1789 | 65 | </tp:docstring> | ||
1790 | 66 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_get_settings"/> | ||
1791 | 67 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1792 | 68 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantDictMap"/> | ||
1793 | 69 | <arg name="settings" type="a{sa{sv}}" direction="out" tp:type="String_String_Variant_Map_Map"> | ||
1794 | 70 | <tp:docstring> | ||
1795 | 71 | The nested settings maps describing this object. | ||
1796 | 72 | </tp:docstring> | ||
1797 | 73 | </arg> | ||
1798 | 74 | </method> | ||
1799 | 75 | |||
1800 | 76 | <method name="GetSecrets"> | ||
1801 | 77 | <tp:docstring> | ||
1802 | 78 | Get the secrets belonging to this network configuration. Only | ||
1803 | 79 | secrets from persistent storage or a Secret Agent running in | ||
1804 | 80 | the requestor's session will be returned. The user will never | ||
1805 | 81 | be prompted for secrets as a result of this request. | ||
1806 | 82 | </tp:docstring> | ||
1807 | 83 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_get_secrets"/> | ||
1808 | 84 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1809 | 85 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantDictMap"/> | ||
1810 | 86 | <arg name="setting_name" type="s" direction="in"> | ||
1811 | 87 | <tp:docstring> | ||
1812 | 88 | Name of the setting to return secrets for. If empty, all | ||
1813 | 89 | all secrets will be returned. | ||
1814 | 90 | </tp:docstring> | ||
1815 | 91 | </arg> | ||
1816 | 92 | |||
1817 | 93 | <arg name="secrets" type="a{sa{sv}}" direction="out" tp:type="String_String_Variant_Map_Map"> | ||
1818 | 94 | <tp:docstring> | ||
1819 | 95 | Nested settings maps containing secrets. | ||
1820 | 96 | </tp:docstring> | ||
1821 | 97 | </arg> | ||
1822 | 98 | </method> | ||
1823 | 99 | |||
1824 | 100 | <method name="ClearSecrets"> | ||
1825 | 101 | <tp:docstring> | ||
1826 | 102 | Clear the secrets belonging to this network connection profile. | ||
1827 | 103 | </tp:docstring> | ||
1828 | 104 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_clear_secrets"/> | ||
1829 | 105 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1830 | 106 | </method> | ||
1831 | 107 | |||
1832 | 108 | <method name="Save"> | ||
1833 | 109 | <tp:docstring> | ||
1834 | 110 | Saves a "dirty" connection (that had previously been | ||
1835 | 111 | updated with UpdateUnsaved) to persistent storage. | ||
1836 | 112 | </tp:docstring> | ||
1837 | 113 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_save"/> | ||
1838 | 114 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
1839 | 115 | </method> | ||
1840 | 116 | |||
1841 | 117 | <signal name="Updated"> | ||
1842 | 118 | <tp:docstring> | ||
1843 | 119 | Emitted when any settings or permissions change. When handling | ||
1844 | 120 | this signal, clients should re-read the connection using the | ||
1845 | 121 | GetSettings method to get the changes and to ensure the client | ||
1846 | 122 | still has permission to access the connection. | ||
1847 | 123 | </tp:docstring> | ||
1848 | 124 | </signal> | ||
1849 | 125 | |||
1850 | 126 | <signal name="Removed"> | ||
1851 | 127 | <tp:docstring> | ||
1852 | 128 | Emitted when this connection is no longer available. This | ||
1853 | 129 | happens when the connection is deleted or if it is no longer | ||
1854 | 130 | accessible by any of the system's logged-in users. After | ||
1855 | 131 | receipt of this signal, the object no longer exists. Also | ||
1856 | 132 | see the Settings.ConnectionRemoved signal. | ||
1857 | 133 | </tp:docstring> | ||
1858 | 134 | </signal> | ||
1859 | 135 | |||
1860 | 136 | <property name="Unsaved" type="b" access="read"> | ||
1861 | 137 | <tp:docstring> | ||
1862 | 138 | If set, indicates that the in-memory state of the | ||
1863 | 139 | connection does not match the on-disk state. This flag | ||
1864 | 140 | will be set when UpdateUnsaved() is called or when any | ||
1865 | 141 | connection details change, and cleared when the connection | ||
1866 | 142 | is saved to disk via Save() or from internal operations. | ||
1867 | 143 | </tp:docstring> | ||
1868 | 144 | </property> | ||
1869 | 145 | |||
1870 | 146 | <signal name="PropertiesChanged"> | ||
1871 | 147 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
1872 | 148 | <arg name="properties" type="a{sv}" tp:type="String_Variant_Map"> | ||
1873 | 149 | <tp:docstring> | ||
1874 | 150 | A dictionary mapping property names to variant boxed values. | ||
1875 | 151 | </tp:docstring> | ||
1876 | 152 | </arg> | ||
1877 | 153 | </signal> | ||
1878 | 154 | |||
1879 | 155 | </interface> | ||
1880 | 156 | |||
1881 | 157 | </node> | ||
1882 | 0 | 158 | ||
1883 | === added file 'data/org.freedesktop.URfkill.Device.xml' | |||
1884 | --- data/org.freedesktop.URfkill.Device.xml 1970-01-01 00:00:00 +0000 | |||
1885 | +++ data/org.freedesktop.URfkill.Device.xml 2015-04-01 15:30:55 +0000 | |||
1886 | @@ -0,0 +1,143 @@ | |||
1887 | 1 | <!DOCTYPE node PUBLIC | ||
1888 | 2 | "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
1889 | 3 | "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
1890 | 4 | <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
1891 | 5 | |||
1892 | 6 | <interface name="org.freedesktop.URfkill.Device"> | ||
1893 | 7 | <doc:doc> | ||
1894 | 8 | <doc:description> | ||
1895 | 9 | <doc:para> | ||
1896 | 10 | Objects implementing this interface are usually discovered through | ||
1897 | 11 | the <doc:tt>org.freedesktop.URfkill</doc:tt> interface on | ||
1898 | 12 | the <doc:tt>/org/freedesktop/URfkill</doc:tt> object on | ||
1899 | 13 | the D-Bus system bus service with the well-known | ||
1900 | 14 | name <doc:tt>org.freedesktop.URfkill</doc:tt> using | ||
1901 | 15 | the | ||
1902 | 16 | <doc:ref type="method" to="Rfkill.EnumerateDevices">EnumerateDevices</doc:ref> | ||
1903 | 17 | method. | ||
1904 | 18 | </doc:para> | ||
1905 | 19 | <doc:para> | ||
1906 | 20 | <doc:example language="shell" title="simple example"> | ||
1907 | 21 | <doc:code> | ||
1908 | 22 | $ gdbus call -y \ | ||
1909 | 23 | -d org.freedesktop.URfkill \ | ||
1910 | 24 | -o /org/freedesktop/URfkill/devices/0 \ | ||
1911 | 25 | -m org.freedesktop.DBus.Properties.GetAll \ | ||
1912 | 26 | "org.freedesktop.URfkill.Device" | ||
1913 | 27 | |||
1914 | 28 | ({'index': <uint32 0>, 'type': <uint32 2>, 'name': <'tpacpi_bluetooth_sw'>, 'soft': <true>, 'hard': <true>, 'platform': <true>},) | ||
1915 | 29 | </doc:code> | ||
1916 | 30 | </doc:example> | ||
1917 | 31 | </doc:para> | ||
1918 | 32 | </doc:description> | ||
1919 | 33 | </doc:doc> | ||
1920 | 34 | |||
1921 | 35 | <!-- ************************************************************ --> | ||
1922 | 36 | |||
1923 | 37 | <signal name="Changed"> | ||
1924 | 38 | <doc:doc> | ||
1925 | 39 | <doc:description> | ||
1926 | 40 | <doc:para> | ||
1927 | 41 | Emitted when a property of the device is changed. | ||
1928 | 42 | </doc:para> | ||
1929 | 43 | <doc:para> | ||
1930 | 44 | Note: This signal is deprecated since 0.4.0. Use the standard signal, | ||
1931 | 45 | PropertiesChanged from org.freedesktop.DBus.Properties instead. | ||
1932 | 46 | </doc:para> | ||
1933 | 47 | </doc:description> | ||
1934 | 48 | </doc:doc> | ||
1935 | 49 | </signal> | ||
1936 | 50 | |||
1937 | 51 | <!-- ************************************************************ --> | ||
1938 | 52 | |||
1939 | 53 | <property name="index" type="u" access="read"> | ||
1940 | 54 | <doc:doc> | ||
1941 | 55 | <doc:description> | ||
1942 | 56 | <doc:para> | ||
1943 | 57 | The index of the rfkill device | ||
1944 | 58 | </doc:para> | ||
1945 | 59 | </doc:description> | ||
1946 | 60 | </doc:doc> | ||
1947 | 61 | </property> | ||
1948 | 62 | |||
1949 | 63 | <property name="type" type="u" access="read"> | ||
1950 | 64 | <doc:doc> | ||
1951 | 65 | <doc:description> | ||
1952 | 66 | <doc:para> | ||
1953 | 67 | The type of the rfkill device | ||
1954 | 68 | </doc:para> | ||
1955 | 69 | <doc:list> | ||
1956 | 70 | <doc:item> | ||
1957 | 71 | <doc:term>0</doc:term><doc:definition>All</doc:definition> | ||
1958 | 72 | </doc:item> | ||
1959 | 73 | <doc:item> | ||
1960 | 74 | <doc:term>1</doc:term><doc:definition>WLAN</doc:definition> | ||
1961 | 75 | </doc:item> | ||
1962 | 76 | <doc:item> | ||
1963 | 77 | <doc:term>2</doc:term><doc:definition>Bluetooth</doc:definition> | ||
1964 | 78 | </doc:item> | ||
1965 | 79 | <doc:item> | ||
1966 | 80 | <doc:term>3</doc:term><doc:definition>UWB</doc:definition> | ||
1967 | 81 | </doc:item> | ||
1968 | 82 | <doc:item> | ||
1969 | 83 | <doc:term>4</doc:term><doc:definition>WIMAX</doc:definition> | ||
1970 | 84 | </doc:item> | ||
1971 | 85 | <doc:item> | ||
1972 | 86 | <doc:term>5</doc:term><doc:definition>WWAN</doc:definition> | ||
1973 | 87 | </doc:item> | ||
1974 | 88 | <doc:item> | ||
1975 | 89 | <doc:term>6</doc:term><doc:definition>GPS</doc:definition> | ||
1976 | 90 | </doc:item> | ||
1977 | 91 | <doc:item> | ||
1978 | 92 | <doc:term>7</doc:term><doc:definition>FM</doc:definition> | ||
1979 | 93 | </doc:item> | ||
1980 | 94 | <doc:item> | ||
1981 | 95 | <doc:term>8</doc:term><doc:definition>NFC</doc:definition> | ||
1982 | 96 | </doc:item> | ||
1983 | 97 | </doc:list> | ||
1984 | 98 | </doc:description> | ||
1985 | 99 | </doc:doc> | ||
1986 | 100 | </property> | ||
1987 | 101 | |||
1988 | 102 | <property name="name" type="s" access="read"> | ||
1989 | 103 | <doc:doc> | ||
1990 | 104 | <doc:description> | ||
1991 | 105 | <doc:para> | ||
1992 | 106 | The name of the rfkill device | ||
1993 | 107 | </doc:para> | ||
1994 | 108 | </doc:description> | ||
1995 | 109 | </doc:doc> | ||
1996 | 110 | </property> | ||
1997 | 111 | |||
1998 | 112 | <property name="soft" type="b" access="read"> | ||
1999 | 113 | <doc:doc> | ||
2000 | 114 | <doc:description> | ||
2001 | 115 | <doc:para> | ||
2002 | 116 | Whether the soft block of the device is on or not | ||
2003 | 117 | </doc:para> | ||
2004 | 118 | </doc:description> | ||
2005 | 119 | </doc:doc> | ||
2006 | 120 | </property> | ||
2007 | 121 | |||
2008 | 122 | <property name="hard" type="b" access="read"> | ||
2009 | 123 | <doc:doc> | ||
2010 | 124 | <doc:description> | ||
2011 | 125 | <doc:para> | ||
2012 | 126 | Whether the hard block of the device is on or not | ||
2013 | 127 | </doc:para> | ||
2014 | 128 | </doc:description> | ||
2015 | 129 | </doc:doc> | ||
2016 | 130 | </property> | ||
2017 | 131 | |||
2018 | 132 | <property name="platform" type="b" access="read"> | ||
2019 | 133 | <doc:doc> | ||
2020 | 134 | <doc:description> | ||
2021 | 135 | <doc:para> | ||
2022 | 136 | Whether the device is generated by a platform driver or not | ||
2023 | 137 | </doc:para> | ||
2024 | 138 | </doc:description> | ||
2025 | 139 | </doc:doc> | ||
2026 | 140 | </property> | ||
2027 | 141 | |||
2028 | 142 | </interface> | ||
2029 | 143 | </node> | ||
2030 | 0 | 144 | ||
2031 | === added file 'data/org.freedesktop.URfkill.Killswitch.xml' | |||
2032 | --- data/org.freedesktop.URfkill.Killswitch.xml 1970-01-01 00:00:00 +0000 | |||
2033 | +++ data/org.freedesktop.URfkill.Killswitch.xml 2015-04-01 15:30:55 +0000 | |||
2034 | @@ -0,0 +1,78 @@ | |||
2035 | 1 | <!DOCTYPE node PUBLIC | ||
2036 | 2 | "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
2037 | 3 | "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
2038 | 4 | <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
2039 | 5 | |||
2040 | 6 | <interface name="org.freedesktop.URfkill.Killswitch"> | ||
2041 | 7 | <doc:doc> | ||
2042 | 8 | <doc:description> | ||
2043 | 9 | <doc:para> | ||
2044 | 10 | Objects implementing this interface represent different types | ||
2045 | 11 | of killswitches and are discovered through the | ||
2046 | 12 | <doc:tt>org.freedesktop.URfkill.Killswitch</doc:tt> interface | ||
2047 | 13 | on the <doc:tt>/org/freedesktop/URfkill/TYPENAME</doc:tt> | ||
2048 | 14 | object on the D-Bus system bus service with the well-known | ||
2049 | 15 | name <doc:tt>org.freedesktop.URfkill</doc:tt>. The TYPENAME | ||
2050 | 16 | could be <doc:tt>"WLAN"</doc:tt>, <doc:tt>"BLUETOOTH"</doc:tt>, | ||
2051 | 17 | <doc:tt>"UWB"</doc:tt>, <doc:tt>"WIMAX"</doc:tt>, | ||
2052 | 18 | <doc:tt>"WWAN"</doc:tt>, <doc:tt>"GPS"</doc:tt>, | ||
2053 | 19 | <doc:tt>"FM"</doc:tt>, or <doc:tt>"NFC"</doc:tt>. | ||
2054 | 20 | </doc:para> | ||
2055 | 21 | <doc:para> | ||
2056 | 22 | <doc:example language="shell" title="simple example"> | ||
2057 | 23 | <doc:code> | ||
2058 | 24 | $ gdbus call -y \ | ||
2059 | 25 | -d org.freedesktop.URfkill \ | ||
2060 | 26 | -o /org/freedesktop/URfkill/WLAN \ | ||
2061 | 27 | -m org.freedesktop.DBus.Properties.GetAll \ | ||
2062 | 28 | "org.freedesktop.URfkill.Killswitch" | ||
2063 | 29 | |||
2064 | 30 | ({'state': <2>},) | ||
2065 | 31 | </doc:code> | ||
2066 | 32 | </doc:example> | ||
2067 | 33 | </doc:para> | ||
2068 | 34 | </doc:description> | ||
2069 | 35 | </doc:doc> | ||
2070 | 36 | |||
2071 | 37 | <signal name="StateChanged"> | ||
2072 | 38 | <doc:doc> | ||
2073 | 39 | <doc:description> | ||
2074 | 40 | <doc:para> | ||
2075 | 41 | Emitted when the state of the killswitch changed. | ||
2076 | 42 | </doc:para> | ||
2077 | 43 | <doc:para> | ||
2078 | 44 | Note: This signal is deprecated since 0.4.0. Use the standard signal, | ||
2079 | 45 | PropertiesChanged from org.freedesktop.DBus.Properties instead. | ||
2080 | 46 | </doc:para> | ||
2081 | 47 | </doc:description> | ||
2082 | 48 | </doc:doc> | ||
2083 | 49 | </signal> | ||
2084 | 50 | |||
2085 | 51 | <!-- ************************************************************ --> | ||
2086 | 52 | |||
2087 | 53 | <property name="state" type="i" access="read"> | ||
2088 | 54 | <doc:doc> | ||
2089 | 55 | <doc:description> | ||
2090 | 56 | <doc:para> | ||
2091 | 57 | The state of the killswitch | ||
2092 | 58 | </doc:para> | ||
2093 | 59 | <doc:list> | ||
2094 | 60 | <doc:item> | ||
2095 | 61 | <doc:term>-1</doc:term><doc:definition>killswitch is not available.</doc:definition> | ||
2096 | 62 | </doc:item> | ||
2097 | 63 | <doc:item> | ||
2098 | 64 | <doc:term>0</doc:term><doc:definition>killswitch is unblocked.</doc:definition> | ||
2099 | 65 | </doc:item> | ||
2100 | 66 | <doc:item> | ||
2101 | 67 | <doc:term>1</doc:term><doc:definition>killswitch is soft-blocked.</doc:definition> | ||
2102 | 68 | </doc:item> | ||
2103 | 69 | <doc:item> | ||
2104 | 70 | <doc:term>2</doc:term><doc:definition>killswitch is hard-blocked.</doc:definition> | ||
2105 | 71 | </doc:item> | ||
2106 | 72 | </doc:list> | ||
2107 | 73 | </doc:description> | ||
2108 | 74 | </doc:doc> | ||
2109 | 75 | </property> | ||
2110 | 76 | |||
2111 | 77 | </interface> | ||
2112 | 78 | </node> | ||
2113 | 0 | 79 | ||
2114 | === added file 'data/org.freedesktop.URfkill.xml' | |||
2115 | --- data/org.freedesktop.URfkill.xml 1970-01-01 00:00:00 +0000 | |||
2116 | +++ data/org.freedesktop.URfkill.xml 2015-04-01 15:30:55 +0000 | |||
2117 | @@ -0,0 +1,388 @@ | |||
2118 | 1 | <!DOCTYPE node PUBLIC | ||
2119 | 2 | "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
2120 | 3 | "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
2121 | 4 | <node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> | ||
2122 | 5 | |||
2123 | 6 | <interface name="org.freedesktop.URfkill"> | ||
2124 | 7 | <doc:doc> | ||
2125 | 8 | <doc:description> | ||
2126 | 9 | <doc:para> | ||
2127 | 10 | The urfkill service is available via the system message | ||
2128 | 11 | bus. To access the service, use | ||
2129 | 12 | the <doc:tt>org.freedesktop.URfkill</doc:tt> interface on | ||
2130 | 13 | the <doc:tt>/org/freedesktop/URfkill</doc:tt> object on | ||
2131 | 14 | the D-Bus system bus service with the well-known | ||
2132 | 15 | name <doc:tt>org.freedesktop.URfkill</doc:tt>. | ||
2133 | 16 | </doc:para> | ||
2134 | 17 | <doc:para> | ||
2135 | 18 | <doc:example language="shell" title="simple example"> | ||
2136 | 19 | <doc:code> | ||
2137 | 20 | $ gdbus call -y \ | ||
2138 | 21 | -d org.freedesktop.URfkill \ | ||
2139 | 22 | -o /org/freedesktop/URfkill \ | ||
2140 | 23 | -m org.freedesktop.URfkill.EnumerateDevices | ||
2141 | 24 | |||
2142 | 25 | ([objectpath '/org/freedesktop/URfkill/devices/0', '/org/freedesktop/URfkill/devices/1'],) | ||
2143 | 26 | </doc:code> | ||
2144 | 27 | </doc:example> | ||
2145 | 28 | </doc:para> | ||
2146 | 29 | </doc:description> | ||
2147 | 30 | </doc:doc> | ||
2148 | 31 | |||
2149 | 32 | <!-- ************************************************************ --> | ||
2150 | 33 | |||
2151 | 34 | <method name="Block"> | ||
2152 | 35 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2153 | 36 | <arg type="u" name="type" direction="in"> | ||
2154 | 37 | <doc:doc><doc:summary> | ||
2155 | 38 | The type of devices to be blocked/unblocked | ||
2156 | 39 | </doc:summary></doc:doc> | ||
2157 | 40 | </arg> | ||
2158 | 41 | <arg type="b" name="block" direction="in"> | ||
2159 | 42 | <doc:doc><doc:summary> | ||
2160 | 43 | TRUE to block the devices, FALSE to unblock | ||
2161 | 44 | </doc:summary></doc:doc> | ||
2162 | 45 | </arg> | ||
2163 | 46 | <arg type="b" name="ret" direction="out"> | ||
2164 | 47 | <doc:doc><doc:summary> | ||
2165 | 48 | TRUE for success, otherwise FALSE | ||
2166 | 49 | </doc:summary></doc:doc> | ||
2167 | 50 | </arg> | ||
2168 | 51 | |||
2169 | 52 | <doc:doc> | ||
2170 | 53 | <doc:description> | ||
2171 | 54 | <doc:para> | ||
2172 | 55 | Block or unblock the devices belonging to the type. | ||
2173 | 56 | The types are defined as the followings: | ||
2174 | 57 | </doc:para> | ||
2175 | 58 | <doc:list> | ||
2176 | 59 | <doc:item> | ||
2177 | 60 | <doc:term>0</doc:term><doc:definition>All</doc:definition> | ||
2178 | 61 | </doc:item> | ||
2179 | 62 | <doc:item> | ||
2180 | 63 | <doc:term>1</doc:term><doc:definition>WLAN</doc:definition> | ||
2181 | 64 | </doc:item> | ||
2182 | 65 | <doc:item> | ||
2183 | 66 | <doc:term>2</doc:term><doc:definition>Bluetooth</doc:definition> | ||
2184 | 67 | </doc:item> | ||
2185 | 68 | <doc:item> | ||
2186 | 69 | <doc:term>3</doc:term><doc:definition>UWB</doc:definition> | ||
2187 | 70 | </doc:item> | ||
2188 | 71 | <doc:item> | ||
2189 | 72 | <doc:term>4</doc:term><doc:definition>WIMAX</doc:definition> | ||
2190 | 73 | </doc:item> | ||
2191 | 74 | <doc:item> | ||
2192 | 75 | <doc:term>5</doc:term><doc:definition>WWAN</doc:definition> | ||
2193 | 76 | </doc:item> | ||
2194 | 77 | <doc:item> | ||
2195 | 78 | <doc:term>6</doc:term><doc:definition>GPS</doc:definition> | ||
2196 | 79 | </doc:item> | ||
2197 | 80 | <doc:item> | ||
2198 | 81 | <doc:term>7</doc:term><doc:definition>FM</doc:definition> | ||
2199 | 82 | </doc:item> | ||
2200 | 83 | </doc:list> | ||
2201 | 84 | <doc:para> | ||
2202 | 85 | Note: This method only changes soft block. Hard block is controlled | ||
2203 | 86 | by BIOS or the hardware and there is no way to change the | ||
2204 | 87 | state of hard block through kernel functions. | ||
2205 | 88 | </doc:para> | ||
2206 | 89 | </doc:description> | ||
2207 | 90 | <doc:permission> | ||
2208 | 91 | This method is restricted to the active session user. | ||
2209 | 92 | </doc:permission> | ||
2210 | 93 | </doc:doc> | ||
2211 | 94 | </method> | ||
2212 | 95 | |||
2213 | 96 | <!-- ************************************************************ --> | ||
2214 | 97 | |||
2215 | 98 | <method name="BlockIdx"> | ||
2216 | 99 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2217 | 100 | <arg type="u" name="index" direction="in"> | ||
2218 | 101 | <doc:doc><doc:summary> | ||
2219 | 102 | The index of the device to be blocked/unblocked | ||
2220 | 103 | </doc:summary></doc:doc> | ||
2221 | 104 | </arg> | ||
2222 | 105 | <arg type="b" name="block" direction="in"> | ||
2223 | 106 | <doc:doc><doc:summary> | ||
2224 | 107 | TRUE to block the device, FALSE to unblock | ||
2225 | 108 | </doc:summary></doc:doc> | ||
2226 | 109 | </arg> | ||
2227 | 110 | <arg type="b" name="ret" direction="out"> | ||
2228 | 111 | <doc:doc><doc:summary> | ||
2229 | 112 | TRUE for success, otherwise FALSE | ||
2230 | 113 | </doc:summary></doc:doc> | ||
2231 | 114 | </arg> | ||
2232 | 115 | |||
2233 | 116 | <doc:doc> | ||
2234 | 117 | <doc:description> | ||
2235 | 118 | <doc:para> | ||
2236 | 119 | Block or unblock the device by the index. | ||
2237 | 120 | </doc:para> | ||
2238 | 121 | <doc:para> | ||
2239 | 122 | Note: This method only changes soft block. Hard block is controlled | ||
2240 | 123 | by BIOS or the hardware and there is no way to change the | ||
2241 | 124 | state of hard block through kernel functions. | ||
2242 | 125 | </doc:para> | ||
2243 | 126 | </doc:description> | ||
2244 | 127 | <doc:permission> | ||
2245 | 128 | This method is restricted to the currently active session user. | ||
2246 | 129 | </doc:permission> | ||
2247 | 130 | </doc:doc> | ||
2248 | 131 | </method> | ||
2249 | 132 | |||
2250 | 133 | <!-- ************************************************************ --> | ||
2251 | 134 | |||
2252 | 135 | <method name="EnumerateDevices"> | ||
2253 | 136 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2254 | 137 | <arg type="ao" name="array" direction="out"> | ||
2255 | 138 | <doc:doc><doc:summary> | ||
2256 | 139 | An array of the object pathes for the devices | ||
2257 | 140 | </doc:summary></doc:doc> | ||
2258 | 141 | </arg> | ||
2259 | 142 | |||
2260 | 143 | <doc:doc> | ||
2261 | 144 | <doc:description> | ||
2262 | 145 | <doc:para> | ||
2263 | 146 | Enumerate all rfkill objects on the system. | ||
2264 | 147 | </doc:para> | ||
2265 | 148 | </doc:description> | ||
2266 | 149 | </doc:doc> | ||
2267 | 150 | </method> | ||
2268 | 151 | |||
2269 | 152 | <!-- ************************************************************ --> | ||
2270 | 153 | |||
2271 | 154 | <method name="FlightMode"> | ||
2272 | 155 | <arg type="b" name="block" direction="in"> | ||
2273 | 156 | <doc:doc><doc:summary> | ||
2274 | 157 | TRUE of flight mode should be enabled, otherwise FALSE | ||
2275 | 158 | </doc:summary></doc:doc> | ||
2276 | 159 | </arg> | ||
2277 | 160 | <arg type="b" name="ret" direction="out"> | ||
2278 | 161 | <doc:doc><doc:summary> | ||
2279 | 162 | TRUE if successful, otherwise FALSE | ||
2280 | 163 | </doc:summary></doc:doc> | ||
2281 | 164 | </arg> | ||
2282 | 165 | |||
2283 | 166 | <doc:doc> | ||
2284 | 167 | <doc:description> | ||
2285 | 168 | <doc:para> | ||
2286 | 169 | Enable or disable flight mode. | ||
2287 | 170 | </doc:para> | ||
2288 | 171 | </doc:description> | ||
2289 | 172 | </doc:doc> | ||
2290 | 173 | </method> | ||
2291 | 174 | |||
2292 | 175 | <!-- ************************************************************ --> | ||
2293 | 176 | |||
2294 | 177 | <method name="IsFlightMode"> | ||
2295 | 178 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2296 | 179 | <arg type="b" name="is_flight_mode" direction="out"> | ||
2297 | 180 | <doc:doc><doc:summary> | ||
2298 | 181 | TRUE if flight mode is enabled, otherwise FALSE | ||
2299 | 182 | </doc:summary></doc:doc> | ||
2300 | 183 | </arg> | ||
2301 | 184 | |||
2302 | 185 | <doc:doc> | ||
2303 | 186 | <doc:description> | ||
2304 | 187 | <doc:para> | ||
2305 | 188 | Get whether flight mode is enabled or not. | ||
2306 | 189 | </doc:para> | ||
2307 | 190 | </doc:description> | ||
2308 | 191 | </doc:doc> | ||
2309 | 192 | </method> | ||
2310 | 193 | |||
2311 | 194 | <!-- ************************************************************ --> | ||
2312 | 195 | |||
2313 | 196 | <method name="IsInhibited"> | ||
2314 | 197 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2315 | 198 | <arg type="b" name="is_inhibited" direction="out"> | ||
2316 | 199 | <doc:doc><doc:summary> | ||
2317 | 200 | TRUE if the key control is inhibited, otherwise FALSE | ||
2318 | 201 | </doc:summary></doc:doc> | ||
2319 | 202 | </arg> | ||
2320 | 203 | |||
2321 | 204 | <doc:doc> | ||
2322 | 205 | <doc:description> | ||
2323 | 206 | <doc:para> | ||
2324 | 207 | Get whether the rfkill key handling function is inhibited or not. | ||
2325 | 208 | </doc:para> | ||
2326 | 209 | </doc:description> | ||
2327 | 210 | </doc:doc> | ||
2328 | 211 | </method> | ||
2329 | 212 | |||
2330 | 213 | <!-- ************************************************************ --> | ||
2331 | 214 | |||
2332 | 215 | <method name="Inhibit"> | ||
2333 | 216 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2334 | 217 | <arg type="s" name="reason" direction="in"> | ||
2335 | 218 | <doc:doc><doc:summary> | ||
2336 | 219 | The reason to inhibit the key control | ||
2337 | 220 | </doc:summary></doc:doc> | ||
2338 | 221 | </arg> | ||
2339 | 222 | <arg type="u" name="inhibit_cookie" direction="out"> | ||
2340 | 223 | <doc:doc><doc:summary> | ||
2341 | 224 | The cookie | ||
2342 | 225 | </doc:summary></doc:doc> | ||
2343 | 226 | </arg> | ||
2344 | 227 | |||
2345 | 228 | <doc:doc> | ||
2346 | 229 | <doc:description> | ||
2347 | 230 | <doc:para> | ||
2348 | 231 | Inhibit the rfkill key handling function for the session. | ||
2349 | 232 | </doc:para> | ||
2350 | 233 | </doc:description> | ||
2351 | 234 | </doc:doc> | ||
2352 | 235 | </method> | ||
2353 | 236 | |||
2354 | 237 | <!-- ************************************************************ --> | ||
2355 | 238 | |||
2356 | 239 | <method name="Uninhibit"> | ||
2357 | 240 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
2358 | 241 | <arg type="u" name="inhibit_cookie" direction="in"> | ||
2359 | 242 | <doc:doc><doc:summary> | ||
2360 | 243 | The cookie | ||
2361 | 244 | </doc:summary></doc:doc> | ||
2362 | 245 | </arg> | ||
2363 | 246 | |||
2364 | 247 | <doc:doc> | ||
2365 | 248 | <doc:description> | ||
2366 | 249 | <doc:para> | ||
2367 | 250 | Cancel a previous call to <doc:ref type="method" to="org.freedesktop.URfkill.Inhibit">Inhibit()</doc:ref> | ||
2368 | 251 | identified by the cookie. | ||
2369 | 252 | </doc:para> | ||
2370 | 253 | </doc:description> | ||
2371 | 254 | </doc:doc> | ||
2372 | 255 | </method> | ||
2373 | 256 | |||
2374 | 257 | <!-- ************************************************************ --> | ||
2375 | 258 | |||
2376 | 259 | <signal name="DeviceAdded"> | ||
2377 | 260 | <arg type="o" name="device" direction="out"> | ||
2378 | 261 | <doc:doc><doc:summary> | ||
2379 | 262 | The object path for the device that was added | ||
2380 | 263 | </doc:summary></doc:doc> | ||
2381 | 264 | </arg> | ||
2382 | 265 | |||
2383 | 266 | <doc:doc> | ||
2384 | 267 | <doc:description> | ||
2385 | 268 | <doc:para> | ||
2386 | 269 | Emitted when a device is added. | ||
2387 | 270 | </doc:para> | ||
2388 | 271 | </doc:description> | ||
2389 | 272 | </doc:doc> | ||
2390 | 273 | </signal> | ||
2391 | 274 | |||
2392 | 275 | <!-- ************************************************************ --> | ||
2393 | 276 | |||
2394 | 277 | <signal name="DeviceRemoved"> | ||
2395 | 278 | <arg type="o" name="device" direction="out"> | ||
2396 | 279 | <doc:doc><doc:summary> | ||
2397 | 280 | The object path for the device that was removed | ||
2398 | 281 | </doc:summary></doc:doc> | ||
2399 | 282 | </arg> | ||
2400 | 283 | |||
2401 | 284 | <doc:doc> | ||
2402 | 285 | <doc:description> | ||
2403 | 286 | <doc:para> | ||
2404 | 287 | Emitted when a device is removed. | ||
2405 | 288 | </doc:para> | ||
2406 | 289 | </doc:description> | ||
2407 | 290 | </doc:doc> | ||
2408 | 291 | </signal> | ||
2409 | 292 | |||
2410 | 293 | <!-- ************************************************************ --> | ||
2411 | 294 | |||
2412 | 295 | <signal name="DeviceChanged"> | ||
2413 | 296 | <arg type="o" name="device" direction="out"> | ||
2414 | 297 | <doc:doc><doc:summary> | ||
2415 | 298 | The object path for the device that was changed | ||
2416 | 299 | </doc:summary></doc:doc> | ||
2417 | 300 | </arg> | ||
2418 | 301 | |||
2419 | 302 | <doc:doc> | ||
2420 | 303 | <doc:description> | ||
2421 | 304 | <doc:para> | ||
2422 | 305 | Emitted when a device is changed. | ||
2423 | 306 | </doc:para> | ||
2424 | 307 | </doc:description> | ||
2425 | 308 | </doc:doc> | ||
2426 | 309 | </signal> | ||
2427 | 310 | |||
2428 | 311 | <!-- ************************************************************ --> | ||
2429 | 312 | |||
2430 | 313 | <signal name="FlightModeChanged"> | ||
2431 | 314 | <arg type="b" name="flight_mode" direction="out"> | ||
2432 | 315 | <doc:doc><doc:summary> | ||
2433 | 316 | TRUE if flight mode has been enabled, otherwise FALSE | ||
2434 | 317 | </doc:summary></doc:doc> | ||
2435 | 318 | </arg> | ||
2436 | 319 | |||
2437 | 320 | <doc:doc> | ||
2438 | 321 | <doc:description> | ||
2439 | 322 | <doc:para> | ||
2440 | 323 | Emitted when flight mode is enabled or disabled. | ||
2441 | 324 | </doc:para> | ||
2442 | 325 | </doc:description> | ||
2443 | 326 | </doc:doc> | ||
2444 | 327 | </signal> | ||
2445 | 328 | |||
2446 | 329 | <!-- ************************************************************ --> | ||
2447 | 330 | |||
2448 | 331 | <signal name="UrfkeyPressed"> | ||
2449 | 332 | <arg type="i" name="keycode" direction="out"> | ||
2450 | 333 | <doc:doc><doc:summary> | ||
2451 | 334 | The keycode emitted from the input device | ||
2452 | 335 | </doc:summary></doc:doc> | ||
2453 | 336 | </arg> | ||
2454 | 337 | |||
2455 | 338 | <doc:doc> | ||
2456 | 339 | <doc:description> | ||
2457 | 340 | <doc:para> | ||
2458 | 341 | Emitted when a rfkill key is pressed. The keycode is defined in | ||
2459 | 342 | <linux/input.h>. | ||
2460 | 343 | </doc:para> | ||
2461 | 344 | <doc:list> | ||
2462 | 345 | <doc:item> | ||
2463 | 346 | <doc:term>237</doc:term><doc:definition>KEY_BLUETOOTH</doc:definition> | ||
2464 | 347 | </doc:item> | ||
2465 | 348 | <doc:item> | ||
2466 | 349 | <doc:term>238</doc:term><doc:definition>KEY_WLAN</doc:definition> | ||
2467 | 350 | </doc:item> | ||
2468 | 351 | <doc:item> | ||
2469 | 352 | <doc:term>239</doc:term><doc:definition>KEY_UWB</doc:definition> | ||
2470 | 353 | </doc:item> | ||
2471 | 354 | <doc:item> | ||
2472 | 355 | <doc:term>246</doc:term><doc:definition>KEY_WIMAX</doc:definition> | ||
2473 | 356 | </doc:item> | ||
2474 | 357 | <doc:item> | ||
2475 | 358 | <doc:term>247</doc:term><doc:definition>KEY_RFKILL</doc:definition> | ||
2476 | 359 | </doc:item> | ||
2477 | 360 | </doc:list> | ||
2478 | 361 | </doc:description> | ||
2479 | 362 | </doc:doc> | ||
2480 | 363 | </signal> | ||
2481 | 364 | |||
2482 | 365 | <!-- ************************************************************ --> | ||
2483 | 366 | |||
2484 | 367 | <property name="DaemonVersion" type="s" access="read"> | ||
2485 | 368 | <doc:doc> | ||
2486 | 369 | <doc:description> | ||
2487 | 370 | <doc:para> | ||
2488 | 371 | The version the running daemon. e.g. 0.2.0 | ||
2489 | 372 | </doc:para> | ||
2490 | 373 | </doc:description> | ||
2491 | 374 | </doc:doc> | ||
2492 | 375 | </property> | ||
2493 | 376 | |||
2494 | 377 | <property name="KeyControl" type="b" access="read"> | ||
2495 | 378 | <doc:doc> | ||
2496 | 379 | <doc:description> | ||
2497 | 380 | <doc:para> | ||
2498 | 381 | Whether the key control is enabled or not | ||
2499 | 382 | </doc:para> | ||
2500 | 383 | </doc:description> | ||
2501 | 384 | </doc:doc> | ||
2502 | 385 | </property> | ||
2503 | 386 | |||
2504 | 387 | </interface> | ||
2505 | 388 | </node> | ||
2506 | 0 | 389 | ||
2507 | === modified file 'debian/control' | |||
2508 | --- debian/control 2014-10-29 19:46:09 +0000 | |||
2509 | +++ debian/control 2015-04-01 15:30:55 +0000 | |||
2510 | @@ -9,22 +9,21 @@ | |||
2511 | 9 | g++-4.9, | 9 | g++-4.9, |
2512 | 10 | debhelper (>= 9.0.0), | 10 | debhelper (>= 9.0.0), |
2513 | 11 | google-mock (>= 1.6.0+svn437), | 11 | google-mock (>= 1.6.0+svn437), |
2514 | 12 | dbus-test-runner, | ||
2515 | 13 | libdbus-1-dev, | ||
2516 | 14 | libdbus-cpp-dev (>= 4.1.0), | ||
2517 | 15 | libglib2.0-dev, | 12 | libglib2.0-dev, |
2518 | 16 | libnm-glib-dev (>= 0.9), | ||
2519 | 17 | libnm-util-dev (>= 0.9), | ||
2520 | 18 | libnotify-dev, | 13 | libnotify-dev, |
2523 | 19 | libprocess-cpp-dev, | 14 | #///! TODO: The next line should be removed once all dependancy on qmenumodel is removed |
2522 | 20 | libproperties-cpp-dev, | ||
2524 | 21 | libqmenumodel-dev, | 15 | libqmenumodel-dev, |
2525 | 16 | libqofono-dev, | ||
2526 | 17 | libqofono-qt5-0, | ||
2527 | 18 | #///! TODO: The next line should be replaced with: libqtdbusmock1-dev (>= 0.3), | ||
2528 | 22 | libqtdbusmock1-dev, | 19 | libqtdbusmock1-dev, |
2529 | 23 | libqtdbustest1-dev, | 20 | libqtdbustest1-dev, |
2530 | 24 | liburl-dispatcher1-dev, | 21 | liburl-dispatcher1-dev, |
2531 | 22 | libunity-api-dev, | ||
2532 | 25 | network-manager-dev, | 23 | network-manager-dev, |
2533 | 26 | ofono-dev, | 24 | ofono-dev, |
2534 | 27 | pkg-config, | 25 | pkg-config, |
2535 | 26 | #///! TODO: The next line should be replaced with: python3-dbusmock (>= 0.14), | ||
2536 | 28 | python3-dbusmock, | 27 | python3-dbusmock, |
2537 | 29 | python3-setuptools, | 28 | python3-setuptools, |
2538 | 30 | qt5-default, | 29 | qt5-default, |
2539 | @@ -69,4 +68,3 @@ | |||
2540 | 69 | Description: Autopilot tests for the network indicator for Ubuntu | 68 | Description: Autopilot tests for the network indicator for Ubuntu |
2541 | 70 | The Indicator-network service is responsible for exporting the system settings | 69 | The Indicator-network service is responsible for exporting the system settings |
2542 | 71 | menu through dbus. This package contains its autopilot tests. | 70 | menu through dbus. This package contains its autopilot tests. |
2543 | 72 | |||
2544 | 73 | 71 | ||
2545 | === added directory 'sniffer' | |||
2546 | === added file 'sniffer/CMakeLists.txt' | |||
2547 | --- sniffer/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
2548 | +++ sniffer/CMakeLists.txt 2015-04-01 15:30:55 +0000 | |||
2549 | @@ -0,0 +1,36 @@ | |||
2550 | 1 | add_executable(i-n-sniffer | ||
2551 | 2 | eventprinter.cpp | ||
2552 | 3 | eventprinter.h | ||
2553 | 4 | i-n-extractor.cpp | ||
2554 | 5 | nmaccesspoint.cpp | ||
2555 | 6 | nmaccesspoint.h | ||
2556 | 7 | nmactiveconnection.cpp | ||
2557 | 8 | nmactiveconnection.h | ||
2558 | 9 | nmconnsettings.cpp | ||
2559 | 10 | nmconnsettings.h | ||
2560 | 11 | nmroot.cpp | ||
2561 | 12 | nmroot.h | ||
2562 | 13 | nmsettings.cpp | ||
2563 | 14 | nmsettings.h | ||
2564 | 15 | nmwirelessdevice.cpp | ||
2565 | 16 | nmwirelessdevice.h | ||
2566 | 17 | ofonomodemmodem.cpp | ||
2567 | 18 | ofonomodemmodem.h | ||
2568 | 19 | ofonomodemnetworkregistration.cpp | ||
2569 | 20 | ofonomodemnetworkregistration.h | ||
2570 | 21 | ofonomodemsimmanager.cpp | ||
2571 | 22 | ofonomodemsimmanager.h | ||
2572 | 23 | ofonoroot.cpp | ||
2573 | 24 | ofonoroot.h | ||
2574 | 25 | urfkillroot.cpp | ||
2575 | 26 | urfkillroot.h | ||
2576 | 27 | urfkillswitch.cpp | ||
2577 | 28 | urfkillswitch.h | ||
2578 | 29 | ) | ||
2579 | 30 | |||
2580 | 31 | qt5_use_modules(i-n-sniffer Core DBus) | ||
2581 | 32 | |||
2582 | 33 | install( | ||
2583 | 34 | TARGETS i-n-sniffer | ||
2584 | 35 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
2585 | 36 | ) | ||
2586 | 0 | 37 | ||
2587 | === added file 'sniffer/eventprinter.h' | |||
2588 | --- sniffer/eventprinter.h 1970-01-01 00:00:00 +0000 | |||
2589 | +++ sniffer/eventprinter.h 2015-04-01 15:30:55 +0000 | |||
2590 | @@ -0,0 +1,70 @@ | |||
2591 | 1 | /* | ||
2592 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2593 | 3 | * | ||
2594 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2595 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
2596 | 6 | * by the Free Software Foundation. | ||
2597 | 7 | * | ||
2598 | 8 | * This program is distributed in the hope that it will be useful, but | ||
2599 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2600 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2601 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
2602 | 12 | * | ||
2603 | 13 | * You should have received a copy of the GNU General Public License along | ||
2604 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2605 | 15 | * | ||
2606 | 16 | * Authors: | ||
2607 | 17 | * Jussi Pakkanen <jussi.pakkanen@canonical.com> | ||
2608 | 18 | */ | ||
2609 | 19 | |||
2610 | 20 | #pragma once | ||
2611 | 21 | |||
2612 | 22 | #include <QObject> | ||
2613 | 23 | #include <QDBusVariant> | ||
2614 | 24 | |||
2615 | 25 | class UrfkillRoot; | ||
2616 | 26 | class UrfkillSwitch; | ||
2617 | 27 | class NetworkManagerRoot; | ||
2618 | 28 | class OfonoModemModem; | ||
2619 | 29 | class OfonoModemSimManager; | ||
2620 | 30 | class OfonoModemNetworkRegistration; | ||
2621 | 31 | |||
2622 | 32 | class EventPrinter : QObject { | ||
2623 | 33 | Q_OBJECT | ||
2624 | 34 | |||
2625 | 35 | public: | ||
2626 | 36 | explicit EventPrinter(QObject *parent = nullptr); | ||
2627 | 37 | ~EventPrinter(); | ||
2628 | 38 | |||
2629 | 39 | public Q_SLOTS: | ||
2630 | 40 | void flightModeChanged(bool new_mode); | ||
2631 | 41 | void btKillswitchChanged(); | ||
2632 | 42 | void wlanKillswitchChanged(); | ||
2633 | 43 | void nmStateChanged(uint new_state); | ||
2634 | 44 | void nmPropertiesChanged(const QVariantMap &props); | ||
2635 | 45 | void modem1PropertyChanged(const QString name, const QDBusVariant value); | ||
2636 | 46 | void modem2PropertyChanged(const QString name, const QDBusVariant value); | ||
2637 | 47 | void simman1PropertyChanged(const QString name, const QDBusVariant value); | ||
2638 | 48 | void simman2PropertyChanged(const QString name, const QDBusVariant value); | ||
2639 | 49 | void netreg1PropertyChanged(const QString name, const QDBusVariant value); | ||
2640 | 50 | void netreg2PropertyChanged(const QString name, const QDBusVariant value); | ||
2641 | 51 | |||
2642 | 52 | private: | ||
2643 | 53 | |||
2644 | 54 | void modemPropertyChanged(const int modem, const QString &name, const QDBusVariant &value); | ||
2645 | 55 | void simmanPropertyChanged(const int simman, const QString &name, const QDBusVariant &value); | ||
2646 | 56 | void netregPropertyChanged(const int modem, const QString &name, const QDBusVariant &value); | ||
2647 | 57 | void activeConnectionsChanged(const QVariant &list); | ||
2648 | 58 | void primaryConnectionTypeChanged(const QString &type); | ||
2649 | 59 | |||
2650 | 60 | UrfkillRoot *urfkill; | ||
2651 | 61 | UrfkillSwitch *btkill; | ||
2652 | 62 | UrfkillSwitch *wlankill; | ||
2653 | 63 | NetworkManagerRoot *nmroot; | ||
2654 | 64 | OfonoModemModem *modem1; | ||
2655 | 65 | OfonoModemModem *modem2; | ||
2656 | 66 | OfonoModemSimManager *simman1; | ||
2657 | 67 | OfonoModemSimManager *simman2; | ||
2658 | 68 | OfonoModemNetworkRegistration *netreg1; | ||
2659 | 69 | OfonoModemNetworkRegistration *netreg2; | ||
2660 | 70 | }; | ||
2661 | 0 | 71 | ||
2662 | === added file 'sniffer/i-n-extractor.cpp' | |||
2663 | --- sniffer/i-n-extractor.cpp 1970-01-01 00:00:00 +0000 | |||
2664 | +++ sniffer/i-n-extractor.cpp 2015-04-01 15:30:55 +0000 | |||
2665 | @@ -0,0 +1,152 @@ | |||
2666 | 1 | /* | ||
2667 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2668 | 3 | * | ||
2669 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2670 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
2671 | 6 | * by the Free Software Foundation. | ||
2672 | 7 | * | ||
2673 | 8 | * This program is distributed in the hope that it will be useful, but | ||
2674 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2675 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2676 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
2677 | 12 | * | ||
2678 | 13 | * You should have received a copy of the GNU General Public License along | ||
2679 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2680 | 15 | * | ||
2681 | 16 | * Authors: | ||
2682 | 17 | * Jussi Pakkanen <jussi.pakkanen@canonical.com> | ||
2683 | 18 | */ | ||
2684 | 19 | |||
2685 | 20 | |||
2686 | 21 | #include <QCoreApplication> | ||
2687 | 22 | |||
2688 | 23 | #include "dbusdata.h" | ||
2689 | 24 | #include "eventprinter.h" | ||
2690 | 25 | #include "nmaccesspoint.h" | ||
2691 | 26 | #include "nmactiveconnection.h" | ||
2692 | 27 | #include "nmconnsettings.h" | ||
2693 | 28 | #include "nmroot.h" | ||
2694 | 29 | #include "nmsettings.h" | ||
2695 | 30 | #include "nmwirelessdevice.h" | ||
2696 | 31 | #include "ofonomodemnetworkregistration.h" | ||
2697 | 32 | #include "ofonomodemsimmanager.h" | ||
2698 | 33 | #include "ofonoroot.h" | ||
2699 | 34 | #include "urfkillroot.h" | ||
2700 | 35 | #include "urfkillswitch.h" | ||
2701 | 36 | |||
2702 | 37 | static std::map<const int, const char*> nm_active_connection_strings = {{0, "Unknown"}, {1, "Activating"}, | ||
2703 | 38 | {2, "Activated"}, {3, "Deactivating"}, {4, "Deactivated"}}; | ||
2704 | 39 | static std::map<const int, const char*> nm_connectivity_strings = {{0, "Unknown"}, {1, "None"}, {2, "Portal"}, | ||
2705 | 40 | {3, "Limited"}, {4, "Full"}}; | ||
2706 | 41 | static std::map<const int, const char*> nm_state_strings = {{0, "Unknown"}, {10, "Asleep"}, {20, "Disconnected"}, | ||
2707 | 42 | {30, "Disconnecting"}, {40, "Connecting"}, {50, "Connected local"}, {60, "Connected site"}, {70, "Connected global"}}; | ||
2708 | 43 | static std::map<const int, const char*> nm_ap_mode_strings = {{0, "Unknown"}, {1, "Adhoc"}, {2, "Infra"}, {3, "Access point"}}; | ||
2709 | 44 | |||
2710 | 45 | void print_nm_wlans(NetworkManagerRoot *nmroot) { | ||
2711 | 46 | auto paths = nmroot->activeConnections(); | ||
2712 | 47 | for(const auto &path : paths) { | ||
2713 | 48 | NetworkManagerActiveConnection ac(NM_SERVICE, path.path(), QDBusConnection::systemBus(), nullptr); | ||
2714 | 49 | auto devices = ac.devices(); | ||
2715 | 50 | // FIXME, should check all but most connections only have one. | ||
2716 | 51 | NetworkManagerWirelessDevice dev(NM_SERVICE, devices[0].path(), QDBusConnection::systemBus(), nullptr); | ||
2717 | 52 | auto reply = dev.GetAccessPoints(); | ||
2718 | 53 | reply.waitForFinished(); | ||
2719 | 54 | if(reply.isValid()) { | ||
2720 | 55 | // FIXME and the same here. | ||
2721 | 56 | // FIXME also that active access point might not exist | ||
2722 | 57 | NetworkManagerAccessPoint ap(NM_SERVICE, dev.activeAccessPoint().path(), QDBusConnection::systemBus(), nullptr); | ||
2723 | 58 | printf("Connection %s:\n", path.path().toUtf8().data()); | ||
2724 | 59 | auto raw_ssid = ap.ssid(); | ||
2725 | 60 | std::string ssid(raw_ssid.cbegin(), raw_ssid.cend()); | ||
2726 | 61 | printf(" ssid: %s\n", ssid.c_str()); | ||
2727 | 62 | printf(" mode: %d (%s)\n", ap.mode(), nm_ap_mode_strings[ap.mode()]); | ||
2728 | 63 | printf(" visible networks:\n"); | ||
2729 | 64 | for(const auto &c : reply.value()) { | ||
2730 | 65 | NetworkManagerAccessPoint i(NM_SERVICE, c.path(), QDBusConnection::systemBus(), nullptr); | ||
2731 | 66 | auto i_raw_ssid = i.ssid(); | ||
2732 | 67 | std::string i_ssid(i_raw_ssid.cbegin(), i_raw_ssid.cend()); | ||
2733 | 68 | printf(" %s %d\n", i_ssid.c_str(), (int)i.strength()); | ||
2734 | 69 | } | ||
2735 | 70 | } else { | ||
2736 | 71 | printf("Connection %s is not wireless.\n", path.path().toUtf8().data()); | ||
2737 | 72 | } | ||
2738 | 73 | } | ||
2739 | 74 | } | ||
2740 | 75 | |||
2741 | 76 | void print_info(QCoreApplication &app) { | ||
2742 | 77 | UrfkillRoot *urfkill = new UrfkillRoot(URFKILL_SERVICE, URFKILL_OBJECT, | ||
2743 | 78 | QDBusConnection::systemBus(), &app); | ||
2744 | 79 | UrfkillSwitch *urfkillwlan = new UrfkillSwitch(URFKILL_SERVICE, URFKILL_WLAN_OBJECT, | ||
2745 | 80 | QDBusConnection::systemBus(), &app); | ||
2746 | 81 | UrfkillSwitch *urfkillbt = new UrfkillSwitch(URFKILL_SERVICE, URFKILL_BLUETOOTH_OBJECT, | ||
2747 | 82 | QDBusConnection::systemBus(), &app); | ||
2748 | 83 | UrfkillSwitch *urfkillgps = new UrfkillSwitch(URFKILL_SERVICE, URFKILL_GPS_OBJECT, | ||
2749 | 84 | QDBusConnection::systemBus(), &app); | ||
2750 | 85 | NetworkManagerRoot *nmroot = new NetworkManagerRoot(NM_SERVICE, NM_OBJECT, | ||
2751 | 86 | QDBusConnection::systemBus(), &app); | ||
2752 | 87 | OfonoRoot *ofonoroot = new OfonoRoot(OFONO_SERVICE, OFONO_OBJECT, | ||
2753 | 88 | QDBusConnection::systemBus(), &app); | ||
2754 | 89 | |||
2755 | 90 | printf("Urfkill flightmode: %d\n", urfkill->IsFlightMode().value()); | ||
2756 | 91 | printf("Urfkill WLAN killswitch: %d\n", urfkillwlan->state()); | ||
2757 | 92 | printf("Urfkill BLUETOOTH killswitch: %d\n", urfkillbt->state()); | ||
2758 | 93 | printf("Urfkill GPS killswitch: %d\n", urfkillgps->state()); | ||
2759 | 94 | printf("\n"); | ||
2760 | 95 | auto nm_connectivity = nmroot->connectivity(); | ||
2761 | 96 | printf("NetworkManager connectivity: %d (%s)\n", nm_connectivity, nm_connectivity_strings[nm_connectivity]); | ||
2762 | 97 | auto nm_state = nmroot->state().value(); | ||
2763 | 98 | printf("NetworkManager state: %d (%s).\n", nm_state, nm_state_strings[nm_state]); | ||
2764 | 99 | printf("NetworkManager networking enabled: %d\n", nmroot->networkingEnabled()); | ||
2765 | 100 | printf("NetworkManager wireless enabled: %d\n", nmroot->wirelessEnabled()); | ||
2766 | 101 | printf("NetworkManager wireless hardware enabled: %d\n", nmroot->wirelessHardwareEnabled()); | ||
2767 | 102 | print_nm_wlans(nmroot); | ||
2768 | 103 | printf("\n"); | ||
2769 | 104 | auto modems = ofonoroot->GetModems().value(); | ||
2770 | 105 | printf("Ofono modem count: %d\n", modems.size()); | ||
2771 | 106 | for(const auto &m : modems) { | ||
2772 | 107 | OfonoModemSimManager man(OFONO_SERVICE, m.first.path(), QDBusConnection::systemBus(), nullptr); | ||
2773 | 108 | OfonoModemNetworkRegistration netreg(OFONO_SERVICE, m.first.path(), QDBusConnection::systemBus(), nullptr); | ||
2774 | 109 | auto mprops = man.GetProperties().value(); | ||
2775 | 110 | auto regprops = netreg.GetProperties().value(); | ||
2776 | 111 | |||
2777 | 112 | const auto &props = m.second; | ||
2778 | 113 | printf("Modem %s:\n", m.first.path().toUtf8().data()); | ||
2779 | 114 | // For proper usage should check for existance before indexing. | ||
2780 | 115 | printf(" Powered: %d\n", props["Powered"].toBool()); | ||
2781 | 116 | printf(" Online: %d\n", props["Online"].toBool()); | ||
2782 | 117 | printf(" Model: %s\n", props["Model"].toString().toUtf8().data()); | ||
2783 | 118 | printf(" Manufacturer: %s\n", props["Manufacturer"].toString().toUtf8().data()); | ||
2784 | 119 | printf(" Pin required: %s\n", mprops["PinRequired"].toString().toUtf8().data()); | ||
2785 | 120 | printf(" Status: %s\n", regprops["Status"].toString().toUtf8().data()); | ||
2786 | 121 | printf(" Strength: %d\n", regprops["Strength"].toInt()); | ||
2787 | 122 | printf(" Operator: %s\n", regprops["Name"].toString().toUtf8().data()); | ||
2788 | 123 | } | ||
2789 | 124 | } | ||
2790 | 125 | |||
2791 | 126 | int run_daemon(QCoreApplication &app) { | ||
2792 | 127 | new EventPrinter(&app); | ||
2793 | 128 | return app.exec(); | ||
2794 | 129 | } | ||
2795 | 130 | |||
2796 | 131 | int main(int argc, char **argv) { | ||
2797 | 132 | QCoreApplication app(argc, argv); | ||
2798 | 133 | qRegisterMetaType<QVariantDictMap>("QVariantDictMap"); | ||
2799 | 134 | qDBusRegisterMetaType<QVariantDictMap>(); | ||
2800 | 135 | qRegisterMetaType<ModemPropertyList>("ModemPropertyList"); | ||
2801 | 136 | qDBusRegisterMetaType<ModemPropertyList>(); | ||
2802 | 137 | qDBusRegisterMetaType<QPair<QDBusObjectPath, QVariantMap>>(); | ||
2803 | 138 | |||
2804 | 139 | if(argc == 1) { | ||
2805 | 140 | print_info(app); | ||
2806 | 141 | } else if(argc == 2) { | ||
2807 | 142 | static const std::string arg("-d"); // For daemon mode. Feel free to change to something saner. | ||
2808 | 143 | if(argv[1] == arg) | ||
2809 | 144 | return run_daemon(app); | ||
2810 | 145 | printf("Unknown argument.\n"); | ||
2811 | 146 | return 1; | ||
2812 | 147 | } else { | ||
2813 | 148 | printf("Too many arguments.\n"); | ||
2814 | 149 | return 1; | ||
2815 | 150 | } | ||
2816 | 151 | return 0; | ||
2817 | 152 | } | ||
2818 | 0 | 153 | ||
2819 | === modified file 'src/CMakeLists.txt' | |||
2820 | --- src/CMakeLists.txt 2015-02-16 18:34:37 +0000 | |||
2821 | +++ src/CMakeLists.txt 2015-04-01 15:30:55 +0000 | |||
2822 | @@ -3,10 +3,11 @@ | |||
2823 | 3 | set(COMMON_FLAGS "${COMMON_FLAGS} -Werror") | 3 | set(COMMON_FLAGS "${COMMON_FLAGS} -Werror") |
2824 | 4 | endif() | 4 | endif() |
2825 | 5 | 5 | ||
2828 | 6 | add_subdirectory(dbus-cpp) | 6 | #add_subdirectory(dbus-cpp) |
2829 | 7 | add_subdirectory(connectivity-cpp) | 7 | #add_subdirectory(connectivity-cpp) |
2830 | 8 | add_subdirectory(indicator) | 8 | add_subdirectory(indicator) |
2831 | 9 | add_subdirectory(menumodel-cpp) | 9 | add_subdirectory(menumodel-cpp) |
2832 | 10 | add_subdirectory(qdbus-stubs) | ||
2833 | 10 | add_subdirectory(notify-cpp) | 11 | add_subdirectory(notify-cpp) |
2834 | 11 | add_subdirectory(secret-agent) | 12 | add_subdirectory(secret-agent) |
2835 | 12 | add_subdirectory(url-dispatcher-cpp) | 13 | add_subdirectory(url-dispatcher-cpp) |
2836 | 13 | 14 | ||
2837 | === modified file 'src/connectivity-cpp/CMakeLists.txt' | |||
2838 | --- src/connectivity-cpp/CMakeLists.txt 2014-08-19 21:13:53 +0000 | |||
2839 | +++ src/connectivity-cpp/CMakeLists.txt 2015-04-01 15:30:55 +0000 | |||
2840 | @@ -3,13 +3,11 @@ | |||
2841 | 3 | set(CONNECTIVITY_CPP_VERSION_MINOR 0) | 3 | set(CONNECTIVITY_CPP_VERSION_MINOR 0) |
2842 | 4 | set(CONNECTIVITY_CPP_VERSION_PATCH 1) | 4 | set(CONNECTIVITY_CPP_VERSION_PATCH 1) |
2843 | 5 | 5 | ||
2851 | 6 | include(CTest) | 6 | include_directories( |
2852 | 7 | 7 | "${CMAKE_CURRENT_SOURCE_DIR}/include" | |
2853 | 8 | find_package(PkgConfig REQUIRED) | 8 | "${CMAKE_CURRENT_SOURCE_DIR}/backend" |
2854 | 9 | 9 | "${CMAKE_CURRENT_BINARY_DIR}/backend" | |
2855 | 10 | include_directories(include) | 10 | ) |
2849 | 11 | include_directories(dbus-cpp) | ||
2850 | 12 | |||
2856 | 13 | pkg_check_modules( | 11 | pkg_check_modules( |
2857 | 14 | PROPERTIESCPP REQUIRED | 12 | PROPERTIESCPP REQUIRED |
2858 | 15 | properties-cpp | 13 | properties-cpp |
2859 | @@ -45,15 +43,7 @@ | |||
2860 | 45 | ) | 43 | ) |
2861 | 46 | add_custom_target(QtCreatorHeaderHack SOURCES ${CONNECTIVITY_INTERFACES}) | 44 | add_custom_target(QtCreatorHeaderHack SOURCES ${CONNECTIVITY_INTERFACES}) |
2862 | 47 | 45 | ||
2863 | 48 | # list these here to have them visible in Qt Creator | ||
2864 | 49 | set(DBUS_INTERFACES | ||
2865 | 50 | dbus-cpp/services/nm.h | ||
2866 | 51 | dbus-cpp/services/ofono.h | ||
2867 | 52 | dbus-cpp/services/urfkill.h | ||
2868 | 53 | ) | ||
2869 | 54 | add_custom_target(QtCreatorHeaderHack2 SOURCES ${DBUS_INTERFACES}) | ||
2870 | 55 | |||
2871 | 56 | add_subdirectory(data) | 46 | add_subdirectory(data) |
2872 | 57 | #add_subdirectory(doc) | 47 | #add_subdirectory(doc) |
2874 | 58 | add_subdirectory(examples) | 48 | #add_subdirectory(examples) |
2875 | 59 | add_subdirectory(src) | 49 | add_subdirectory(src) |
2876 | 60 | 50 | ||
2877 | === removed directory 'src/connectivity-cpp/dbus-cpp' | |||
2878 | === removed directory 'src/connectivity-cpp/dbus-cpp/services' | |||
2879 | === removed file 'src/connectivity-cpp/dbus-cpp/services/nm.h' | |||
2880 | --- src/connectivity-cpp/dbus-cpp/services/nm.h 2014-10-31 13:50:05 +0000 | |||
2881 | +++ src/connectivity-cpp/dbus-cpp/services/nm.h 1970-01-01 00:00:00 +0000 | |||
2882 | @@ -1,979 +0,0 @@ | |||
2883 | 1 | /* | ||
2884 | 2 | * Copyright © 2012-2013 Canonical Ltd. | ||
2885 | 3 | * | ||
2886 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2887 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
2888 | 6 | * as published by the Free Software Foundation. | ||
2889 | 7 | * | ||
2890 | 8 | * This program is distributed in the hope that it will be useful, | ||
2891 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2892 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2893 | 11 | * GNU Lesser General Public License for more details. | ||
2894 | 12 | * | ||
2895 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
2896 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2897 | 15 | * | ||
2898 | 16 | * Authored by: Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
2899 | 17 | */ | ||
2900 | 18 | #ifndef PLATFORM_MANAGER_NMOFONO_NM_H | ||
2901 | 19 | #define PLATFORM_MANAGER_NMOFONO_NM_H | ||
2902 | 20 | |||
2903 | 21 | #include <core/dbus/bus.h> | ||
2904 | 22 | #include <core/dbus/object.h> | ||
2905 | 23 | #include <core/dbus/property.h> | ||
2906 | 24 | #include <core/dbus/service.h> | ||
2907 | 25 | #include <core/dbus/types/object_path.h> | ||
2908 | 26 | #include <core/dbus/types/any.h> | ||
2909 | 27 | #include <core/dbus/types/struct.h> | ||
2910 | 28 | #include <core/dbus/types/stl/map.h> | ||
2911 | 29 | #include <core/dbus/types/stl/string.h> | ||
2912 | 30 | #include <core/dbus/types/stl/tuple.h> | ||
2913 | 31 | #include <core/dbus/types/stl/vector.h> | ||
2914 | 32 | #include <NetworkManager/NetworkManager.h> | ||
2915 | 33 | #include "util.h" | ||
2916 | 34 | |||
2917 | 35 | namespace org | ||
2918 | 36 | { | ||
2919 | 37 | namespace freedesktop | ||
2920 | 38 | { | ||
2921 | 39 | namespace NetworkManager | ||
2922 | 40 | { | ||
2923 | 41 | struct Interface { | ||
2924 | 42 | |||
2925 | 43 | struct AccessPoint | ||
2926 | 44 | { | ||
2927 | 45 | static const std::string& name() | ||
2928 | 46 | { | ||
2929 | 47 | static const std::string s{NM_DBUS_INTERFACE_ACCESS_POINT}; | ||
2930 | 48 | return s; | ||
2931 | 49 | } | ||
2932 | 50 | |||
2933 | 51 | struct Property { | ||
2934 | 52 | struct Frequency | ||
2935 | 53 | { | ||
2936 | 54 | static const std::string& name() | ||
2937 | 55 | { | ||
2938 | 56 | static const std::string s{"Frequency"}; | ||
2939 | 57 | return s; | ||
2940 | 58 | } | ||
2941 | 59 | |||
2942 | 60 | typedef AccessPoint Interface; | ||
2943 | 61 | typedef std::uint32_t ValueType; | ||
2944 | 62 | static const bool readable = true; | ||
2945 | 63 | static const bool writable = false; | ||
2946 | 64 | }; | ||
2947 | 65 | |||
2948 | 66 | struct Flags | ||
2949 | 67 | { | ||
2950 | 68 | static const std::string& name() | ||
2951 | 69 | { | ||
2952 | 70 | static const std::string s{"Flags"}; | ||
2953 | 71 | return s; | ||
2954 | 72 | } | ||
2955 | 73 | |||
2956 | 74 | typedef AccessPoint Interface; | ||
2957 | 75 | typedef std::uint32_t ValueType; | ||
2958 | 76 | static const bool readable = true; | ||
2959 | 77 | static const bool writable = false; | ||
2960 | 78 | }; | ||
2961 | 79 | |||
2962 | 80 | struct WpaFlags | ||
2963 | 81 | { | ||
2964 | 82 | static const std::string& name() | ||
2965 | 83 | { | ||
2966 | 84 | static const std::string s{"WpaFlags"}; | ||
2967 | 85 | return s; | ||
2968 | 86 | } | ||
2969 | 87 | |||
2970 | 88 | typedef AccessPoint Interface; | ||
2971 | 89 | typedef std::uint32_t ValueType; | ||
2972 | 90 | static const bool readable = true; | ||
2973 | 91 | static const bool writable = false; | ||
2974 | 92 | }; | ||
2975 | 93 | |||
2976 | 94 | struct RsnFlags | ||
2977 | 95 | { | ||
2978 | 96 | static const std::string& name() | ||
2979 | 97 | { | ||
2980 | 98 | static const std::string s{"RsnFlags"}; | ||
2981 | 99 | return s; | ||
2982 | 100 | } | ||
2983 | 101 | |||
2984 | 102 | typedef AccessPoint Interface; | ||
2985 | 103 | typedef std::uint32_t ValueType; | ||
2986 | 104 | static const bool readable = true; | ||
2987 | 105 | static const bool writable = false; | ||
2988 | 106 | }; | ||
2989 | 107 | |||
2990 | 108 | struct Mode | ||
2991 | 109 | { | ||
2992 | 110 | static const std::string& name() | ||
2993 | 111 | { | ||
2994 | 112 | static const std::string s{"Mode"}; | ||
2995 | 113 | return s; | ||
2996 | 114 | } | ||
2997 | 115 | |||
2998 | 116 | typedef AccessPoint Interface; | ||
2999 | 117 | typedef std::uint32_t ValueType; | ||
3000 | 118 | static const bool readable = true; | ||
3001 | 119 | static const bool writable = false; | ||
3002 | 120 | }; | ||
3003 | 121 | |||
3004 | 122 | struct Ssid | ||
3005 | 123 | { | ||
3006 | 124 | static const std::string& name() | ||
3007 | 125 | { | ||
3008 | 126 | static const std::string s{"Ssid"}; | ||
3009 | 127 | return s; | ||
3010 | 128 | } | ||
3011 | 129 | |||
3012 | 130 | typedef AccessPoint Interface; | ||
3013 | 131 | /// @todo bug tvoss.. D-Bus BYTE(y) should be unsigned | ||
3014 | 132 | typedef std::vector<std::int8_t> ValueType; | ||
3015 | 133 | static const bool readable = true; | ||
3016 | 134 | static const bool writable = false; | ||
3017 | 135 | }; | ||
3018 | 136 | |||
3019 | 137 | struct HwAddress | ||
3020 | 138 | { | ||
3021 | 139 | static const std::string& name() | ||
3022 | 140 | { | ||
3023 | 141 | static const std::string s{"HwAddress"}; | ||
3024 | 142 | return s; | ||
3025 | 143 | } | ||
3026 | 144 | |||
3027 | 145 | typedef AccessPoint Interface; | ||
3028 | 146 | typedef std::string ValueType; | ||
3029 | 147 | static const bool readable = true; | ||
3030 | 148 | static const bool writable = false; | ||
3031 | 149 | }; | ||
3032 | 150 | |||
3033 | 151 | struct Strength | ||
3034 | 152 | { | ||
3035 | 153 | static const std::string& name() | ||
3036 | 154 | { | ||
3037 | 155 | static const std::string s{"Strength"}; | ||
3038 | 156 | return s; | ||
3039 | 157 | } | ||
3040 | 158 | |||
3041 | 159 | typedef AccessPoint Interface; | ||
3042 | 160 | typedef std::int8_t ValueType; | ||
3043 | 161 | static const bool readable = true; | ||
3044 | 162 | static const bool writable = false; | ||
3045 | 163 | }; | ||
3046 | 164 | }; | ||
3047 | 165 | |||
3048 | 166 | struct Signal { | ||
3049 | 167 | struct PropertiesChanged | ||
3050 | 168 | { | ||
3051 | 169 | static const std::string& name() | ||
3052 | 170 | { | ||
3053 | 171 | static const std::string s{"PropertiesChanged"}; | ||
3054 | 172 | return s; | ||
3055 | 173 | } | ||
3056 | 174 | |||
3057 | 175 | typedef AccessPoint Interface; | ||
3058 | 176 | typedef std::map<std::string, core::dbus::types::Variant> ArgumentType; | ||
3059 | 177 | }; | ||
3060 | 178 | }; | ||
3061 | 179 | |||
3062 | 180 | AccessPoint(const std::shared_ptr<core::dbus::Object>& object) | ||
3063 | 181 | : object(object), | ||
3064 | 182 | frequency(object->get_property<Property::Frequency>()), | ||
3065 | 183 | hw_address(object->get_property<Property::HwAddress>()), | ||
3066 | 184 | strength(object->get_property<Property::Strength>()), | ||
3067 | 185 | flags(object->get_property<Property::Flags>()), | ||
3068 | 186 | wpa_flags(object->get_property<Property::WpaFlags>()), | ||
3069 | 187 | rsn_flags(object->get_property<Property::RsnFlags>()), | ||
3070 | 188 | mode(object->get_property<Property::Mode>()), | ||
3071 | 189 | ssid(object->get_property<Property::Ssid>()), | ||
3072 | 190 | properties_changed(object->get_signal<Signal::PropertiesChanged>()) | ||
3073 | 191 | |||
3074 | 192 | {} | ||
3075 | 193 | |||
3076 | 194 | std::shared_ptr<core::dbus::Object> object; | ||
3077 | 195 | std::shared_ptr<core::dbus::Property<Property::Frequency>> frequency; | ||
3078 | 196 | std::shared_ptr<core::dbus::Property<Property::HwAddress>> hw_address; | ||
3079 | 197 | std::shared_ptr<core::dbus::Property<Property::Strength>> strength; | ||
3080 | 198 | std::shared_ptr<core::dbus::Property<Property::Flags>> flags; | ||
3081 | 199 | std::shared_ptr<core::dbus::Property<Property::WpaFlags>> wpa_flags; | ||
3082 | 200 | std::shared_ptr<core::dbus::Property<Property::RsnFlags>> rsn_flags; | ||
3083 | 201 | std::shared_ptr<core::dbus::Property<Property::Mode>> mode; | ||
3084 | 202 | std::shared_ptr<core::dbus::Property<Property::Ssid>> ssid; | ||
3085 | 203 | std::shared_ptr<core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>> properties_changed; | ||
3086 | 204 | }; // Interface::AccessPoint | ||
3087 | 205 | |||
3088 | 206 | |||
3089 | 207 | struct ActiveConnection | ||
3090 | 208 | { | ||
3091 | 209 | static const std::string& name() | ||
3092 | 210 | { | ||
3093 | 211 | static const std::string s{NM_DBUS_INTERFACE_ACTIVE_CONNECTION}; | ||
3094 | 212 | return s; | ||
3095 | 213 | } | ||
3096 | 214 | |||
3097 | 215 | struct Property { | ||
3098 | 216 | struct Connection | ||
3099 | 217 | { | ||
3100 | 218 | static const std::string& name() | ||
3101 | 219 | { | ||
3102 | 220 | static const std::string s{"Connection"}; | ||
3103 | 221 | return s; | ||
3104 | 222 | } | ||
3105 | 223 | |||
3106 | 224 | typedef ActiveConnection Interface; | ||
3107 | 225 | typedef core::dbus::types::ObjectPath ValueType; | ||
3108 | 226 | static const bool readable = true; | ||
3109 | 227 | static const bool writable = false; | ||
3110 | 228 | }; | ||
3111 | 229 | struct SpecificObject | ||
3112 | 230 | { | ||
3113 | 231 | static const std::string& name() | ||
3114 | 232 | { | ||
3115 | 233 | static const std::string s{"SpecificObject"}; | ||
3116 | 234 | return s; | ||
3117 | 235 | } | ||
3118 | 236 | |||
3119 | 237 | typedef ActiveConnection Interface; | ||
3120 | 238 | typedef core::dbus::types::ObjectPath ValueType; | ||
3121 | 239 | static const bool readable = true; | ||
3122 | 240 | static const bool writable = false; | ||
3123 | 241 | }; | ||
3124 | 242 | struct Uuid | ||
3125 | 243 | { | ||
3126 | 244 | static const std::string& name() | ||
3127 | 245 | { | ||
3128 | 246 | static const std::string s{"Uuid"}; | ||
3129 | 247 | return s; | ||
3130 | 248 | } | ||
3131 | 249 | |||
3132 | 250 | typedef ActiveConnection Interface; | ||
3133 | 251 | typedef std::string ValueType; | ||
3134 | 252 | static const bool readable = true; | ||
3135 | 253 | static const bool writable = false; | ||
3136 | 254 | }; | ||
3137 | 255 | struct Devices | ||
3138 | 256 | { | ||
3139 | 257 | static const std::string& name() | ||
3140 | 258 | { | ||
3141 | 259 | static const std::string s{"Devices"}; | ||
3142 | 260 | return s; | ||
3143 | 261 | } | ||
3144 | 262 | |||
3145 | 263 | typedef ActiveConnection Interface; | ||
3146 | 264 | typedef std::vector<core::dbus::types::ObjectPath> ValueType; | ||
3147 | 265 | static const bool readable = true; | ||
3148 | 266 | static const bool writable = false; | ||
3149 | 267 | }; | ||
3150 | 268 | struct State | ||
3151 | 269 | { | ||
3152 | 270 | static const std::string& name() | ||
3153 | 271 | { | ||
3154 | 272 | static const std::string s{"State"}; | ||
3155 | 273 | return s; | ||
3156 | 274 | } | ||
3157 | 275 | |||
3158 | 276 | typedef ActiveConnection Interface; | ||
3159 | 277 | typedef std::uint32_t ValueType; | ||
3160 | 278 | static const bool readable = true; | ||
3161 | 279 | static const bool writable = false; | ||
3162 | 280 | }; | ||
3163 | 281 | struct Default | ||
3164 | 282 | { | ||
3165 | 283 | static const std::string& name() | ||
3166 | 284 | { | ||
3167 | 285 | static const std::string s{"Default"}; | ||
3168 | 286 | return s; | ||
3169 | 287 | } | ||
3170 | 288 | |||
3171 | 289 | typedef ActiveConnection Interface; | ||
3172 | 290 | typedef bool ValueType; | ||
3173 | 291 | static const bool readable = true; | ||
3174 | 292 | static const bool writable = false; | ||
3175 | 293 | }; | ||
3176 | 294 | struct Default6 | ||
3177 | 295 | { | ||
3178 | 296 | static const std::string& name() | ||
3179 | 297 | { | ||
3180 | 298 | static const std::string s{"Default6"}; | ||
3181 | 299 | return s; | ||
3182 | 300 | } | ||
3183 | 301 | |||
3184 | 302 | typedef ActiveConnection Interface; | ||
3185 | 303 | typedef bool ValueType; | ||
3186 | 304 | static const bool readable = true; | ||
3187 | 305 | static const bool writable = false; | ||
3188 | 306 | }; | ||
3189 | 307 | struct Vpn | ||
3190 | 308 | { | ||
3191 | 309 | static const std::string& name() | ||
3192 | 310 | { | ||
3193 | 311 | static const std::string s{"Vpn"}; | ||
3194 | 312 | return s; | ||
3195 | 313 | } | ||
3196 | 314 | |||
3197 | 315 | typedef ActiveConnection Interface; | ||
3198 | 316 | typedef bool ValueType; | ||
3199 | 317 | static const bool readable = true; | ||
3200 | 318 | static const bool writable = false; | ||
3201 | 319 | }; | ||
3202 | 320 | struct Master | ||
3203 | 321 | { | ||
3204 | 322 | static const std::string& name() | ||
3205 | 323 | { | ||
3206 | 324 | static const std::string s{"Master"}; | ||
3207 | 325 | return s; | ||
3208 | 326 | } | ||
3209 | 327 | |||
3210 | 328 | typedef ActiveConnection Interface; | ||
3211 | 329 | typedef bool ValueType; | ||
3212 | 330 | static const bool readable = true; | ||
3213 | 331 | static const bool writable = false; | ||
3214 | 332 | }; | ||
3215 | 333 | }; // struct Property | ||
3216 | 334 | |||
3217 | 335 | struct Signal { | ||
3218 | 336 | struct PropertiesChanged | ||
3219 | 337 | { | ||
3220 | 338 | static const std::string& name() | ||
3221 | 339 | { | ||
3222 | 340 | static const std::string s{"PropertiesChanged"}; | ||
3223 | 341 | return s; | ||
3224 | 342 | } | ||
3225 | 343 | |||
3226 | 344 | typedef ActiveConnection Interface; | ||
3227 | 345 | typedef std::map<std::string, core::dbus::types::Variant> ArgumentType; | ||
3228 | 346 | }; | ||
3229 | 347 | }; | ||
3230 | 348 | |||
3231 | 349 | enum class State | ||
3232 | 350 | { | ||
3233 | 351 | unknown = NM_ACTIVE_CONNECTION_STATE_UNKNOWN, | ||
3234 | 352 | activating = NM_ACTIVE_CONNECTION_STATE_ACTIVATING, | ||
3235 | 353 | activated = NM_ACTIVE_CONNECTION_STATE_ACTIVATED, | ||
3236 | 354 | deactivating = NM_ACTIVE_CONNECTION_STATE_DEACTIVATING, | ||
3237 | 355 | deactivated = NM_ACTIVE_CONNECTION_STATE_DEACTIVATED | ||
3238 | 356 | }; | ||
3239 | 357 | |||
3240 | 358 | ActiveConnection(const std::shared_ptr<core::dbus::Object>& object) | ||
3241 | 359 | : object(object), | ||
3242 | 360 | connection(object->get_property<Property::Connection>()), | ||
3243 | 361 | specific_object(object->get_property<Property::SpecificObject>()), | ||
3244 | 362 | uuid(object->get_property<Property::Uuid>()), | ||
3245 | 363 | devices(object->get_property<Property::Devices>()), | ||
3246 | 364 | state(object->get_property<Property::State>()), | ||
3247 | 365 | default_ipv4(object->get_property<Property::Default>()), | ||
3248 | 366 | default_ipv6(object->get_property<Property::Default6>()), | ||
3249 | 367 | vpn(object->get_property<Property::Vpn>()), | ||
3250 | 368 | master(object->get_property<Property::Master>()), | ||
3251 | 369 | properties_changed(object->get_signal<Signal::PropertiesChanged>()) | ||
3252 | 370 | { | ||
3253 | 371 | token = properties_changed->connect([this](const Signal::PropertiesChanged::ArgumentType &map){ | ||
3254 | 372 | for (auto entry: map) { | ||
3255 | 373 | if (entry.first == "State") { | ||
3256 | 374 | #if 0 | ||
3257 | 375 | std::uint32_t new_value = entry.second.as<std::uint32_t>(); | ||
3258 | 376 | state->update([&new_value](std::uint32_t ¤t_value){ | ||
3259 | 377 | if (new_value == current_value) | ||
3260 | 378 | return false; | ||
3261 | 379 | current_value = new_value; | ||
3262 | 380 | return true; | ||
3263 | 381 | }); | ||
3264 | 382 | #endif | ||
3265 | 383 | continue; | ||
3266 | 384 | } | ||
3267 | 385 | else { | ||
3268 | 386 | #ifdef INDICATOR_NETWORK_TRACE_MESSAGES | ||
3269 | 387 | std::cout << "Unexpected Connection.Active update: " << entry.first << std::endl; | ||
3270 | 388 | #endif | ||
3271 | 389 | } | ||
3272 | 390 | } | ||
3273 | 391 | }); | ||
3274 | 392 | } | ||
3275 | 393 | ~ActiveConnection() | ||
3276 | 394 | { | ||
3277 | 395 | /// @todo fix dbus-cpp... | ||
3278 | 396 | //properties_changed->disconnect(token); | ||
3279 | 397 | } | ||
3280 | 398 | |||
3281 | 399 | State get_state() { return static_cast<State>(state->get()); } | ||
3282 | 400 | |||
3283 | 401 | std::shared_ptr<core::dbus::Object> object; | ||
3284 | 402 | std::shared_ptr<core::dbus::Property<Property::Connection>> connection; | ||
3285 | 403 | std::shared_ptr<core::dbus::Property<Property::SpecificObject>> specific_object; | ||
3286 | 404 | std::shared_ptr<core::dbus::Property<Property::Uuid>> uuid; | ||
3287 | 405 | std::shared_ptr<core::dbus::Property<Property::Devices>> devices; | ||
3288 | 406 | std::shared_ptr<core::dbus::Property<Property::State>> state; | ||
3289 | 407 | std::shared_ptr<core::dbus::Property<Property::Default>> default_ipv4; | ||
3290 | 408 | std::shared_ptr<core::dbus::Property<Property::Default6>> default_ipv6; | ||
3291 | 409 | std::shared_ptr<core::dbus::Property<Property::Vpn>> vpn; | ||
3292 | 410 | std::shared_ptr<core::dbus::Property<Property::Master>> master; | ||
3293 | 411 | |||
3294 | 412 | private: | ||
3295 | 413 | std::shared_ptr<core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>> properties_changed; | ||
3296 | 414 | core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>::SubscriptionToken token; | ||
3297 | 415 | }; // Interface::ActiveConnection | ||
3298 | 416 | |||
3299 | 417 | struct Connection | ||
3300 | 418 | { | ||
3301 | 419 | std::shared_ptr<core::dbus::Object> object; | ||
3302 | 420 | |||
3303 | 421 | Connection(const std::shared_ptr<core::dbus::Object>& object) | ||
3304 | 422 | : object(object) | ||
3305 | 423 | {} | ||
3306 | 424 | |||
3307 | 425 | static const std::string& name() | ||
3308 | 426 | { | ||
3309 | 427 | static const std::string s{NM_DBUS_IFACE_SETTINGS_CONNECTION}; | ||
3310 | 428 | return s; | ||
3311 | 429 | } | ||
3312 | 430 | |||
3313 | 431 | struct Method { | ||
3314 | 432 | struct GetSettings | ||
3315 | 433 | { | ||
3316 | 434 | static const std::string& name() | ||
3317 | 435 | { | ||
3318 | 436 | static const std::string s{"GetSettings"}; | ||
3319 | 437 | return s; | ||
3320 | 438 | } | ||
3321 | 439 | |||
3322 | 440 | typedef Connection Interface; | ||
3323 | 441 | typedef std::map<std::string, std::map<std::string, core::dbus::types::Variant>> ResultType; | ||
3324 | 442 | |||
3325 | 443 | static std::chrono::milliseconds default_timeout() | ||
3326 | 444 | { | ||
3327 | 445 | return std::chrono::seconds{30}; | ||
3328 | 446 | } | ||
3329 | 447 | }; | ||
3330 | 448 | }; | ||
3331 | 449 | |||
3332 | 450 | Method::GetSettings::ResultType | ||
3333 | 451 | get_settings() | ||
3334 | 452 | { | ||
3335 | 453 | |||
3336 | 454 | auto result = object->invoke_method_synchronously<Method::GetSettings, Method::GetSettings::ResultType>(); | ||
3337 | 455 | |||
3338 | 456 | if (result.is_error()) | ||
3339 | 457 | connectivity::throw_dbus_exception(result.error()); | ||
3340 | 458 | |||
3341 | 459 | return result.value(); | ||
3342 | 460 | } | ||
3343 | 461 | }; // Interface::Connection | ||
3344 | 462 | |||
3345 | 463 | struct Device | ||
3346 | 464 | { | ||
3347 | 465 | static const std::string& name() | ||
3348 | 466 | { | ||
3349 | 467 | static const std::string s{NM_DBUS_INTERFACE_DEVICE}; | ||
3350 | 468 | return s; | ||
3351 | 469 | } | ||
3352 | 470 | |||
3353 | 471 | enum class Type | ||
3354 | 472 | { | ||
3355 | 473 | unknown = NM_DEVICE_TYPE_UNKNOWN, | ||
3356 | 474 | ethernet = NM_DEVICE_TYPE_ETHERNET, | ||
3357 | 475 | wifi = NM_DEVICE_TYPE_WIFI, | ||
3358 | 476 | unused_1 = NM_DEVICE_TYPE_UNUSED1, | ||
3359 | 477 | unused_2 = NM_DEVICE_TYPE_UNUSED2, | ||
3360 | 478 | bluetooth = NM_DEVICE_TYPE_BT, | ||
3361 | 479 | olpc_mesh = NM_DEVICE_TYPE_OLPC_MESH, | ||
3362 | 480 | wimax = NM_DEVICE_TYPE_WIMAX, | ||
3363 | 481 | modem = NM_DEVICE_TYPE_MODEM, | ||
3364 | 482 | infiniband = NM_DEVICE_TYPE_INFINIBAND, | ||
3365 | 483 | bond = NM_DEVICE_TYPE_BOND, | ||
3366 | 484 | vlan = NM_DEVICE_TYPE_VLAN, | ||
3367 | 485 | adsl = NM_DEVICE_TYPE_ADSL, | ||
3368 | 486 | bridge = NM_DEVICE_TYPE_BRIDGE | ||
3369 | 487 | }; | ||
3370 | 488 | |||
3371 | 489 | struct Wireless | ||
3372 | 490 | { | ||
3373 | 491 | static const std::string& name() | ||
3374 | 492 | { | ||
3375 | 493 | static const std::string s{NM_DBUS_INTERFACE_DEVICE_WIRELESS}; | ||
3376 | 494 | return s; | ||
3377 | 495 | } | ||
3378 | 496 | |||
3379 | 497 | struct Method { | ||
3380 | 498 | struct GetAccessPoints | ||
3381 | 499 | { | ||
3382 | 500 | static const std::string& name() | ||
3383 | 501 | { | ||
3384 | 502 | static const std::string s{"GetAccessPoints"}; | ||
3385 | 503 | return s; | ||
3386 | 504 | } | ||
3387 | 505 | |||
3388 | 506 | typedef Wireless Interface; | ||
3389 | 507 | typedef std::vector<core::dbus::types::ObjectPath> ResultType; | ||
3390 | 508 | |||
3391 | 509 | static std::chrono::milliseconds default_timeout() | ||
3392 | 510 | { | ||
3393 | 511 | return std::chrono::seconds{30}; | ||
3394 | 512 | } | ||
3395 | 513 | }; | ||
3396 | 514 | }; | ||
3397 | 515 | |||
3398 | 516 | struct Signal { | ||
3399 | 517 | struct AccessPointAdded | ||
3400 | 518 | { | ||
3401 | 519 | static const std::string& name() | ||
3402 | 520 | { | ||
3403 | 521 | static const std::string s{"AccessPointAdded"}; | ||
3404 | 522 | return s; | ||
3405 | 523 | } | ||
3406 | 524 | |||
3407 | 525 | typedef Wireless Interface; | ||
3408 | 526 | typedef core::dbus::types::ObjectPath ArgumentType; | ||
3409 | 527 | }; | ||
3410 | 528 | |||
3411 | 529 | struct AccessPointRemoved | ||
3412 | 530 | { | ||
3413 | 531 | static const std::string& name() | ||
3414 | 532 | { | ||
3415 | 533 | static const std::string s{"AccessPointRemoved"}; | ||
3416 | 534 | return s; | ||
3417 | 535 | } | ||
3418 | 536 | |||
3419 | 537 | typedef Wireless Interface; | ||
3420 | 538 | typedef core::dbus::types::ObjectPath ArgumentType; | ||
3421 | 539 | }; | ||
3422 | 540 | }; | ||
3423 | 541 | |||
3424 | 542 | Wireless(std::shared_ptr<core::dbus::Object> &base) | ||
3425 | 543 | : access_point_added(base->get_signal<Signal::AccessPointAdded>()), | ||
3426 | 544 | access_point_removed(base->get_signal<Signal::AccessPointRemoved>()) | ||
3427 | 545 | {} | ||
3428 | 546 | |||
3429 | 547 | std::shared_ptr<core::dbus::Signal<Signal::AccessPointAdded, Signal::AccessPointAdded::ArgumentType>> access_point_added; | ||
3430 | 548 | std::shared_ptr<core::dbus::Signal<Signal::AccessPointRemoved, Signal::AccessPointRemoved::ArgumentType>> access_point_removed; | ||
3431 | 549 | |||
3432 | 550 | }; // Interface::Device::Wireless | ||
3433 | 551 | |||
3434 | 552 | struct Property { | ||
3435 | 553 | struct DeviceType | ||
3436 | 554 | { | ||
3437 | 555 | static const std::string& name() | ||
3438 | 556 | { | ||
3439 | 557 | static const std::string s{"DeviceType"}; | ||
3440 | 558 | return s; | ||
3441 | 559 | } | ||
3442 | 560 | |||
3443 | 561 | typedef Device Interface; | ||
3444 | 562 | typedef std::uint32_t ValueType; | ||
3445 | 563 | static const bool readable = true; | ||
3446 | 564 | static const bool writable = false; | ||
3447 | 565 | }; | ||
3448 | 566 | |||
3449 | 567 | struct DeviceInterface { | ||
3450 | 568 | static const std::string& name() | ||
3451 | 569 | { | ||
3452 | 570 | static const std::string s{"Interface"}; | ||
3453 | 571 | return s; | ||
3454 | 572 | } | ||
3455 | 573 | |||
3456 | 574 | typedef Device Interface; | ||
3457 | 575 | typedef std::string ValueType; | ||
3458 | 576 | static const bool readable = true; | ||
3459 | 577 | static const bool writable = false; | ||
3460 | 578 | }; | ||
3461 | 579 | |||
3462 | 580 | struct Autoconnect | ||
3463 | 581 | { | ||
3464 | 582 | static const std::string& name() | ||
3465 | 583 | { | ||
3466 | 584 | static const std::string s{"Autoconnect"}; | ||
3467 | 585 | return s; | ||
3468 | 586 | } | ||
3469 | 587 | |||
3470 | 588 | typedef Device Interface; | ||
3471 | 589 | typedef bool ValueType; | ||
3472 | 590 | static const bool readable = true; | ||
3473 | 591 | static const bool writable = true; | ||
3474 | 592 | }; | ||
3475 | 593 | |||
3476 | 594 | struct State { | ||
3477 | 595 | static const std::string &name() | ||
3478 | 596 | { | ||
3479 | 597 | static const std::string s{"State"}; | ||
3480 | 598 | return s; | ||
3481 | 599 | } | ||
3482 | 600 | |||
3483 | 601 | typedef Device Interface; | ||
3484 | 602 | typedef std::uint32_t ValueType; | ||
3485 | 603 | static const bool readable = true; | ||
3486 | 604 | static const bool writable = false; | ||
3487 | 605 | }; | ||
3488 | 606 | |||
3489 | 607 | struct AvailableConnections { | ||
3490 | 608 | static const std::string &name() | ||
3491 | 609 | { | ||
3492 | 610 | static const std::string s{"AvailableConnections"}; | ||
3493 | 611 | return s; | ||
3494 | 612 | } | ||
3495 | 613 | |||
3496 | 614 | typedef Device Interface; | ||
3497 | 615 | typedef std::vector<core::dbus::types::ObjectPath> ValueType; | ||
3498 | 616 | static const bool readable = true; | ||
3499 | 617 | static const bool writable = false; | ||
3500 | 618 | }; | ||
3501 | 619 | |||
3502 | 620 | struct ActiveConnection { | ||
3503 | 621 | static const std::string &name() | ||
3504 | 622 | { | ||
3505 | 623 | static const std::string s{"ActiveConnection"}; | ||
3506 | 624 | return s; | ||
3507 | 625 | } | ||
3508 | 626 | |||
3509 | 627 | typedef Device Interface; | ||
3510 | 628 | typedef core::dbus::types::ObjectPath ValueType; | ||
3511 | 629 | static const bool readable = true; | ||
3512 | 630 | static const bool writable = false; | ||
3513 | 631 | }; | ||
3514 | 632 | }; | ||
3515 | 633 | |||
3516 | 634 | std::vector<Connection> | ||
3517 | 635 | get_available_connections() { | ||
3518 | 636 | std::vector<Connection> list; | ||
3519 | 637 | for (auto c: available_connections->get()) { | ||
3520 | 638 | list.push_back(Connection(service->object_for_path(c))); | ||
3521 | 639 | } | ||
3522 | 640 | return list; | ||
3523 | 641 | } | ||
3524 | 642 | |||
3525 | 643 | struct Method { | ||
3526 | 644 | |||
3527 | 645 | struct Disconnect | ||
3528 | 646 | { | ||
3529 | 647 | static const std::string& name() | ||
3530 | 648 | { | ||
3531 | 649 | static const std::string s{"Disconnect"}; | ||
3532 | 650 | return s; | ||
3533 | 651 | } | ||
3534 | 652 | |||
3535 | 653 | typedef Device Interface; | ||
3536 | 654 | typedef void ResultType; | ||
3537 | 655 | |||
3538 | 656 | static std::chrono::milliseconds default_timeout() | ||
3539 | 657 | { | ||
3540 | 658 | return std::chrono::seconds{30}; | ||
3541 | 659 | } | ||
3542 | 660 | }; | ||
3543 | 661 | }; | ||
3544 | 662 | |||
3545 | 663 | void disconnect() | ||
3546 | 664 | { | ||
3547 | 665 | auto result = | ||
3548 | 666 | object->invoke_method_synchronously< | ||
3549 | 667 | Device::Method::Disconnect, Device::Method::Disconnect::ResultType>(); | ||
3550 | 668 | |||
3551 | 669 | if (result.is_error()) | ||
3552 | 670 | connectivity::throw_dbus_exception(result.error()); | ||
3553 | 671 | } | ||
3554 | 672 | |||
3555 | 673 | struct Signal { | ||
3556 | 674 | struct StateChanged | ||
3557 | 675 | { | ||
3558 | 676 | static const std::string& name() | ||
3559 | 677 | { | ||
3560 | 678 | static const std::string s{"StateChanged"}; | ||
3561 | 679 | return s; | ||
3562 | 680 | } | ||
3563 | 681 | |||
3564 | 682 | typedef Device Interface; | ||
3565 | 683 | typedef std::tuple<std::uint32_t, std::uint32_t, std::uint32_t> ArgumentType; | ||
3566 | 684 | }; | ||
3567 | 685 | }; | ||
3568 | 686 | |||
3569 | 687 | |||
3570 | 688 | Type type() const | ||
3571 | 689 | { | ||
3572 | 690 | return static_cast<Type>(device_type->get()); | ||
3573 | 691 | } | ||
3574 | 692 | |||
3575 | 693 | std::string interface() const | ||
3576 | 694 | { | ||
3577 | 695 | return device_interface->get(); | ||
3578 | 696 | } | ||
3579 | 697 | |||
3580 | 698 | Wireless::Method::GetAccessPoints::ResultType get_access_points() const | ||
3581 | 699 | { | ||
3582 | 700 | auto result = object->invoke_method_synchronously<Wireless::Method::GetAccessPoints, | ||
3583 | 701 | Wireless::Method::GetAccessPoints::ResultType>(); | ||
3584 | 702 | |||
3585 | 703 | if (result.is_error()) | ||
3586 | 704 | connectivity::throw_dbus_exception(result.error()); | ||
3587 | 705 | |||
3588 | 706 | return result.value(); | ||
3589 | 707 | } | ||
3590 | 708 | |||
3591 | 709 | Device(const std::shared_ptr<core::dbus::Service>& service, | ||
3592 | 710 | const std::shared_ptr<core::dbus::Object>& object) | ||
3593 | 711 | : service(service), | ||
3594 | 712 | object(object), | ||
3595 | 713 | device_type(object->get_property<Property::DeviceType>()), | ||
3596 | 714 | autoconnect(object->get_property<Property::Autoconnect>()), | ||
3597 | 715 | device_interface(object->get_property<Property::DeviceInterface>()), | ||
3598 | 716 | state(object->get_property<Property::State>()), | ||
3599 | 717 | state_changed(object->get_signal<Signal::StateChanged>()), | ||
3600 | 718 | available_connections(object->get_property<Property::AvailableConnections>()), | ||
3601 | 719 | active_connection(object->get_property<Property::ActiveConnection>()) | ||
3602 | 720 | {} | ||
3603 | 721 | |||
3604 | 722 | std::shared_ptr<core::dbus::Service> service; | ||
3605 | 723 | std::shared_ptr<core::dbus::Object> object; | ||
3606 | 724 | std::shared_ptr<core::dbus::Property<Property::DeviceType>> device_type; | ||
3607 | 725 | std::shared_ptr<core::dbus::Property<Property::Autoconnect>> autoconnect; | ||
3608 | 726 | std::shared_ptr<core::dbus::Property<Property::DeviceInterface>> device_interface; | ||
3609 | 727 | std::shared_ptr<core::dbus::Property<Property::State>> state; | ||
3610 | 728 | std::shared_ptr<core::dbus::Signal<Signal::StateChanged, Signal::StateChanged::ArgumentType>> state_changed; | ||
3611 | 729 | std::shared_ptr<core::dbus::Property<Property::AvailableConnections>> available_connections; | ||
3612 | 730 | std::shared_ptr<core::dbus::Property<Property::ActiveConnection>> active_connection; | ||
3613 | 731 | }; // Interface::Device | ||
3614 | 732 | |||
3615 | 733 | struct NetworkManager | ||
3616 | 734 | { | ||
3617 | 735 | static const std::string& name() | ||
3618 | 736 | { | ||
3619 | 737 | static const std::string s{NM_DBUS_INTERFACE}; | ||
3620 | 738 | return s; | ||
3621 | 739 | } | ||
3622 | 740 | |||
3623 | 741 | struct Method { | ||
3624 | 742 | struct ActivateConnection | ||
3625 | 743 | { | ||
3626 | 744 | static const std::string& name() | ||
3627 | 745 | { | ||
3628 | 746 | static const std::string s{"ActivateConnection"}; | ||
3629 | 747 | return s; | ||
3630 | 748 | } | ||
3631 | 749 | |||
3632 | 750 | typedef NetworkManager Interface; | ||
3633 | 751 | typedef core::dbus::types::ObjectPath ResultType; | ||
3634 | 752 | |||
3635 | 753 | static std::chrono::milliseconds default_timeout() | ||
3636 | 754 | { | ||
3637 | 755 | return std::chrono::seconds{30}; | ||
3638 | 756 | } | ||
3639 | 757 | }; | ||
3640 | 758 | |||
3641 | 759 | struct AddAndActivateConnection | ||
3642 | 760 | { | ||
3643 | 761 | static const std::string& name() | ||
3644 | 762 | { | ||
3645 | 763 | static const std::string s{"AddAndActivateConnection"}; | ||
3646 | 764 | return s; | ||
3647 | 765 | } | ||
3648 | 766 | |||
3649 | 767 | typedef NetworkManager Interface; | ||
3650 | 768 | typedef std::tuple<core::dbus::types::ObjectPath, core::dbus::types::ObjectPath> ResultType; | ||
3651 | 769 | |||
3652 | 770 | static std::chrono::milliseconds default_timeout() | ||
3653 | 771 | { | ||
3654 | 772 | return std::chrono::seconds{30}; | ||
3655 | 773 | } | ||
3656 | 774 | }; | ||
3657 | 775 | |||
3658 | 776 | struct GetDevices | ||
3659 | 777 | { | ||
3660 | 778 | static const std::string& name() | ||
3661 | 779 | { | ||
3662 | 780 | static const std::string s{"GetDevices"}; | ||
3663 | 781 | return s; | ||
3664 | 782 | } | ||
3665 | 783 | |||
3666 | 784 | typedef NetworkManager Interface; | ||
3667 | 785 | typedef std::vector<core::dbus::types::ObjectPath> ResultType; | ||
3668 | 786 | |||
3669 | 787 | static std::chrono::milliseconds default_timeout() | ||
3670 | 788 | { | ||
3671 | 789 | return std::chrono::seconds{30}; | ||
3672 | 790 | } | ||
3673 | 791 | }; | ||
3674 | 792 | |||
3675 | 793 | }; | ||
3676 | 794 | |||
3677 | 795 | |||
3678 | 796 | struct Property | ||
3679 | 797 | { | ||
3680 | 798 | struct WirelessEnabled { | ||
3681 | 799 | static const std::string &name() | ||
3682 | 800 | { | ||
3683 | 801 | static const std::string s{"WirelessEnabled"}; | ||
3684 | 802 | return s; | ||
3685 | 803 | } | ||
3686 | 804 | |||
3687 | 805 | typedef NetworkManager Interface; | ||
3688 | 806 | typedef bool ValueType; | ||
3689 | 807 | static const bool readable = true; | ||
3690 | 808 | static const bool writable = true; | ||
3691 | 809 | }; | ||
3692 | 810 | |||
3693 | 811 | struct State { | ||
3694 | 812 | static const std::string &name() | ||
3695 | 813 | { | ||
3696 | 814 | static const std::string s{"State"}; | ||
3697 | 815 | return s; | ||
3698 | 816 | } | ||
3699 | 817 | |||
3700 | 818 | typedef NetworkManager Interface; | ||
3701 | 819 | typedef std::uint32_t ValueType; | ||
3702 | 820 | static const bool readable = true; | ||
3703 | 821 | static const bool writable = false; | ||
3704 | 822 | }; | ||
3705 | 823 | |||
3706 | 824 | struct PrimaryConnection { | ||
3707 | 825 | static const std::string &name() | ||
3708 | 826 | { | ||
3709 | 827 | static const std::string s{"PrimaryConnection"}; | ||
3710 | 828 | return s; | ||
3711 | 829 | } | ||
3712 | 830 | |||
3713 | 831 | typedef NetworkManager Interface; | ||
3714 | 832 | typedef core::dbus::types::ObjectPath ValueType; | ||
3715 | 833 | static const bool readable = true; | ||
3716 | 834 | static const bool writable = false; | ||
3717 | 835 | }; | ||
3718 | 836 | |||
3719 | 837 | }; | ||
3720 | 838 | |||
3721 | 839 | struct Signal { | ||
3722 | 840 | |||
3723 | 841 | struct PropertiesChanged | ||
3724 | 842 | { | ||
3725 | 843 | static const std::string& name() | ||
3726 | 844 | { | ||
3727 | 845 | static const std::string s{"PropertiesChanged"}; | ||
3728 | 846 | return s; | ||
3729 | 847 | } | ||
3730 | 848 | |||
3731 | 849 | typedef NetworkManager Interface; | ||
3732 | 850 | typedef std::map<std::string, core::dbus::types::Variant> ArgumentType; | ||
3733 | 851 | }; | ||
3734 | 852 | |||
3735 | 853 | struct DeviceAdded | ||
3736 | 854 | { | ||
3737 | 855 | static const std::string& name() | ||
3738 | 856 | { | ||
3739 | 857 | static const std::string s{"DeviceAdded"}; | ||
3740 | 858 | return s; | ||
3741 | 859 | } | ||
3742 | 860 | |||
3743 | 861 | typedef NetworkManager Interface; | ||
3744 | 862 | typedef core::dbus::types::ObjectPath ArgumentType; | ||
3745 | 863 | }; | ||
3746 | 864 | |||
3747 | 865 | struct DeviceRemoved | ||
3748 | 866 | { | ||
3749 | 867 | static const std::string& name() | ||
3750 | 868 | { | ||
3751 | 869 | static const std::string s{"DeviceRemoved"}; | ||
3752 | 870 | return s; | ||
3753 | 871 | } | ||
3754 | 872 | |||
3755 | 873 | typedef NetworkManager Interface; | ||
3756 | 874 | typedef core::dbus::types::ObjectPath ArgumentType; | ||
3757 | 875 | }; | ||
3758 | 876 | }; | ||
3759 | 877 | |||
3760 | 878 | Method::ActivateConnection::ResultType | ||
3761 | 879 | activate_connection(const core::dbus::types::ObjectPath &connection, | ||
3762 | 880 | const core::dbus::types::ObjectPath &device, | ||
3763 | 881 | const core::dbus::types::ObjectPath &specific_object) | ||
3764 | 882 | { | ||
3765 | 883 | auto result = | ||
3766 | 884 | object->invoke_method_synchronously< | ||
3767 | 885 | Method::ActivateConnection, | ||
3768 | 886 | Method::ActivateConnection::ResultType> | ||
3769 | 887 | (connection, device, specific_object); | ||
3770 | 888 | |||
3771 | 889 | if (result.is_error()) | ||
3772 | 890 | connectivity::throw_dbus_exception(result.error()); | ||
3773 | 891 | |||
3774 | 892 | return result.value(); | ||
3775 | 893 | } | ||
3776 | 894 | |||
3777 | 895 | Method::AddAndActivateConnection::ResultType | ||
3778 | 896 | add_and_activate_connection(std::map<std::string, std::map<std::string, core::dbus::types::Variant>> &connection, | ||
3779 | 897 | const core::dbus::types::ObjectPath &device, | ||
3780 | 898 | const core::dbus::types::ObjectPath &specific_object) | ||
3781 | 899 | { | ||
3782 | 900 | auto result = | ||
3783 | 901 | object->invoke_method_synchronously< | ||
3784 | 902 | Method::AddAndActivateConnection, | ||
3785 | 903 | Method::AddAndActivateConnection::ResultType> | ||
3786 | 904 | (connection, device, specific_object); | ||
3787 | 905 | |||
3788 | 906 | if (result.is_error()) | ||
3789 | 907 | connectivity::throw_dbus_exception(result.error()); | ||
3790 | 908 | |||
3791 | 909 | |||
3792 | 910 | /// @todo return the settings (std::get<0>) object at some point | ||
3793 | 911 | return result.value(); | ||
3794 | 912 | } | ||
3795 | 913 | |||
3796 | 914 | std::vector<core::dbus::types::ObjectPath> get_devices() | ||
3797 | 915 | { | ||
3798 | 916 | auto result = | ||
3799 | 917 | object->invoke_method_synchronously< | ||
3800 | 918 | Method::GetDevices, | ||
3801 | 919 | Method::GetDevices::ResultType>(); | ||
3802 | 920 | |||
3803 | 921 | if (result.is_error()) | ||
3804 | 922 | connectivity::throw_dbus_exception(result.error()); | ||
3805 | 923 | |||
3806 | 924 | return result.value(); | ||
3807 | 925 | } | ||
3808 | 926 | |||
3809 | 927 | NetworkManager(std::shared_ptr<core::dbus::Service> &service, | ||
3810 | 928 | std::shared_ptr<core::dbus::Object> &object) | ||
3811 | 929 | : service(service), | ||
3812 | 930 | object(object), | ||
3813 | 931 | wireless_enabled(object->get_property<Property::WirelessEnabled>()), | ||
3814 | 932 | state(object->get_property<Property::State>()), | ||
3815 | 933 | properties_changed(object->get_signal<Signal::PropertiesChanged>()), | ||
3816 | 934 | primary_connection(object->get_property<Property::PrimaryConnection>()), | ||
3817 | 935 | device_added(object->get_signal<Signal::DeviceAdded>()), | ||
3818 | 936 | device_removed(object->get_signal<Signal::DeviceRemoved>()) | ||
3819 | 937 | { | ||
3820 | 938 | } | ||
3821 | 939 | |||
3822 | 940 | std::shared_ptr<core::dbus::Service> service; | ||
3823 | 941 | std::shared_ptr<core::dbus::Object> object; | ||
3824 | 942 | |||
3825 | 943 | std::shared_ptr<core::dbus::Property<Property::WirelessEnabled>> wireless_enabled; | ||
3826 | 944 | std::shared_ptr<core::dbus::Property<Property::State>> state; | ||
3827 | 945 | std::shared_ptr<core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>> properties_changed; | ||
3828 | 946 | std::shared_ptr<core::dbus::Property<Property::PrimaryConnection>> primary_connection; | ||
3829 | 947 | std::shared_ptr<core::dbus::Signal<Signal::DeviceAdded, Signal::DeviceAdded::ArgumentType>> device_added; | ||
3830 | 948 | std::shared_ptr<core::dbus::Signal<Signal::DeviceRemoved, Signal::DeviceRemoved::ArgumentType>> device_removed; | ||
3831 | 949 | }; // Interface::NetworkManager | ||
3832 | 950 | }; | ||
3833 | 951 | |||
3834 | 952 | struct Service | ||
3835 | 953 | { | ||
3836 | 954 | std::shared_ptr<Interface::NetworkManager> nm; | ||
3837 | 955 | |||
3838 | 956 | Service(const core::dbus::Bus::Ptr& bus) | ||
3839 | 957 | { | ||
3840 | 958 | auto service = core::dbus::Service::use_service<Interface::NetworkManager>(bus); | ||
3841 | 959 | auto object = service->object_for_path(core::dbus::types::ObjectPath(NM_DBUS_PATH)); | ||
3842 | 960 | nm = std::make_shared<Interface::NetworkManager>(service, object); | ||
3843 | 961 | } | ||
3844 | 962 | |||
3845 | 963 | struct Mock | ||
3846 | 964 | { | ||
3847 | 965 | std::shared_ptr<Interface::NetworkManager> nm; | ||
3848 | 966 | |||
3849 | 967 | Mock(const core::dbus::Bus::Ptr& bus) | ||
3850 | 968 | { | ||
3851 | 969 | auto service = core::dbus::Service::add_service<Interface::NetworkManager>(bus); | ||
3852 | 970 | auto object = service->add_object_for_path(core::dbus::types::ObjectPath(NM_DBUS_PATH)); | ||
3853 | 971 | nm = std::make_shared<Interface::NetworkManager>(service, object); | ||
3854 | 972 | } | ||
3855 | 973 | }; | ||
3856 | 974 | }; | ||
3857 | 975 | } | ||
3858 | 976 | } | ||
3859 | 977 | } | ||
3860 | 978 | |||
3861 | 979 | #endif // PLATFORM_MANAGER_NMOFONO_NM_H | ||
3862 | 980 | 0 | ||
3863 | === removed file 'src/connectivity-cpp/dbus-cpp/services/ofono.h' | |||
3864 | --- src/connectivity-cpp/dbus-cpp/services/ofono.h 2014-08-19 19:55:15 +0000 | |||
3865 | +++ src/connectivity-cpp/dbus-cpp/services/ofono.h 1970-01-01 00:00:00 +0000 | |||
3866 | @@ -1,339 +0,0 @@ | |||
3867 | 1 | /* | ||
3868 | 2 | * Copyright © 2012-2013 Canonical Ltd. | ||
3869 | 3 | * | ||
3870 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
3871 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
3872 | 6 | * as published by the Free Software Foundation. | ||
3873 | 7 | * | ||
3874 | 8 | * This program is distributed in the hope that it will be useful, | ||
3875 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3876 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3877 | 11 | * GNU Lesser General Public License for more details. | ||
3878 | 12 | * | ||
3879 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
3880 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3881 | 15 | * | ||
3882 | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> | ||
3883 | 17 | */ | ||
3884 | 18 | #ifndef LOCATION_SERVICE_LOCATION_CONNECTIVITY_OFONO_H | ||
3885 | 19 | #define LOCATION_SERVICE_LOCATION_CONNECTIVITY_OFONO_H | ||
3886 | 20 | |||
3887 | 21 | #include <core/dbus/bus.h> | ||
3888 | 22 | #include <core/dbus/object.h> | ||
3889 | 23 | #include <core/dbus/property.h> | ||
3890 | 24 | #include <core/dbus/service.h> | ||
3891 | 25 | #include <core/dbus/types/object_path.h> | ||
3892 | 26 | #include <core/dbus/types/struct.h> | ||
3893 | 27 | #include <core/dbus/types/stl/map.h> | ||
3894 | 28 | #include <core/dbus/types/stl/string.h> | ||
3895 | 29 | #include <core/dbus/types/stl/tuple.h> | ||
3896 | 30 | #include <core/dbus/types/stl/vector.h> | ||
3897 | 31 | #include<com/ubuntu/connectivity/util.h> | ||
3898 | 32 | |||
3899 | 33 | namespace org | ||
3900 | 34 | { | ||
3901 | 35 | struct Ofono | ||
3902 | 36 | { | ||
3903 | 37 | static const std::string& name() | ||
3904 | 38 | { | ||
3905 | 39 | static const std::string s{"org.ofono"}; | ||
3906 | 40 | return s; | ||
3907 | 41 | } | ||
3908 | 42 | struct Manager | ||
3909 | 43 | { | ||
3910 | 44 | static const std::string& name() | ||
3911 | 45 | { | ||
3912 | 46 | static const std::string s{"org.ofono.Manager"}; | ||
3913 | 47 | return s; | ||
3914 | 48 | } | ||
3915 | 49 | |||
3916 | 50 | struct GetModems | ||
3917 | 51 | { | ||
3918 | 52 | static const std::string& name() | ||
3919 | 53 | { | ||
3920 | 54 | static const std::string s{"GetModems"}; | ||
3921 | 55 | return s; | ||
3922 | 56 | } | ||
3923 | 57 | |||
3924 | 58 | typedef Manager Interface; | ||
3925 | 59 | typedef std::vector< | ||
3926 | 60 | core::dbus::types::Struct< | ||
3927 | 61 | core::dbus::types::ObjectPath | ||
3928 | 62 | > | ||
3929 | 63 | > ResultType; | ||
3930 | 64 | |||
3931 | 65 | static std::chrono::milliseconds default_timeout() | ||
3932 | 66 | { | ||
3933 | 67 | return std::chrono::seconds{1}; | ||
3934 | 68 | } | ||
3935 | 69 | }; | ||
3936 | 70 | |||
3937 | 71 | struct ModemAdded | ||
3938 | 72 | { | ||
3939 | 73 | static const std::string& name() | ||
3940 | 74 | { | ||
3941 | 75 | static const std::string s{"ModemAdded"}; | ||
3942 | 76 | return s; | ||
3943 | 77 | } | ||
3944 | 78 | |||
3945 | 79 | typedef Manager Interface; | ||
3946 | 80 | typedef std::tuple<core::dbus::types::ObjectPath, std::map<std::string, std::string>> ArgumentType; | ||
3947 | 81 | }; | ||
3948 | 82 | |||
3949 | 83 | struct ModemRemoved | ||
3950 | 84 | { | ||
3951 | 85 | static const std::string& name() | ||
3952 | 86 | { | ||
3953 | 87 | static const std::string s{"ModemRemoved"}; | ||
3954 | 88 | return s; | ||
3955 | 89 | } | ||
3956 | 90 | |||
3957 | 91 | typedef Manager Interface; | ||
3958 | 92 | typedef core::dbus::types::ObjectPath ArgumentType; | ||
3959 | 93 | }; | ||
3960 | 94 | |||
3961 | 95 | struct Modem | ||
3962 | 96 | { | ||
3963 | 97 | struct NetworkRegistration | ||
3964 | 98 | { | ||
3965 | 99 | static const std::string& name() | ||
3966 | 100 | { | ||
3967 | 101 | static const std::string s{"org.ofono.NetworkRegistration"}; | ||
3968 | 102 | return s; | ||
3969 | 103 | } | ||
3970 | 104 | |||
3971 | 105 | struct GetProperties | ||
3972 | 106 | { | ||
3973 | 107 | static const std::string& name() | ||
3974 | 108 | { | ||
3975 | 109 | static const std::string s{"GetProperties"}; | ||
3976 | 110 | return s; | ||
3977 | 111 | } | ||
3978 | 112 | |||
3979 | 113 | typedef NetworkRegistration Interface; | ||
3980 | 114 | typedef std::map<std::string, core::dbus::types::Variant<>> ValueType; | ||
3981 | 115 | |||
3982 | 116 | static std::chrono::milliseconds default_timeout() | ||
3983 | 117 | { | ||
3984 | 118 | return std::chrono::seconds{1}; | ||
3985 | 119 | } | ||
3986 | 120 | }; | ||
3987 | 121 | |||
3988 | 122 | struct Mode | ||
3989 | 123 | { | ||
3990 | 124 | static const char* unregistered() { return "unregistered"; } | ||
3991 | 125 | static const char* registered() { return "registered"; } | ||
3992 | 126 | static const char* searching() { return "searching"; } | ||
3993 | 127 | static const char* denied() { return "denied"; } | ||
3994 | 128 | static const char* unknown() { return "unknown"; } | ||
3995 | 129 | static const char* roaming() { return "roaming"; } | ||
3996 | 130 | |||
3997 | 131 | static const std::string& name() | ||
3998 | 132 | { | ||
3999 | 133 | static const std::string s{"Mode"}; | ||
4000 | 134 | return s; | ||
4001 | 135 | } | ||
4002 | 136 | |||
4003 | 137 | typedef NetworkRegistration Interface; | ||
4004 | 138 | typedef std::string ValueType; | ||
4005 | 139 | static const bool readable = true; | ||
4006 | 140 | static const bool writable = false; | ||
4007 | 141 | }; | ||
4008 | 142 | |||
4009 | 143 | struct LocationAreaCode | ||
4010 | 144 | { | ||
4011 | 145 | static const std::string& name() | ||
4012 | 146 | { | ||
4013 | 147 | static const std::string s{"LocationAreaCode"}; | ||
4014 | 148 | return s; | ||
4015 | 149 | } | ||
4016 | 150 | |||
4017 | 151 | typedef NetworkRegistration Interface; | ||
4018 | 152 | typedef std::uint16_t ValueType; | ||
4019 | 153 | static const bool readable = true; | ||
4020 | 154 | static const bool writable = false; | ||
4021 | 155 | }; | ||
4022 | 156 | |||
4023 | 157 | struct CellId | ||
4024 | 158 | { | ||
4025 | 159 | static const std::string& name() | ||
4026 | 160 | { | ||
4027 | 161 | static const std::string s{"CellId"}; | ||
4028 | 162 | return s; | ||
4029 | 163 | } | ||
4030 | 164 | |||
4031 | 165 | typedef NetworkRegistration Interface; | ||
4032 | 166 | typedef std::uint32_t ValueType; | ||
4033 | 167 | static const bool readable = true; | ||
4034 | 168 | static const bool writable = false; | ||
4035 | 169 | }; | ||
4036 | 170 | |||
4037 | 171 | struct MobileCountryCode | ||
4038 | 172 | { | ||
4039 | 173 | static const std::string& name() | ||
4040 | 174 | { | ||
4041 | 175 | static const std::string s{"MobileCountryCode"}; | ||
4042 | 176 | return s; | ||
4043 | 177 | } | ||
4044 | 178 | |||
4045 | 179 | typedef NetworkRegistration Interface; | ||
4046 | 180 | typedef std::string ValueType; | ||
4047 | 181 | static const bool readable = true; | ||
4048 | 182 | static const bool writable = false; | ||
4049 | 183 | }; | ||
4050 | 184 | |||
4051 | 185 | struct MobileNetworkCode | ||
4052 | 186 | { | ||
4053 | 187 | static const std::string& name() | ||
4054 | 188 | { | ||
4055 | 189 | static const std::string s{"MobileNetworkCode"}; | ||
4056 | 190 | return s; | ||
4057 | 191 | } | ||
4058 | 192 | |||
4059 | 193 | typedef NetworkRegistration Interface; | ||
4060 | 194 | typedef std::string ValueType; | ||
4061 | 195 | static const bool readable = true; | ||
4062 | 196 | static const bool writable = false; | ||
4063 | 197 | }; | ||
4064 | 198 | |||
4065 | 199 | struct Technology | ||
4066 | 200 | { | ||
4067 | 201 | static const char* gsm() { return "gsm"; } | ||
4068 | 202 | static const char* edge() { return "edge"; } | ||
4069 | 203 | static const char* umts() { return "umts"; } | ||
4070 | 204 | static const char* hspa() { return "hspa"; } | ||
4071 | 205 | static const char* lte() { return "lte"; } | ||
4072 | 206 | |||
4073 | 207 | static const std::string& name() | ||
4074 | 208 | { | ||
4075 | 209 | static const std::string s{"Technology"}; | ||
4076 | 210 | return s; | ||
4077 | 211 | } | ||
4078 | 212 | |||
4079 | 213 | typedef NetworkRegistration Interface; | ||
4080 | 214 | typedef std::string ValueType; | ||
4081 | 215 | static const bool readable = true; | ||
4082 | 216 | static const bool writable = false; | ||
4083 | 217 | }; | ||
4084 | 218 | |||
4085 | 219 | struct Strength | ||
4086 | 220 | { | ||
4087 | 221 | static const std::string& name() | ||
4088 | 222 | { | ||
4089 | 223 | static const std::string s{"Strength"}; | ||
4090 | 224 | return s; | ||
4091 | 225 | } | ||
4092 | 226 | |||
4093 | 227 | typedef NetworkRegistration Interface; | ||
4094 | 228 | typedef std::int8_t ValueType; | ||
4095 | 229 | static const bool readable = true; | ||
4096 | 230 | static const bool writable = false; | ||
4097 | 231 | }; | ||
4098 | 232 | |||
4099 | 233 | NetworkRegistration(const std::shared_ptr<core::dbus::Object>& object) | ||
4100 | 234 | : object(object), | ||
4101 | 235 | properties{} | ||
4102 | 236 | { | ||
4103 | 237 | auto result = object->invoke_method_synchronously<GetProperties, GetProperties::ValueType>(); | ||
4104 | 238 | if (result.is_error()) | ||
4105 | 239 | connectivity::throw_dbus_exception(result.error()); | ||
4106 | 240 | |||
4107 | 241 | properties = result.value(); | ||
4108 | 242 | } | ||
4109 | 243 | |||
4110 | 244 | template<typename Property> | ||
4111 | 245 | typename Property::ValueType get( | ||
4112 | 246 | const typename Property::ValueType& default_value = typename Property::ValueType{}) const | ||
4113 | 247 | { | ||
4114 | 248 | try | ||
4115 | 249 | { | ||
4116 | 250 | core::dbus::types::Any value = properties.at(Property::name()).get(); | ||
4117 | 251 | typename Property::ValueType result; value.reader() >> result; | ||
4118 | 252 | |||
4119 | 253 | return result; | ||
4120 | 254 | } catch(...) | ||
4121 | 255 | { | ||
4122 | 256 | } | ||
4123 | 257 | |||
4124 | 258 | return default_value; | ||
4125 | 259 | } | ||
4126 | 260 | |||
4127 | 261 | std::shared_ptr<core::dbus::Object> object; | ||
4128 | 262 | GetProperties::ValueType properties; | ||
4129 | 263 | }; | ||
4130 | 264 | |||
4131 | 265 | Modem(const std::shared_ptr<core::dbus::Service>& service, | ||
4132 | 266 | const std::shared_ptr<core::dbus::Object>& object) | ||
4133 | 267 | : service(service), | ||
4134 | 268 | object(object), | ||
4135 | 269 | network_registration{object} | ||
4136 | 270 | { | ||
4137 | 271 | } | ||
4138 | 272 | |||
4139 | 273 | std::shared_ptr<core::dbus::Service> service; | ||
4140 | 274 | std::shared_ptr<core::dbus::Object> object; | ||
4141 | 275 | NetworkRegistration network_registration; | ||
4142 | 276 | }; | ||
4143 | 277 | |||
4144 | 278 | Manager(const core::dbus::Bus::Ptr& bus) | ||
4145 | 279 | : service(core::dbus::Service::use_service<org::Ofono>(bus)), | ||
4146 | 280 | object(service->object_for_path(core::dbus::types::ObjectPath("/"))), | ||
4147 | 281 | modem_added(object->get_signal<ModemAdded>()), | ||
4148 | 282 | modem_removed(object->get_signal<ModemRemoved>()) | ||
4149 | 283 | { | ||
4150 | 284 | auto result = object->invoke_method_synchronously<GetModems, GetModems::ResultType>(); | ||
4151 | 285 | |||
4152 | 286 | if (result.is_error()) | ||
4153 | 287 | connectivity::throw_dbus_exception(result.error()); | ||
4154 | 288 | |||
4155 | 289 | for (const auto& element : result.value()) | ||
4156 | 290 | { | ||
4157 | 291 | modems.insert( | ||
4158 | 292 | std::make_pair( | ||
4159 | 293 | element.value, | ||
4160 | 294 | Modem | ||
4161 | 295 | { | ||
4162 | 296 | service, | ||
4163 | 297 | service->object_for_path(element.value) | ||
4164 | 298 | })); | ||
4165 | 299 | } | ||
4166 | 300 | |||
4167 | 301 | modem_added->connect([this](const ModemAdded::ArgumentType& arg) | ||
4168 | 302 | { | ||
4169 | 303 | std::lock_guard<std::mutex> lg(guard); | ||
4170 | 304 | modems.insert( | ||
4171 | 305 | std::make_pair( | ||
4172 | 306 | std::get<0>(arg), | ||
4173 | 307 | Modem{ | ||
4174 | 308 | service, | ||
4175 | 309 | service->object_for_path(std::get<0>(arg)) | ||
4176 | 310 | })); | ||
4177 | 311 | }); | ||
4178 | 312 | |||
4179 | 313 | modem_removed->connect([this](const ModemRemoved::ArgumentType& arg) | ||
4180 | 314 | { | ||
4181 | 315 | std::lock_guard<std::mutex> lg(guard); | ||
4182 | 316 | modems.erase(arg); | ||
4183 | 317 | }); | ||
4184 | 318 | } | ||
4185 | 319 | |||
4186 | 320 | void for_each_modem(const std::function<void(const Modem&)>& functor) const | ||
4187 | 321 | { | ||
4188 | 322 | std::lock_guard<std::mutex> lg(guard); | ||
4189 | 323 | for (const auto& modem : modems) | ||
4190 | 324 | { | ||
4191 | 325 | functor(modem.second); | ||
4192 | 326 | } | ||
4193 | 327 | } | ||
4194 | 328 | |||
4195 | 329 | std::shared_ptr<core::dbus::Service> service; | ||
4196 | 330 | std::shared_ptr<core::dbus::Object> object; | ||
4197 | 331 | std::shared_ptr<core::dbus::Signal<ModemAdded, ModemAdded::ArgumentType>> modem_added; | ||
4198 | 332 | std::shared_ptr<core::dbus::Signal<ModemRemoved, ModemRemoved::ArgumentType>> modem_removed; | ||
4199 | 333 | mutable std::mutex guard; | ||
4200 | 334 | std::map<core::dbus::types::ObjectPath, Modem> modems; | ||
4201 | 335 | }; | ||
4202 | 336 | }; | ||
4203 | 337 | } | ||
4204 | 338 | |||
4205 | 339 | #endif // LOCATION_SERVICE_LOCATION_CONNECTIVITY_OFONO_H | ||
4206 | 340 | 0 | ||
4207 | === removed file 'src/connectivity-cpp/dbus-cpp/services/urfkill.h' | |||
4208 | --- src/connectivity-cpp/dbus-cpp/services/urfkill.h 2014-10-23 21:46:41 +0000 | |||
4209 | +++ src/connectivity-cpp/dbus-cpp/services/urfkill.h 1970-01-01 00:00:00 +0000 | |||
4210 | @@ -1,338 +0,0 @@ | |||
4211 | 1 | /* | ||
4212 | 2 | * Copyright © 2014 Canonical Ltd. | ||
4213 | 3 | * | ||
4214 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4215 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4216 | 6 | * as published by the Free Software Foundation. | ||
4217 | 7 | * | ||
4218 | 8 | * This program is distributed in the hope that it will be useful, | ||
4219 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4220 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4221 | 11 | * GNU Lesser General Public License for more details. | ||
4222 | 12 | * | ||
4223 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4224 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4225 | 15 | * | ||
4226 | 16 | * Authored by: Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
4227 | 17 | */ | ||
4228 | 18 | #ifndef PLATFORM_MANAGER_NMOFONO_URFKILL_H | ||
4229 | 19 | #define PLATFORM_MANAGER_NMOFONO_URFKILL_H | ||
4230 | 20 | |||
4231 | 21 | #include <core/dbus/bus.h> | ||
4232 | 22 | #include <core/dbus/object.h> | ||
4233 | 23 | #include <core/dbus/property.h> | ||
4234 | 24 | #include <core/dbus/service.h> | ||
4235 | 25 | #include <core/dbus/types/object_path.h> | ||
4236 | 26 | #include <core/dbus/types/any.h> | ||
4237 | 27 | #include <core/dbus/types/struct.h> | ||
4238 | 28 | #include <core/dbus/types/stl/map.h> | ||
4239 | 29 | #include <core/dbus/types/stl/string.h> | ||
4240 | 30 | #include <core/dbus/types/stl/tuple.h> | ||
4241 | 31 | #include <core/dbus/types/stl/vector.h> | ||
4242 | 32 | #include "util.h" | ||
4243 | 33 | |||
4244 | 34 | namespace org | ||
4245 | 35 | { | ||
4246 | 36 | namespace freedesktop | ||
4247 | 37 | { | ||
4248 | 38 | namespace URfkill | ||
4249 | 39 | { | ||
4250 | 40 | |||
4251 | 41 | struct Interface | ||
4252 | 42 | { | ||
4253 | 43 | struct Killswitch | ||
4254 | 44 | { | ||
4255 | 45 | static const std::string& name() | ||
4256 | 46 | { | ||
4257 | 47 | static const std::string s{"org.freedesktop.URfkill.Killswitch"}; | ||
4258 | 48 | return s; | ||
4259 | 49 | } | ||
4260 | 50 | |||
4261 | 51 | struct Property | ||
4262 | 52 | { | ||
4263 | 53 | struct State | ||
4264 | 54 | { | ||
4265 | 55 | static const std::string& name() | ||
4266 | 56 | { | ||
4267 | 57 | static const std::string s{"state"}; | ||
4268 | 58 | return s; | ||
4269 | 59 | } | ||
4270 | 60 | |||
4271 | 61 | typedef Killswitch Interface; | ||
4272 | 62 | typedef std::int32_t ValueType; | ||
4273 | 63 | static const bool readable = true; | ||
4274 | 64 | static const bool writable = false; | ||
4275 | 65 | }; | ||
4276 | 66 | }; | ||
4277 | 67 | |||
4278 | 68 | enum class Type; | ||
4279 | 69 | Killswitch(const std::shared_ptr<core::dbus::Object>& object, | ||
4280 | 70 | Type type) | ||
4281 | 71 | : object(object), | ||
4282 | 72 | type(type), | ||
4283 | 73 | _state(object->get_property<Property::State>()) | ||
4284 | 74 | { | ||
4285 | 75 | _state->changed().connect(std::bind(&Killswitch::_stateChanged, this, std::placeholders::_1)); | ||
4286 | 76 | _stateChanged(_state->get()); | ||
4287 | 77 | } | ||
4288 | 78 | |||
4289 | 79 | enum class State | ||
4290 | 80 | { | ||
4291 | 81 | not_available = -1, | ||
4292 | 82 | unblocked = 0, | ||
4293 | 83 | soft_blocked = 1, | ||
4294 | 84 | hard_blocked = 2 | ||
4295 | 85 | }; | ||
4296 | 86 | |||
4297 | 87 | enum class Type { | ||
4298 | 88 | bluetooth, | ||
4299 | 89 | fm, | ||
4300 | 90 | gps, | ||
4301 | 91 | nfc, | ||
4302 | 92 | uwb, | ||
4303 | 93 | wimax, | ||
4304 | 94 | wlan, | ||
4305 | 95 | wwan | ||
4306 | 96 | }; | ||
4307 | 97 | |||
4308 | 98 | static const std::string path(Type type) | ||
4309 | 99 | { | ||
4310 | 100 | switch(type) { | ||
4311 | 101 | case Type::bluetooth: | ||
4312 | 102 | return "/org/freedesktop/URfkill/BLUETOOTH"; | ||
4313 | 103 | case Type::fm: | ||
4314 | 104 | return "/org/freedesktop/URfkill/FM"; | ||
4315 | 105 | case Type::gps: | ||
4316 | 106 | return "/org/freedesktop/URfkill/GPS"; | ||
4317 | 107 | case Type::nfc: | ||
4318 | 108 | return "/org/freedesktop/URfkill/NFC"; | ||
4319 | 109 | case Type::uwb: | ||
4320 | 110 | return "/org/freedesktop/URfkill/UWB"; | ||
4321 | 111 | case Type::wimax: | ||
4322 | 112 | return "/org/freedesktop/URfkill/WIMAX"; | ||
4323 | 113 | case Type::wlan: | ||
4324 | 114 | return "/org/freedesktop/URfkill/WLAN"; | ||
4325 | 115 | case Type::wwan: | ||
4326 | 116 | return "/org/freedesktop/URfkill/WWAN"; | ||
4327 | 117 | } | ||
4328 | 118 | |||
4329 | 119 | return ""; | ||
4330 | 120 | } | ||
4331 | 121 | |||
4332 | 122 | void _stateChanged(Property::State::ValueType val) | ||
4333 | 123 | { | ||
4334 | 124 | if (val == -1) | ||
4335 | 125 | state.set(State::not_available); | ||
4336 | 126 | else if (val == 0) | ||
4337 | 127 | state.set(State::unblocked); | ||
4338 | 128 | else if (val == 1) | ||
4339 | 129 | state.set(State::soft_blocked); | ||
4340 | 130 | else if (val == 2) | ||
4341 | 131 | state.set(State::hard_blocked); | ||
4342 | 132 | else | ||
4343 | 133 | throw std::runtime_error("got unknown Killswitch state from urfkill: " + std::to_string(val)); | ||
4344 | 134 | } | ||
4345 | 135 | |||
4346 | 136 | std::shared_ptr<core::dbus::Object> object; | ||
4347 | 137 | const Type type; | ||
4348 | 138 | std::shared_ptr<core::dbus::Property<Property::State>> _state; | ||
4349 | 139 | core::Property<State> state; | ||
4350 | 140 | }; | ||
4351 | 141 | |||
4352 | 142 | struct URfkill | ||
4353 | 143 | { | ||
4354 | 144 | static const std::string& name() | ||
4355 | 145 | { | ||
4356 | 146 | static const std::string s{"org.freedesktop.URfkill"}; | ||
4357 | 147 | return s; | ||
4358 | 148 | } | ||
4359 | 149 | |||
4360 | 150 | struct Method | ||
4361 | 151 | { | ||
4362 | 152 | struct Block | ||
4363 | 153 | { | ||
4364 | 154 | static const std::string& name() | ||
4365 | 155 | { | ||
4366 | 156 | static const std::string s{"Block"}; | ||
4367 | 157 | return s; | ||
4368 | 158 | } | ||
4369 | 159 | |||
4370 | 160 | typedef URfkill Interface; | ||
4371 | 161 | typedef bool ResultType; | ||
4372 | 162 | |||
4373 | 163 | static std::chrono::milliseconds default_timeout() | ||
4374 | 164 | { | ||
4375 | 165 | return std::chrono::seconds{30}; | ||
4376 | 166 | } | ||
4377 | 167 | }; | ||
4378 | 168 | |||
4379 | 169 | struct FlightMode | ||
4380 | 170 | { | ||
4381 | 171 | static const std::string& name() | ||
4382 | 172 | { | ||
4383 | 173 | static const std::string s{"FlightMode"}; | ||
4384 | 174 | return s; | ||
4385 | 175 | } | ||
4386 | 176 | |||
4387 | 177 | typedef URfkill Interface; | ||
4388 | 178 | typedef bool ResultType; | ||
4389 | 179 | |||
4390 | 180 | static std::chrono::milliseconds default_timeout() | ||
4391 | 181 | { | ||
4392 | 182 | return std::chrono::seconds{30}; | ||
4393 | 183 | } | ||
4394 | 184 | }; | ||
4395 | 185 | |||
4396 | 186 | struct IsFlightMode | ||
4397 | 187 | { | ||
4398 | 188 | static const std::string& name() | ||
4399 | 189 | { | ||
4400 | 190 | static const std::string s{"IsFlightMode"}; | ||
4401 | 191 | return s; | ||
4402 | 192 | } | ||
4403 | 193 | |||
4404 | 194 | typedef URfkill Interface; | ||
4405 | 195 | typedef bool ResultType; | ||
4406 | 196 | |||
4407 | 197 | static std::chrono::milliseconds default_timeout() | ||
4408 | 198 | { | ||
4409 | 199 | return std::chrono::seconds{30}; | ||
4410 | 200 | } | ||
4411 | 201 | }; | ||
4412 | 202 | }; | ||
4413 | 203 | |||
4414 | 204 | struct Signal | ||
4415 | 205 | { | ||
4416 | 206 | struct FlightModeChanged | ||
4417 | 207 | { | ||
4418 | 208 | static const std::string& name() | ||
4419 | 209 | { | ||
4420 | 210 | static const std::string s{"FlightModeChanged"}; | ||
4421 | 211 | return s; | ||
4422 | 212 | } | ||
4423 | 213 | |||
4424 | 214 | typedef URfkill Interface; | ||
4425 | 215 | typedef bool ArgumentType; | ||
4426 | 216 | }; | ||
4427 | 217 | }; | ||
4428 | 218 | |||
4429 | 219 | URfkill(std::shared_ptr<core::dbus::Service> &service, | ||
4430 | 220 | std::shared_ptr<core::dbus::Object> &object) | ||
4431 | 221 | : service{service}, | ||
4432 | 222 | object{object}, | ||
4433 | 223 | flightModeChanged{object->get_signal<Signal::FlightModeChanged>()} | ||
4434 | 224 | { | ||
4435 | 225 | switches[Killswitch::Type::bluetooth] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::bluetooth)), Killswitch::Type::bluetooth); | ||
4436 | 226 | switches[Killswitch::Type::fm] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::fm)), Killswitch::Type::fm); | ||
4437 | 227 | switches[Killswitch::Type::gps] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::gps)), Killswitch::Type::gps); | ||
4438 | 228 | switches[Killswitch::Type::nfc] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::nfc)), Killswitch::Type::nfc); | ||
4439 | 229 | switches[Killswitch::Type::uwb] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::uwb)), Killswitch::Type::uwb); | ||
4440 | 230 | switches[Killswitch::Type::wimax] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::wimax)), Killswitch::Type::wimax); | ||
4441 | 231 | switches[Killswitch::Type::wlan] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::wlan)), Killswitch::Type::wlan); | ||
4442 | 232 | switches[Killswitch::Type::wwan] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::wwan)), Killswitch::Type::wwan); | ||
4443 | 233 | } | ||
4444 | 234 | |||
4445 | 235 | bool block(Killswitch::Type type, bool block) | ||
4446 | 236 | { | ||
4447 | 237 | std::uint32_t utype; | ||
4448 | 238 | switch (type) { | ||
4449 | 239 | case Killswitch::Type::bluetooth: | ||
4450 | 240 | utype = 2; | ||
4451 | 241 | break; | ||
4452 | 242 | case Killswitch::Type::fm: | ||
4453 | 243 | utype = 7; | ||
4454 | 244 | break; | ||
4455 | 245 | case Killswitch::Type::gps: | ||
4456 | 246 | utype = 6; | ||
4457 | 247 | break; | ||
4458 | 248 | case Killswitch::Type::nfc: | ||
4459 | 249 | utype = 8; /// @todo verify me | ||
4460 | 250 | break; | ||
4461 | 251 | case Killswitch::Type::uwb: | ||
4462 | 252 | utype = 3; | ||
4463 | 253 | break; | ||
4464 | 254 | case Killswitch::Type::wimax: | ||
4465 | 255 | utype = 4; | ||
4466 | 256 | break; | ||
4467 | 257 | case Killswitch::Type::wlan: | ||
4468 | 258 | utype = 1; | ||
4469 | 259 | break; | ||
4470 | 260 | case Killswitch::Type::wwan: | ||
4471 | 261 | utype = 5; | ||
4472 | 262 | break; | ||
4473 | 263 | } | ||
4474 | 264 | // we can't handle "all" (0) with this, but that's deprecated by FlightMode anyway | ||
4475 | 265 | |||
4476 | 266 | auto result = | ||
4477 | 267 | object->invoke_method_synchronously< | ||
4478 | 268 | Method::Block, Method::Block::ResultType> | ||
4479 | 269 | (utype, block); | ||
4480 | 270 | |||
4481 | 271 | if (result.is_error()) | ||
4482 | 272 | throw std::runtime_error(result.error().print()); | ||
4483 | 273 | |||
4484 | 274 | return result.value(); | ||
4485 | 275 | } | ||
4486 | 276 | |||
4487 | 277 | bool flightMode(bool block) | ||
4488 | 278 | { | ||
4489 | 279 | auto result = | ||
4490 | 280 | object->invoke_method_synchronously< | ||
4491 | 281 | Method::FlightMode, Method::FlightMode::ResultType> | ||
4492 | 282 | (block); | ||
4493 | 283 | |||
4494 | 284 | if (result.is_error()) | ||
4495 | 285 | throw std::runtime_error(result.error().print()); | ||
4496 | 286 | |||
4497 | 287 | return result.value(); | ||
4498 | 288 | } | ||
4499 | 289 | |||
4500 | 290 | bool isFlightMode() | ||
4501 | 291 | { | ||
4502 | 292 | auto result = | ||
4503 | 293 | object->invoke_method_synchronously< | ||
4504 | 294 | Method::IsFlightMode, Method::IsFlightMode::ResultType> | ||
4505 | 295 | (); | ||
4506 | 296 | |||
4507 | 297 | if (result.is_error()) | ||
4508 | 298 | throw std::runtime_error(result.error().print()); | ||
4509 | 299 | |||
4510 | 300 | return result.value(); | ||
4511 | 301 | } | ||
4512 | 302 | |||
4513 | 303 | std::shared_ptr<core::dbus::Service> service; | ||
4514 | 304 | std::shared_ptr<core::dbus::Object> object; | ||
4515 | 305 | std::shared_ptr<core::dbus::Signal<Signal::FlightModeChanged, Signal::FlightModeChanged::ArgumentType>> flightModeChanged; | ||
4516 | 306 | |||
4517 | 307 | std::map<Killswitch::Type, std::shared_ptr<Killswitch>> switches; | ||
4518 | 308 | }; | ||
4519 | 309 | }; | ||
4520 | 310 | |||
4521 | 311 | struct Service | ||
4522 | 312 | { | ||
4523 | 313 | std::shared_ptr<Interface::URfkill> urfkill; | ||
4524 | 314 | |||
4525 | 315 | Service(const core::dbus::Bus::Ptr& bus) | ||
4526 | 316 | { | ||
4527 | 317 | auto service = core::dbus::Service::use_service<Interface::URfkill>(bus); | ||
4528 | 318 | auto object = service->object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/URfkill")); | ||
4529 | 319 | urfkill = std::make_shared<Interface::URfkill>(service, object); | ||
4530 | 320 | } | ||
4531 | 321 | |||
4532 | 322 | struct Mock | ||
4533 | 323 | { | ||
4534 | 324 | std::shared_ptr<Interface::URfkill> urfkill; | ||
4535 | 325 | |||
4536 | 326 | Mock(const core::dbus::Bus::Ptr& bus) | ||
4537 | 327 | { | ||
4538 | 328 | auto service = core::dbus::Service::add_service<Interface::URfkill>(bus); | ||
4539 | 329 | auto object = service->add_object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/URfkill")); | ||
4540 | 330 | urfkill = std::make_shared<Interface::URfkill>(service, object); | ||
4541 | 331 | } | ||
4542 | 332 | }; | ||
4543 | 333 | }; | ||
4544 | 334 | } | ||
4545 | 335 | } | ||
4546 | 336 | } | ||
4547 | 337 | |||
4548 | 338 | #endif // PLATFORM_MANAGER_NMOFONO_URFKILL_H | ||
4549 | 339 | 0 | ||
4550 | === removed file 'src/connectivity-cpp/dbus-cpp/services/util.h' | |||
4551 | --- src/connectivity-cpp/dbus-cpp/services/util.h 2014-08-19 19:55:15 +0000 | |||
4552 | +++ src/connectivity-cpp/dbus-cpp/services/util.h 1970-01-01 00:00:00 +0000 | |||
4553 | @@ -1,36 +0,0 @@ | |||
4554 | 1 | /* | ||
4555 | 2 | * Copyright © 2013 Canonical Ltd. | ||
4556 | 3 | * | ||
4557 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4558 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4559 | 6 | * as published by the Free Software Foundation. | ||
4560 | 7 | * | ||
4561 | 8 | * This program is distributed in the hope that it will be useful, | ||
4562 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4563 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4564 | 11 | * GNU Lesser General Public License for more details. | ||
4565 | 12 | * | ||
4566 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4567 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4568 | 15 | * | ||
4569 | 16 | * Authors: | ||
4570 | 17 | * Jussi Pakkanen <jussi.pakkanen@canonical.com> | ||
4571 | 18 | */ | ||
4572 | 19 | |||
4573 | 20 | #ifndef CONNECTIVITY_UTIL_H | ||
4574 | 21 | #define CONNECTIVITY_UTIL_H | ||
4575 | 22 | |||
4576 | 23 | namespace core { | ||
4577 | 24 | namespace dbus { | ||
4578 | 25 | class Error; | ||
4579 | 26 | } | ||
4580 | 27 | } | ||
4581 | 28 | |||
4582 | 29 | namespace connectivity { | ||
4583 | 30 | |||
4584 | 31 | void throw_dbus_exception(const core::dbus::Error &e); | ||
4585 | 32 | |||
4586 | 33 | } | ||
4587 | 34 | |||
4588 | 35 | |||
4589 | 36 | #endif | ||
4590 | 37 | 0 | ||
4591 | === removed directory 'src/connectivity-cpp/include/connectivity' | |||
4592 | === removed directory 'src/connectivity-cpp/include/connectivity/networking' | |||
4593 | === removed directory 'src/connectivity-cpp/include/connectivity/networking/service' | |||
4594 | === removed file 'src/connectivity-cpp/include/connectivity/networking/service.h' | |||
4595 | --- src/connectivity-cpp/include/connectivity/networking/service.h 2014-08-19 19:55:15 +0000 | |||
4596 | +++ src/connectivity-cpp/include/connectivity/networking/service.h 1970-01-01 00:00:00 +0000 | |||
4597 | @@ -1,83 +0,0 @@ | |||
4598 | 1 | /* | ||
4599 | 2 | * Copyright © 2013 Canonical Ltd. | ||
4600 | 3 | * | ||
4601 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4602 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4603 | 6 | * as published by the Free Software Foundation. | ||
4604 | 7 | * | ||
4605 | 8 | * This program is distributed in the hope that it will be useful, | ||
4606 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4607 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4608 | 11 | * GNU Lesser General Public License for more details. | ||
4609 | 12 | * | ||
4610 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4611 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4612 | 15 | * | ||
4613 | 16 | * Authors: | ||
4614 | 17 | * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
4615 | 18 | */ | ||
4616 | 19 | |||
4617 | 20 | #ifndef CONNECTIVITY_NETWORKING_SERVICE | ||
4618 | 21 | #define CONNECTIVITY_NETWORKING_SERVICE | ||
4619 | 22 | |||
4620 | 23 | #include <connectivity/networking/link.h> | ||
4621 | 24 | |||
4622 | 25 | #include <memory> | ||
4623 | 26 | |||
4624 | 27 | namespace connectivity { | ||
4625 | 28 | namespace networking { | ||
4626 | 29 | |||
4627 | 30 | #ifndef CONNECTIVITY_CPP_EXPORT | ||
4628 | 31 | #define CONNECTIVITY_CPP_EXPORT __attribute ((visibility ("default"))) | ||
4629 | 32 | #endif | ||
4630 | 33 | |||
4631 | 34 | /// @private | ||
4632 | 35 | class CONNECTIVITY_CPP_EXPORT | ||
4633 | 36 | Service | ||
4634 | 37 | { | ||
4635 | 38 | public: | ||
4636 | 39 | |||
4637 | 40 | typedef std::shared_ptr<Service> Ptr; | ||
4638 | 41 | |||
4639 | 42 | enum class Type { | ||
4640 | 43 | vpn, | ||
4641 | 44 | tethering, | ||
4642 | 45 | tor | ||
4643 | 46 | }; | ||
4644 | 47 | virtual Type type() const = 0; | ||
4645 | 48 | |||
4646 | 49 | enum class Status { | ||
4647 | 50 | stopped, | ||
4648 | 51 | starting, | ||
4649 | 52 | running | ||
4650 | 53 | }; | ||
4651 | 54 | |||
4652 | 55 | virtual ~Service() = default; | ||
4653 | 56 | |||
4654 | 57 | virtual const core::Property<Status>& status() const = 0; | ||
4655 | 58 | |||
4656 | 59 | // which other Service this service requires to be active | ||
4657 | 60 | // before it can be activated | ||
4658 | 61 | virtual std::shared_ptr<Service> requires() = 0; | ||
4659 | 62 | |||
4660 | 63 | // possible link this service provides. | ||
4661 | 64 | // check with: | ||
4662 | 65 | // if (service->link()) { | ||
4663 | 66 | // // we have a link coming from the service | ||
4664 | 67 | // do_something_with(link); | ||
4665 | 68 | // } | ||
4666 | 69 | virtual Link::Ptr link() = 0; | ||
4667 | 70 | |||
4668 | 71 | virtual void start() = 0; | ||
4669 | 72 | virtual void stop() = 0; | ||
4670 | 73 | |||
4671 | 74 | typedef unsigned int Id; | ||
4672 | 75 | virtual Id id() const = 0; | ||
4673 | 76 | |||
4674 | 77 | virtual core::Property<std::string>& name() const = 0; | ||
4675 | 78 | }; | ||
4676 | 79 | |||
4677 | 80 | } | ||
4678 | 81 | } | ||
4679 | 82 | |||
4680 | 83 | #endif | ||
4681 | 84 | 0 | ||
4682 | === removed directory 'src/connectivity-cpp/include/connectivity/networking/service/tethering' | |||
4683 | === removed file 'src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h' | |||
4684 | --- src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h 2014-08-19 19:55:15 +0000 | |||
4685 | +++ src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h 1970-01-01 00:00:00 +0000 | |||
4686 | @@ -1,59 +0,0 @@ | |||
4687 | 1 | /* | ||
4688 | 2 | * Copyright © 2013 Canonical Ltd. | ||
4689 | 3 | * | ||
4690 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4691 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4692 | 6 | * as published by the Free Software Foundation. | ||
4693 | 7 | * | ||
4694 | 8 | * This program is distributed in the hope that it will be useful, | ||
4695 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4696 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4697 | 11 | * GNU Lesser General Public License for more details. | ||
4698 | 12 | * | ||
4699 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4700 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4701 | 15 | * | ||
4702 | 16 | * Authors: | ||
4703 | 17 | * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
4704 | 18 | */ | ||
4705 | 19 | |||
4706 | 20 | #ifndef CONNECTIVITY_NETWORKING_SERVICE_TETHERING_SERVICE | ||
4707 | 21 | #define CONNECTIVITY_NETWORKING_SERVICE_TETHERING_SERVICE | ||
4708 | 22 | |||
4709 | 23 | #include <com/ubuntu/connectivity/networking/service.h> | ||
4710 | 24 | |||
4711 | 25 | namespace connectivity { | ||
4712 | 26 | namespace networking { | ||
4713 | 27 | namespace service { | ||
4714 | 28 | |||
4715 | 29 | namespace tethering { | ||
4716 | 30 | |||
4717 | 31 | /// @private | ||
4718 | 32 | class | ||
4719 | 33 | Service : public connectivity::networking::Service | ||
4720 | 34 | { | ||
4721 | 35 | public: | ||
4722 | 36 | typedef std::shared_ptr<Service> Ptr; | ||
4723 | 37 | virtual ~Service() = default; | ||
4724 | 38 | |||
4725 | 39 | /* | ||
4726 | 40 | * Which link is shared to the client devices. | ||
4727 | 41 | */ | ||
4728 | 42 | const core::Property<std::shared_ptr<Link>> &shared() = 0; | ||
4729 | 43 | |||
4730 | 44 | /* | ||
4731 | 45 | * Which link is used to serve the clients. | ||
4732 | 46 | */ | ||
4733 | 47 | const core::Property<std::shared_ptr<Link>> &sharedOver() = 0; | ||
4734 | 48 | |||
4735 | 49 | |||
4736 | 50 | protected: | ||
4737 | 51 | Service() = default; | ||
4738 | 52 | }; | ||
4739 | 53 | |||
4740 | 54 | } | ||
4741 | 55 | } | ||
4742 | 56 | } | ||
4743 | 57 | } | ||
4744 | 58 | |||
4745 | 59 | #endif | ||
4746 | 60 | 0 | ||
4747 | === removed directory 'src/connectivity-cpp/include/connectivity/networking/service/tor' | |||
4748 | === removed file 'src/connectivity-cpp/include/connectivity/networking/service/tor/service.h' | |||
4749 | --- src/connectivity-cpp/include/connectivity/networking/service/tor/service.h 2014-08-19 19:55:15 +0000 | |||
4750 | +++ src/connectivity-cpp/include/connectivity/networking/service/tor/service.h 1970-01-01 00:00:00 +0000 | |||
4751 | @@ -1,46 +0,0 @@ | |||
4752 | 1 | /* | ||
4753 | 2 | * Copyright © 2013 Canonical Ltd. | ||
4754 | 3 | * | ||
4755 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4756 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4757 | 6 | * as published by the Free Software Foundation. | ||
4758 | 7 | * | ||
4759 | 8 | * This program is distributed in the hope that it will be useful, | ||
4760 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4761 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4762 | 11 | * GNU Lesser General Public License for more details. | ||
4763 | 12 | * | ||
4764 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4765 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4766 | 15 | * | ||
4767 | 16 | * Authors: | ||
4768 | 17 | * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
4769 | 18 | */ | ||
4770 | 19 | |||
4771 | 20 | #ifndef CONNECTIVITY_NETWORKING_SERVICE_TOR_SERVICE | ||
4772 | 21 | #define CONNECTIVITY_NETWORKING_SERVICE_TOR_SERVICE | ||
4773 | 22 | |||
4774 | 23 | #include <connectivity/networking/service.h> | ||
4775 | 24 | |||
4776 | 25 | namespace connectivity { | ||
4777 | 26 | namespace networking { | ||
4778 | 27 | namespace service { | ||
4779 | 28 | namespace tor { | ||
4780 | 29 | |||
4781 | 30 | /// @private | ||
4782 | 31 | class | ||
4783 | 32 | Service : public connectivity::networking::Service | ||
4784 | 33 | { | ||
4785 | 34 | public: | ||
4786 | 35 | typedef std::shared_ptr<Service> Ptr; | ||
4787 | 36 | virtual ~Service() = default; | ||
4788 | 37 | |||
4789 | 38 | virtual const core::Property<std::shared_ptr<Link>> &establishedOver() const = 0; | ||
4790 | 39 | }; | ||
4791 | 40 | |||
4792 | 41 | } | ||
4793 | 42 | } | ||
4794 | 43 | } | ||
4795 | 44 | } | ||
4796 | 45 | |||
4797 | 46 | #endif | ||
4798 | 47 | 0 | ||
4799 | === removed directory 'src/connectivity-cpp/include/connectivity/networking/service/vpn' | |||
4800 | === removed file 'src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h' | |||
4801 | --- src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h 2014-08-19 19:55:15 +0000 | |||
4802 | +++ src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h 1970-01-01 00:00:00 +0000 | |||
4803 | @@ -1,49 +0,0 @@ | |||
4804 | 1 | /* | ||
4805 | 2 | * Copyright © 2013 Canonical Ltd. | ||
4806 | 3 | * | ||
4807 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4808 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4809 | 6 | * as published by the Free Software Foundation. | ||
4810 | 7 | * | ||
4811 | 8 | * This program is distributed in the hope that it will be useful, | ||
4812 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4813 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4814 | 11 | * GNU Lesser General Public License for more details. | ||
4815 | 12 | * | ||
4816 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4817 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4818 | 15 | * | ||
4819 | 16 | * Authors: | ||
4820 | 17 | * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
4821 | 18 | */ | ||
4822 | 19 | |||
4823 | 20 | #ifndef CONNECTIVITY_NETWORKING_SERVICE_VPN_SERVICE | ||
4824 | 21 | #define CONNECTIVITY_NETWORKING_SERVICE_VPN_SERVICE | ||
4825 | 22 | |||
4826 | 23 | #include <connectivity/networking/service.h> | ||
4827 | 24 | |||
4828 | 25 | namespace connectivity { | ||
4829 | 26 | namespace networking { | ||
4830 | 27 | namespace service { | ||
4831 | 28 | namespace vpn { | ||
4832 | 29 | |||
4833 | 30 | /// @private | ||
4834 | 31 | class | ||
4835 | 32 | Service : public connectivity::networking::Service | ||
4836 | 33 | { | ||
4837 | 34 | public: | ||
4838 | 35 | typedef std::shared_ptr<Service> Ptr; | ||
4839 | 36 | virtual ~Service() = default; | ||
4840 | 37 | |||
4841 | 38 | virtual const core::Property<std::shared_ptr<Link>> &establishedOver() const = 0; | ||
4842 | 39 | |||
4843 | 40 | protected: | ||
4844 | 41 | Service() = default; | ||
4845 | 42 | }; | ||
4846 | 43 | |||
4847 | 44 | } | ||
4848 | 45 | } | ||
4849 | 46 | } | ||
4850 | 47 | } | ||
4851 | 48 | |||
4852 | 49 | #endif | ||
4853 | 50 | 0 | ||
4854 | === removed directory 'src/connectivity-cpp/include/connectivity/networking/wifi' | |||
4855 | === modified file 'src/connectivity-cpp/src/CMakeLists.txt' | |||
4856 | --- src/connectivity-cpp/src/CMakeLists.txt 2014-08-19 19:55:15 +0000 | |||
4857 | +++ src/connectivity-cpp/src/CMakeLists.txt 2015-04-01 15:30:55 +0000 | |||
4858 | @@ -16,15 +16,34 @@ | |||
4859 | 16 | # Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | 16 | # Antti Kaijanmäki <antti.kaijanmaki@canonical.com> |
4860 | 17 | 17 | ||
4861 | 18 | add_library(connectivity-cpp STATIC | 18 | add_library(connectivity-cpp STATIC |
4862 | 19 | platform/nmofono/kill-switch.cpp | ||
4863 | 20 | platform/nmofono/manager.cpp | ||
4864 | 21 | platform/nmofono/manager.h | ||
4865 | 22 | platform/nmofono/service.cpp | ||
4866 | 23 | platform/nmofono/service.h | ||
4867 | 24 | platform/nmofono/wifi/access-point-impl.h | ||
4868 | 25 | platform/nmofono/wifi/access-point-impl.cpp | ||
4869 | 26 | platform/nmofono/wifi/grouped-access-point.h | ||
4870 | 27 | platform/nmofono/wifi/grouped-access-point.cpp | ||
4871 | 28 | platform/nmofono/wifi/link.h | ||
4872 | 29 | platform/nmofono/wifi/link.cpp | ||
4873 | 30 | |||
4874 | 31 | #platform/nmofono/ofono_nm_connectivity_manager.cpp | ||
4875 | 32 | platform/nmofono/set_name_for_thread.cpp | ||
4876 | 33 | platform/nmofono/set_name_for_thread.h | ||
4877 | 34 | |||
4878 | 35 | ../include/connectivity/networking/wifi/access-point.cpp | ||
4879 | 19 | manager.cpp | 36 | manager.cpp |
4880 | 20 | ) | 37 | ) |
4881 | 38 | |||
4882 | 21 | set_target_properties(connectivity-cpp PROPERTIES | 39 | set_target_properties(connectivity-cpp PROPERTIES |
4883 | 22 | VERSION ${CONNECTIVITY_CPP_VERSION_MAJOR}.${CONNECTIVITY_CPP_VERSION_MINOR}.${CONNECTIVITY_CPP_VERSION_PATCH} | 40 | VERSION ${CONNECTIVITY_CPP_VERSION_MAJOR}.${CONNECTIVITY_CPP_VERSION_MINOR}.${CONNECTIVITY_CPP_VERSION_PATCH} |
4884 | 23 | SOVERSION ${CONNECTIVITY_CPP_VERSION_MAJOR} | 41 | SOVERSION ${CONNECTIVITY_CPP_VERSION_MAJOR} |
4885 | 24 | OUTPUT_NAME "connectivity-cpp" | 42 | OUTPUT_NAME "connectivity-cpp" |
4886 | 25 | ) | 43 | ) |
4892 | 26 | target_link_libraries(connectivity-cpp platform_nmofono) | 44 | |
4893 | 27 | 45 | target_link_libraries(connectivity-cpp | |
4894 | 28 | add_subdirectory(platform/nmofono) | 46 | connectivity-backend |
4895 | 29 | 47 | ${DBUSCPP_LIBRARIES} | |
4896 | 30 | 48 | ${GLIB_LIBRARIES} | |
4897 | 49 | ) | ||
4898 | 31 | 50 | ||
4899 | === added directory 'src/connectivity-cpp/src/platform' | |||
4900 | === removed directory 'src/connectivity-cpp/src/platform' | |||
4901 | === added directory 'src/connectivity-cpp/src/platform/nmofono' | |||
4902 | === removed file 'src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt' | |||
4903 | --- src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt 2014-08-22 14:56:59 +0000 | |||
4904 | +++ src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
4905 | @@ -1,42 +0,0 @@ | |||
4906 | 1 | # Copyright © 2013 Canonical Ltd. | ||
4907 | 2 | # | ||
4908 | 3 | # This program is free software: you can redistribute it and/or modify it | ||
4909 | 4 | # under the terms of the GNU Lesser General Public License version 3, | ||
4910 | 5 | # as published by the Free Software Foundation. | ||
4911 | 6 | # | ||
4912 | 7 | # This program is distributed in the hope that it will be useful, | ||
4913 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4914 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4915 | 10 | # GNU Lesser General Public License for more details. | ||
4916 | 11 | # | ||
4917 | 12 | # You should have received a copy of the GNU Lesser General Public License | ||
4918 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4919 | 14 | # | ||
4920 | 15 | # Authors: | ||
4921 | 16 | # Antti Kaijanmäki <antti.kaijanmaki@canonical.com> | ||
4922 | 17 | |||
4923 | 18 | set(NMOFONO_PLATFORM_SOURCES | ||
4924 | 19 | kill-switch.cpp | ||
4925 | 20 | manager.cpp | ||
4926 | 21 | manager.h | ||
4927 | 22 | service.cpp | ||
4928 | 23 | service.h | ||
4929 | 24 | wifi/access-point.h | ||
4930 | 25 | wifi/access-point.cpp | ||
4931 | 26 | wifi/grouped-access-point.h | ||
4932 | 27 | wifi/grouped-access-point.cpp | ||
4933 | 28 | wifi/link.h | ||
4934 | 29 | wifi/link.cpp | ||
4935 | 30 | ../util.cpp | ||
4936 | 31 | |||
4937 | 32 | #ofono_nm_connectivity_manager.cpp | ||
4938 | 33 | set_name_for_thread.cpp | ||
4939 | 34 | set_name_for_thread.h | ||
4940 | 35 | ) | ||
4941 | 36 | |||
4942 | 37 | add_library(platform_nmofono STATIC ${NMOFONO_PLATFORM_SOURCES}) | ||
4943 | 38 | target_link_libraries( | ||
4944 | 39 | platform_nmofono | ||
4945 | 40 | ${DBUSCPP_LIBRARIES} | ||
4946 | 41 | ${GLIB_LIBRARIES} | ||
4947 | 42 | ) | ||
4948 | 43 | 0 | ||
4949 | === removed file 'src/connectivity-cpp/src/platform/nmofono/bounded_integer.h' | |||
4950 | --- src/connectivity-cpp/src/platform/nmofono/bounded_integer.h 2014-08-19 19:55:15 +0000 | |||
4951 | +++ src/connectivity-cpp/src/platform/nmofono/bounded_integer.h 1970-01-01 00:00:00 +0000 | |||
4952 | @@ -1,178 +0,0 @@ | |||
4953 | 1 | /* | ||
4954 | 2 | * Copyright © 2012-2013 Canonical Ltd. | ||
4955 | 3 | * | ||
4956 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4957 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4958 | 6 | * as published by the Free Software Foundation. | ||
4959 | 7 | * | ||
4960 | 8 | * This program is distributed in the hope that it will be useful, | ||
4961 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4962 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4963 | 11 | * GNU Lesser General Public License for more details. | ||
4964 | 12 | * | ||
4965 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4966 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4967 | 15 | * | ||
4968 | 16 | * Authored by: Thomas Voß <thomas.voss@canonical.com> | ||
4969 | 17 | */ | ||
4970 | 18 | #ifndef LOCATION_SERVICE_LOCATION_CONNECTIVITY_BOUNDED_INTEGER_H_ | ||
4971 | 19 | #define LOCATION_SERVICE_LOCATION_CONNECTIVITY_BOUNDED_INTEGER_H_ | ||
4972 | 20 | |||
4973 | 21 | #include <iostream> | ||
4974 | 22 | #include <stdexcept> | ||
4975 | 23 | |||
4976 | 24 | namespace location | ||
4977 | 25 | { | ||
4978 | 26 | namespace connectivity | ||
4979 | 27 | { | ||
4980 | 28 | /** | ||
4981 | 29 | * @brief A helper class to handle bounded integer values, with an optional domain | ||
4982 | 30 | * for tagging domain-specific types. | ||
4983 | 31 | */ | ||
4984 | 32 | template<int min, int max, int domain = 0> | ||
4985 | 33 | class BoundedInteger | ||
4986 | 34 | { | ||
4987 | 35 | public: | ||
4988 | 36 | static_assert(min < max, "min >= max"); | ||
4989 | 37 | |||
4990 | 38 | /** | ||
4991 | 39 | * @brief Access the minimum value of the integer. | ||
4992 | 40 | */ | ||
4993 | 41 | inline static int minimum() | ||
4994 | 42 | { | ||
4995 | 43 | return min; | ||
4996 | 44 | } | ||
4997 | 45 | |||
4998 | 46 | /** | ||
4999 | 47 | * @brief Access the maximum value of the integer. | ||
5000 | 48 | */ |
The diff has been truncated for viewing.