Merge lp:~unity-api-team/indicator-network/port-to-qdbus-14.09 into lp:indicator-network/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
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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-02-16 18:34:37 +0000
+++ CMakeLists.txt 2015-04-01 15:30:55 +0000
@@ -18,6 +18,10 @@
18 add_definitions(-DINDICATOR_NETWORK_TRACE_MESSAGES)18 add_definitions(-DINDICATOR_NETWORK_TRACE_MESSAGES)
19endif()19endif()
2020
21add_definitions(
22 -DQT_NO_KEYWORDS=1
23)
24
21find_package(PkgConfig REQUIRED)25find_package(PkgConfig REQUIRED)
22include(EnableCoverageReport)26include(EnableCoverageReport)
23include(GNUInstallDirs)27include(GNUInstallDirs)
@@ -44,14 +48,6 @@
44)48)
45include_directories(${GLIB_INCLUDE_DIRS})49include_directories(${GLIB_INCLUDE_DIRS})
4650
47set(NM_REQUIRED_VERSION 0.9)
48pkg_check_modules(
49 NM REQUIRED
50 libnm-glib>=${NM_REQUIRED_VERSION}
51 libnm-util>=${NM_REQUIRED_VERSION}
52)
53include_directories(${NM_INCLUDE_DIRS})
54
55set(OFONO_REQUIRED_VERSION 1.12)51set(OFONO_REQUIRED_VERSION 1.12)
56pkg_check_modules(52pkg_check_modules(
57 OFONO REQUIRED53 OFONO REQUIRED
@@ -85,16 +81,12 @@
85pkg_check_modules(QTDBUSMOCK REQUIRED libqtdbusmock-1 REQUIRED)81pkg_check_modules(QTDBUSMOCK REQUIRED libqtdbusmock-1 REQUIRED)
86include_directories(${QTDBUSMOCK_INCLUDE_DIRS})82include_directories(${QTDBUSMOCK_INCLUDE_DIRS})
8783
88pkg_check_modules(QMENUMODEL REQUIRED qmenumodel REQUIRED)
89include_directories(${QMENUMODEL_INCLUDE_DIRS})
90
91pkg_check_modules(GIO REQUIRED gio-2.0>=${GLIB_REQUIRED_VERSION})84pkg_check_modules(GIO REQUIRED gio-2.0>=${GLIB_REQUIRED_VERSION})
92include_directories(${GIO_INCLUDE_DIRS})85include_directories(${GIO_INCLUDE_DIRS})
9386
87set(CMAKE_AUTOMOC ON)
94set(CMAKE_INCLUDE_CURRENT_DIR ON)88set(CMAKE_INCLUDE_CURRENT_DIR ON)
9589
96find_package(GObjectIntrospection 0.9.12)
97
98include_directories(${CMAKE_BINARY_DIR})90include_directories(${CMAKE_BINARY_DIR})
9991
100set(COMMON_FLAGS "-Wall -Wextra -Wpedantic -fno-permissive -fPIC -fvisibility=hidden -pthread")92set(COMMON_FLAGS "-Wall -Wextra -Wpedantic -fno-permissive -fPIC -fvisibility=hidden -pthread")
@@ -102,7 +94,7 @@
102# "nice bug" in cmake... http://www.cmake.org/Bug/view.php?id=1505894# "nice bug" in cmake... http://www.cmake.org/Bug/view.php?id=15058
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/
104#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${COMMON_FLAGS}")96#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${COMMON_FLAGS}")
105set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${COMMON_FLAGS} -fno-strict-aliasing -fvisibility-inlines-hidden")97set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 ${COMMON_FLAGS} -fno-strict-aliasing -fvisibility-inlines-hidden")
10698
107configure_file(99configure_file(
108 "config.h.in"100 "config.h.in"
@@ -136,5 +128,6 @@
136 ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure128 ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
137)129)
138130
139enable_coverage_report(TARGETS menumodel_cpp connectivity-cpp indicator-secret-agent131#///! TODO: The following needs to be updated once this project takes form again and new unit tests are written
132enable_coverage_report(TARGETS menumodel_cpp indicator-secret-agent
140 FILTER ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)133 FILTER ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)
141134
=== removed file 'cmake/FindGObjectIntrospection.cmake'
--- cmake/FindGObjectIntrospection.cmake 2013-08-27 13:48:41 +0000
+++ cmake/FindGObjectIntrospection.cmake 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1# - try to find gobject-introspection
2#
3# Once done this will define
4#
5# INTROSPECTION_FOUND - system has gobject-introspection
6# INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner
7# INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler
8# INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate
9# INTROSPECTION_GIRDIR
10# INTROSPECTION_TYPELIBDIR
11# INTROSPECTION_CFLAGS
12# INTROSPECTION_LIBS
13#
14# Copyright (C) 2010, Pino Toscano, <pino@kde.org>
15#
16# Redistribution and use is allowed according to the terms of the BSD license.
17# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
18
19macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname)
20 execute_process(
21 COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0
22 OUTPUT_VARIABLE _result
23 RESULT_VARIABLE _null
24 )
25
26 if (_null)
27 else()
28 string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
29 string(REGEX REPLACE " +$" "" _result "${_result}")
30 separate_arguments(_result)
31 set(${_outvar} ${_result} CACHE INTERNAL "")
32 endif()
33endmacro(_GIR_GET_PKGCONFIG_VAR)
34
35find_package(PkgConfig)
36if(PKG_CONFIG_FOUND)
37 if(PACKAGE_FIND_VERSION_COUNT GREATER 0)
38 set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}")
39 endif()
40 pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp})
41 if(_pc_gir_FOUND)
42 set(INTROSPECTION_FOUND TRUE)
43 _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner")
44 _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler")
45 _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate")
46 _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir")
47 _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir")
48 set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}")
49 set(INTROSPECTION_LIBS "${_pc_gir_LIBS}")
50 endif()
51endif()
52
53mark_as_advanced(
54 INTROSPECTION_SCANNER
55 INTROSPECTION_COMPILER
56 INTROSPECTION_GENERATE
57 INTROSPECTION_GIRDIR
58 INTROSPECTION_TYPELIBDIR
59 INTROSPECTION_CFLAGS
60 INTROSPECTION_LIBS
61)
620
=== modified file 'cmake/FindValgrind.cmake'
--- cmake/FindValgrind.cmake 2013-09-17 13:43:54 +0000
+++ cmake/FindValgrind.cmake 2015-04-01 15:30:55 +0000
@@ -14,10 +14,7 @@
14 set(VALGRIND_PROGRAM_OPTIONS14 set(VALGRIND_PROGRAM_OPTIONS
15 "--suppressions=${CMAKE_SOURCE_DIR}/tests/data/valgrind.suppression"15 "--suppressions=${CMAKE_SOURCE_DIR}/tests/data/valgrind.suppression"
16 "--error-exitcode=1"16 "--error-exitcode=1"
17 "--trace-children=yes"
18 "--trace-children-skip=*/python*,python*"
19 "--leak-check=full"17 "--leak-check=full"
20 "--leak-resolution=high"
21 "--gen-suppressions=all"18 "--gen-suppressions=all"
22 "--quiet"19 "--quiet"
23 )20 )
@@ -28,14 +25,17 @@
28 VALGRIND_PROGRAM25 VALGRIND_PROGRAM
29)26)
3027
31function(add_valgrind_test NAME EXECUTABLE)28function(add_valgrind_test)
32 if(ENABLE_MEMCHECK_OPTION)29 foreach(_arg ${ARGN})
33 add_test(${NAME} ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS} "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}")30 if ("VALGRIND" STREQUAL ${_arg})
34 set_tests_properties(31 if(ENABLE_MEMCHECK_OPTION AND VALGRIND_PROGRAM)
35 ${NAME}32 list(APPEND _vgargs ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS})
36 PROPERTIES ENVIRONMENT "G_SLICE=always-malloc G_DEBUG=gc-friendly"33 endif()
37 )34 else()
38 else()35 list(APPEND _vgargs ${_arg})
39 add_test(${NAME} ${EXECUTABLE})36 endif()
40 endif()37 endforeach()
38
39 add_test(${_vgargs})
41endfunction()40endfunction()
41
4242
=== removed file 'cmake/UseGObjectIntrospection.cmake'
--- cmake/UseGObjectIntrospection.cmake 2013-08-27 13:48:41 +0000
+++ cmake/UseGObjectIntrospection.cmake 1970-01-01 00:00:00 +0000
@@ -1,100 +0,0 @@
1# Copyright (C) 2010, Pino Toscano, <pino@kde.org>
2#
3# Redistribution and use is allowed according to the terms of the BSD license.
4# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
5
6include(ListOperations)
7
8macro(_gir_list_prefix _outvar _listvar _prefix)
9 set(${_outvar})
10 foreach(_item IN LISTS ${_listvar})
11 list(APPEND ${_outvar} ${_prefix}${_item})
12 endforeach()
13endmacro(_gir_list_prefix)
14
15macro(gir_add_introspections introspections_girs)
16
17 foreach(gir IN LISTS ${introspections_girs})
18
19 set(_gir_name "${gir}")
20
21 ## Transform the gir filename to something which can reference through a variable
22 ## without automake/make complaining, eg Gtk-2.0.gir -> Gtk_2_0_gir
23 string(REPLACE "-" "_" _gir_name "${_gir_name}")
24 string(REPLACE "." "_" _gir_name "${_gir_name}")
25
26 # Namespace and Version is either fetched from the gir filename
27 # or the _NAMESPACE/_VERSION variable combo
28 set(_gir_namespace "${${_gir_name}_NAMESPACE}")
29 if (_gir_namespace STREQUAL "")
30 string(REGEX REPLACE "([^-]+)-.*" "\\1" _gir_namespace "${gir}")
31 endif ()
32 set(_gir_version "${${_gir_name}_VERSION}")
33 if (_gir_version STREQUAL "")
34 string(REGEX REPLACE ".*-([^-]+).gir" "\\1" _gir_version "${gir}")
35 endif ()
36
37 # _PROGRAM is an optional variable which needs it's own --program argument
38 set(_gir_program "${${_gir_name}_PROGRAM}")
39 if (NOT _gir_program STREQUAL "")
40 set(_gir_program "--program=${_gir_program}")
41 endif ()
42
43 # Variables which provides a list of things
44 _gir_list_prefix(_gir_libraries ${_gir_name}_LIBS "--library=")
45 _gir_list_prefix(_gir_packages ${_gir_name}_PACKAGES "--pkg=")
46 _gir_list_prefix(_gir_includes ${_gir_name}_INCLUDES "--include=")
47 _gir_list_prefix(_gir_export_packages ${_gir_name}_EXPORT_PACKAGES "--pkg-export=")
48
49 # Reuse the LIBTOOL variable from by automake if it's set
50 set(_gir_libtool "--no-libtool")
51
52 add_custom_command(
53 COMMAND ${INTROSPECTION_SCANNER}
54 ${INTROSPECTION_SCANNER_ARGS}
55 --namespace=${_gir_namespace}
56 --nsversion=${_gir_version}
57 ${_gir_libtool}
58 ${_gir_program}
59 ${_gir_libraries}
60 ${_gir_packages}
61 ${_gir_includes}
62 ${_gir_export_packages}
63 ${${_gir_name}_SCANNERFLAGS}
64 ${${_gir_name}_CFLAGS}
65 ${${_gir_name}_FILES}
66 --output ${CMAKE_CURRENT_BINARY_DIR}/${gir}
67 DEPENDS ${${_gir_name}_FILES}
68 ${${_gir_name}_LIBS}
69 OUTPUT ${gir}
70 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
71 VERBATIM
72 )
73 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${gir} DESTINATION share/gir-1.0)
74
75 string(REPLACE ".gir" ".typelib" _typelib "${gir}")
76 add_custom_command(
77 COMMAND ${INTROSPECTION_COMPILER}
78 ${INTROSPECTION_COMPILER_ARGS}
79 --includedir=.
80 ${CMAKE_CURRENT_BINARY_DIR}/${gir}
81 -o ${CMAKE_CURRENT_BINARY_DIR}/${_typelib}
82 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir}
83 OUTPUT ${_typelib}
84 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
85 )
86 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/girepository-1.0)
87
88 add_custom_target(gir-${gir} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir})
89 add_custom_target(gir-typelibs-${_typelib} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_typelib})
90 endforeach()
91
92endmacro(gir_add_introspections)
93
94macro(gir_get_cflags _output)
95 get_directory_property(_tmp_includes INCLUDE_DIRECTORIES)
96 list_prefix(_includes _tmp_includes "-I")
97 get_directory_property(_tmp_compile_definitions COMPILE_DEFINITIONS)
98 list_prefix(_compile_definitions _tmp_compile_definitions "-D")
99 set(${_output} ${_includes} ${_compile_definitions})
100endmacro(gir_get_cflags)
1010
=== added file 'data/com.ubuntu.connectivity1.NetworkingStatus.xml'
--- data/com.ubuntu.connectivity1.NetworkingStatus.xml 1970-01-01 00:00:00 +0000
+++ data/com.ubuntu.connectivity1.NetworkingStatus.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/com/ubuntu/connectivity1/NetworkingStatus" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="com.ubuntu.connectivity1.NetworkingStatus">
5
6 <property name="Limitations" type="as" access="read"/>
7 <property name="Status" type="s" access="read"/>
8
9 </interface>
10</node>
11
012
=== added file 'data/com.ubuntu.connectivity1.Private.xml'
--- data/com.ubuntu.connectivity1.Private.xml 1970-01-01 00:00:00 +0000
+++ data/com.ubuntu.connectivity1.Private.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/com/ubuntu/connectivity1/Private" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="com.ubuntu.connectivity1.Private">
5
6 <method name="UnlockAllModems">
7 </method>
8
9 <method name="UnlockModem">
10 <arg type="s" direction="in" name="modem"/>
11 </method>
12
13 </interface>
14</node>
15
016
=== added file 'data/nm-access-point.xml'
--- data/nm-access-point.xml 1970-01-01 00:00:00 +0000
+++ data/nm-access-point.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,93 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="org.freedesktop.NetworkManager.AccessPoint">
5 <property name="Flags" type="u" access="read" tp:type="NM_802_11_AP_FLAGS">
6 <tp:docstring>Flags describing the capabilities of the access point.</tp:docstring>
7 </property>
8 <property name="WpaFlags" type="u" access="read" tp:type="NM_802_11_AP_SEC">
9 <tp:docstring>Flags describing the access point's capabilities according to WPA (Wifi Protected Access).</tp:docstring>
10 </property>
11 <property name="RsnFlags" type="u" access="read" tp:type="NM_802_11_AP_SEC">
12 <tp:docstring>Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol.</tp:docstring>
13 </property>
14 <property name="Ssid" type="ay" access="read">
15 <tp:docstring>The Service Set Identifier identifying the access point.</tp:docstring>
16 </property>
17 <property name="Frequency" type="u" access="read">
18 <tp:docstring>The radio channel frequency in use by the access point, in MHz.</tp:docstring>
19 </property>
20 <property name="HwAddress" type="s" access="read">
21 <tp:docstring>The hardware address (BSSID) of the access point.</tp:docstring>
22 </property>
23
24 <property name="Mode" type="u" access="read" tp:type="NM_802_11_MODE">
25 <tp:docstring>Describes the operating mode of the access point.</tp:docstring>
26 </property>
27 <property name="MaxBitrate" type="u" access="read">
28 <tp:docstring>The maximum bitrate this access point is capable of, in kilobits/second (Kb/s).</tp:docstring>
29 </property>
30 <property name="Strength" type="y" access="read">
31 <tp:docstring>The current signal quality of the access point, in percent.</tp:docstring>
32 </property>
33
34 <signal name="PropertiesChanged">
35 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
36 <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
37 <tp:docstring>
38 A dictionary mapping property names to variant boxed values
39 </tp:docstring>
40 </arg>
41 </signal>
42 <tp:flags name="NM_802_11_AP_FLAGS" value-prefix="NM_802_11_AP_FLAGS" type="u">
43 <tp:docstring>
44 Flags describing the general capabilities of the access point.
45 </tp:docstring>
46 <tp:flag suffix="NONE" value="0x0">
47 <tp:docstring>Null capability - says nothing about the access point.</tp:docstring>
48 </tp:flag>
49 <tp:flag suffix="PRIVACY" value="0x1">
50 <tp:docstring>Access point supports privacy measures.</tp:docstring>
51 </tp:flag>
52 </tp:flags>
53 <tp:flags name="NM_802_11_AP_SEC" value-prefix="NM_802_11_AP_SEC" type="u">
54 <tp:docstring>
55 Flags describing the security capabilities of the access point.
56 </tp:docstring>
57 <tp:flag suffix="NONE" value="0x0">
58 <tp:docstring>Null flag.</tp:docstring>
59 </tp:flag>
60 <tp:flag suffix="PAIR_WEP40" value="0x1">
61 <tp:docstring>Access point supports pairwise 40-bit WEP encryption.</tp:docstring>
62 </tp:flag>
63 <tp:flag suffix="PAIR_WEP104" value="0x2">
64 <tp:docstring>Access point supports pairwise 104-bit WEP encryption.</tp:docstring>
65 </tp:flag>
66 <tp:flag suffix="PAIR_TKIP" value="0x4">
67 <tp:docstring>Access point supports pairwise TKIP encryption.</tp:docstring>
68 </tp:flag>
69 <tp:flag suffix="PAIR_CCMP" value="0x8">
70 <tp:docstring>Access point supports pairwise CCMP encryption.</tp:docstring>
71 </tp:flag>
72 <tp:flag suffix="GROUP_WEP40" value="0x10">
73 <tp:docstring>Access point supports a group 40-bit WEP cipher.</tp:docstring>
74 </tp:flag>
75 <tp:flag suffix="GROUP_WEP104" value="0x20">
76 <tp:docstring>Access point supports a group 104-bit WEP cipher.</tp:docstring>
77 </tp:flag>
78 <tp:flag suffix="GROUP_TKIP" value="0x40">
79 <tp:docstring>Access point supports a group TKIP cipher.</tp:docstring>
80 </tp:flag>
81 <tp:flag suffix="GROUP_CCMP" value="0x80">
82 <tp:docstring>Access point supports a group CCMP cipher.</tp:docstring>
83 </tp:flag>
84 <tp:flag suffix="KEY_MGMT_PSK" value="0x100">
85 <tp:docstring>Access point supports PSK key management.</tp:docstring>
86 </tp:flag>
87 <tp:flag suffix="KEY_MGMT_802_1X" value="0x200">
88 <tp:docstring>Access point supports 802.1x key management.</tp:docstring>
89 </tp:flag>
90 </tp:flags>
91 </interface>
92</node>
93
094
=== added file 'data/nm-active-connection.xml'
--- data/nm-active-connection.xml 1970-01-01 00:00:00 +0000
+++ data/nm-active-connection.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,145 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="org.freedesktop.NetworkManager.Connection.Active">
5 <tp:docstring>
6 Objects that implement the Connection.Active interface represent an attempt
7 to connect to a network using the details provided by a Connection object.
8 The Connection.Active object tracks the life-cycle of the connection
9 attempt and if successful indicates whether the connected network is the
10 "default" or preferred network for access.
11 </tp:docstring>
12
13 <property name="Connection" type="o" access="read">
14 <tp:docstring>
15 The path of the connection.
16 </tp:docstring>
17 </property>
18 <property name="SpecificObject" type="o" access="read">
19 <tp:docstring>
20 A specific object associated with the active connection. This property
21 reflects the specific object used during connection activation, and will
22 not change over the lifetime of the ActiveConnection once set.
23 </tp:docstring>
24 </property>
25 <property name="Id" type="s" access="read">
26 <tp:docstring>
27 The ID of the connection, provided as a convenience so that clients
28 do not have to retrieve all connection details.
29 </tp:docstring>
30 </property>
31 <property name="Uuid" type="s" access="read">
32 <tp:docstring>
33 The UUID of the connection, provided as a convenience so that clients
34 do not have to retrieve all connection details.
35 </tp:docstring>
36 </property>
37 <property name="Type" type="s" access="read">
38 <tp:docstring>
39 The type of the connection, provided as a convenience so that clients
40 do not have to retrieve all connection details.
41 </tp:docstring>
42 </property>
43 <property name="Devices" type="ao" access="read">
44 <tp:docstring>
45 Array of object paths representing devices which are part of this active
46 connection.
47 </tp:docstring>
48 </property>
49 <property name="State" type="u" access="read" tp:type="NM_ACTIVE_CONNECTION_STATE">
50 <tp:docstring>
51 The state of this active connection.
52 </tp:docstring>
53 </property>
54 <!--property name="Default" type="b" access="read">
55 <tp:docstring>
56 Whether this active connection is the default IPv4 connection, i.e.
57 whether it currently owns the default IPv4 route.
58 </tp:docstring>
59 </property-->
60 <property name="Ip4Config" type="o" access="read">
61 <tp:docstring>
62 Object path of the Ip4Config object describing the configuration of the
63 connection. Only valid when the connection is in the
64 NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
65 </tp:docstring>
66 </property>
67 <property name="Dhcp4Config" type="o" access="read">
68 <tp:docstring>
69 Object path of the Dhcp4Config object describing the DHCP options
70 returned by the DHCP server (assuming the connection used DHCP). Only
71 valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED
72 state.
73 </tp:docstring>
74 </property>
75 <property name="Default6" type="b" access="read">
76 <tp:docstring>
77 Whether this active connection is the default IPv6 connection, i.e.
78 whether it currently owns the default IPv6 route.
79 </tp:docstring>
80 </property>
81 <property name="Ip6Config" type="o" access="read">
82 <tp:docstring>
83 Object path of the Ip6Config object describing the configuration of the
84 connection. Only valid when the connection is in the
85 NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
86 </tp:docstring>
87 </property>
88 <property name="Dhcp6Config" type="o" access="read">
89 <tp:docstring>
90 Object path of the Dhcp6Config object describing the DHCP options
91 returned by the DHCP server (assuming the connection used DHCP). Only
92 valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED
93 state.
94 </tp:docstring>
95 </property>
96 <property name="Vpn" type="b" access="read">
97 <tp:docstring>
98 Whether this active connection is also a VPN connection.
99 </tp:docstring>
100 </property>
101 <property name="Master" type="o" access="read">
102 <tp:docstring>
103 The path to the master device if the connection is a slave.
104 </tp:docstring>
105 </property>
106
107 <signal name="PropertiesChanged">
108 <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
109 <tp:docstring>
110 A dictionary mapping property names to variant boxed values
111 </tp:docstring>
112 </arg>
113 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
114 </signal>
115
116 <tp:enum name="NM_ACTIVE_CONNECTION_STATE" type="u">
117 <tp:enumvalue suffix="UNKNOWN" value="0">
118 <tp:docstring>
119 The active connection is in an unknown state.
120 </tp:docstring>
121 </tp:enumvalue>
122 <tp:enumvalue suffix="ACTIVATING" value="1">
123 <tp:docstring>
124 The connection is activating.
125 </tp:docstring>
126 </tp:enumvalue>
127 <tp:enumvalue suffix="ACTIVATED" value="2">
128 <tp:docstring>
129 The connection is activated.
130 </tp:docstring>
131 </tp:enumvalue>
132 <tp:enumvalue suffix="DEACTIVATING" value="3">
133 <tp:docstring>
134 The connection is being torn down and cleaned up.
135 </tp:docstring>
136 </tp:enumvalue>
137 <tp:enumvalue suffix="DEACTIVATED" value="4">
138 <tp:docstring>
139 The connection is no longer active.
140 </tp:docstring>
141 </tp:enumvalue>
142 </tp:enum>
143 </interface>
144</node>
145
0146
=== added file 'data/nm-device-wifi.xml'
--- data/nm-device-wifi.xml 1970-01-01 00:00:00 +0000
+++ data/nm-device-wifi.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,132 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="org.freedesktop.NetworkManager.Device.Wireless">
5 <method name="GetAccessPoints">
6 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_access_points"/>
7 <arg name="access_points" type="ao" direction="out">
8 <tp:docstring>
9 List of access point object paths
10 </tp:docstring>
11 </arg>
12 <tp:docstring>
13 Get the list of access points visible to this device.
14 </tp:docstring>
15 </method>
16
17 <method name="RequestScan">
18 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_request_scan"/>
19 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
20 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
21 <arg name="options" type="a{sv}" direction="in">
22 <tp:docstring>
23 Options of scan
24 </tp:docstring>
25 </arg>
26 <tp:docstring>
27 Request the device to scan
28 </tp:docstring>
29 </method>
30
31 <property name="HwAddress" type="s" access="read">
32 <tp:docstring>
33 The active hardware address of the device.
34 </tp:docstring>
35 </property>
36
37 <property name="PermHwAddress" type="s" access="read">
38 <tp:docstring>
39 The permanent hardware address of the device.
40 </tp:docstring>
41 </property>
42
43 <property name="Mode" type="u" access="read" tp:type="NM_802_11_MODE">
44 <tp:docstring>
45 The operating mode of the wireless device.
46 </tp:docstring>
47 </property>
48
49 <property name="Bitrate" type="u" access="read">
50 <tp:docstring>
51 The bit rate currently used by the wireless device, in kilobits/second (Kb/s).
52 </tp:docstring>
53 </property>
54 <property name="ActiveAccessPoint" type="o" access="read">
55 <tp:docstring>
56 Object path of the access point currently used by the wireless device.
57 </tp:docstring>
58 </property>
59 <property name="WirelessCapabilities" type="u" access="read" tp:type="NM_802_11_DEVICE_CAP">
60 <tp:docstring>
61 The capabilities of the wireless device.
62 </tp:docstring>
63 </property>
64
65 <signal name="PropertiesChanged">
66 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
67 <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
68 <tp:docstring>
69 A dictionary containing the FIXME: check changed parameters.
70 </tp:docstring>
71 </arg>
72 <tp:docstring>
73 Emitted when the wireless device's properties changed.
74 </tp:docstring>
75 </signal>
76
77 <signal name="AccessPointAdded">
78 <arg name="access_point" type="o">
79 <tp:docstring>
80 The object path of the newly found access point.
81 </tp:docstring>
82 </arg>
83 <tp:docstring>
84 Emitted when a new access point is found by the device.
85 </tp:docstring>
86 </signal>
87
88 <signal name="AccessPointRemoved">
89 <arg name="access_point" type="o">
90 <tp:docstring>
91 The object path of the access point that has disappeared.
92 </tp:docstring>
93 </arg>
94 <tp:docstring>
95 Emitted when an access point disappears from view of the device.
96 </tp:docstring>
97 </signal>
98
99 <tp:flags name="NM_802_11_DEVICE_CAP" type="u">
100 <tp:docstring>
101 Flags describing the capabilities of a wireless device.
102 </tp:docstring>
103 <tp:flag suffix="NONE" value="0x0">
104 <tp:docstring>Null capability - syntactic sugar for no capabilities supported. Do not AND this with other capabilities!</tp:docstring>
105 </tp:flag>
106 <tp:flag suffix="CIPHER_WEP40" value="0x1">
107 <tp:docstring>The device supports the 40-bit WEP cipher.</tp:docstring>
108 </tp:flag>
109 <tp:flag suffix="CIPHER_WEP104" value="0x2">
110 <tp:docstring>The device supports the 104-bit WEP cipher.</tp:docstring>
111 </tp:flag>
112 <tp:flag suffix="CIPHER_TKIP" value="0x4">
113 <tp:docstring>The device supports the TKIP cipher.</tp:docstring>
114 </tp:flag>
115 <tp:flag suffix="CIPHER_CCMP" value="0x8">
116 <tp:docstring>The device supports the CCMP cipher.</tp:docstring>
117 </tp:flag>
118 <tp:flag suffix="WPA" value="0x10">
119 <tp:docstring>The device supports the WPA encryption/authentication protocol.</tp:docstring>
120 </tp:flag>
121 <tp:flag suffix="RSN" value="0x20">
122 <tp:docstring>The device supports the RSN encryption/authentication protocol.</tp:docstring>
123 </tp:flag>
124 <tp:flag suffix="AP" value="0x40">
125 <tp:docstring>The device supports Access Point mode.</tp:docstring>
126 </tp:flag>
127 <tp:flag suffix="ADHOC" value="0x80">
128 <tp:docstring>The device supports Ad-Hoc mode.</tp:docstring>
129 </tp:flag>
130 </tp:flags>
131 </interface>
132</node>
0133
=== added file 'data/nm-device.xml'
--- data/nm-device.xml 1970-01-01 00:00:00 +0000
+++ data/nm-device.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,598 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="org.freedesktop.NetworkManager.Device">
5 <property name="Udi" type="s" access="read">
6 <tp:docstring>
7 Operating-system specific transient device hardware identifier. This
8 is an opaque string representing the underlying hardware for the device,
9 and shouldn't be used to keep track of individual devices. For some
10 device types (Bluetooth, Modems) it is an identifier used by the
11 hardware service (ie bluez or ModemManager) to refer to that device,
12 and client programs use it get additional information from those
13 services which NM does not provide. The Udi is not guaranteed to be
14 consistent across reboots or hotplugs of the hardware. If you're looking
15 for a way to uniquely track each device in your application, use the
16 object path. If you're looking for a way to track a specific piece of
17 hardware across reboot or hotplug, use a MAC address or USB serial
18 number.
19 </tp:docstring>
20 </property>
21 <property name="Interface" type="s" access="read">
22 <tp:docstring>
23 The name of the device's control (and often data) interface.
24 </tp:docstring>
25 </property>
26 <property name="IpInterface" type="s" access="read">
27 <tp:docstring>
28 The name of the device's data interface when available. This property
29 may not refer to the actual data interface until the device has
30 successfully established a data connection, indicated by the device's
31 State becoming ACTIVATED.
32 </tp:docstring>
33 </property>
34 <property name="Driver" type="s" access="read">
35 <tp:docstring>
36 The driver handling the device.
37 </tp:docstring>
38 </property>
39 <property name="DriverVersion" type="s" access="read">
40 <tp:docstring>
41 The version of the driver handling the device.
42 </tp:docstring>
43 </property>
44 <property name="FirmwareVersion" type="s" access="read">
45 <tp:docstring>
46 The firmware version for the device.
47 </tp:docstring>
48 </property>
49 <property name="Capabilities" type="u" access="read" tp:type="NM_DEVICE_CAP">
50 <tp:docstring>
51 Flags describing the capabilities of the device.
52 </tp:docstring>
53 </property>
54 <property name="Ip4Address" type="i" access="read">
55 <tp:docstring>
56 The IPv4 address bound to the device. FIXME: what about devices with >1 IP address?
57 </tp:docstring>
58 </property>
59 <property name="State" type="u" access="read" tp:type="NM_DEVICE_STATE">
60 <tp:docstring>
61 The current state of the device.
62 </tp:docstring>
63 </property>
64 <property name="StateReason" type="(uu)" access="read" tp:type="NM_DEVICE_STATE_REASON_STRUCT">
65 <annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariant"/>
66 <tp:docstring>
67 The current state and reason for changing to that state.
68 </tp:docstring>
69 </property>
70 <property name="ActiveConnection" type="o" access="read">
71 <tp:docstring>
72 Object path of an ActiveConnection object that "owns" this device during
73 activation. The ActiveConnection object tracks the life-cycle of a
74 connection to a specific network and implements the
75 org.freedesktop.NetworkManager.Connection.Active D-Bus interface.
76 </tp:docstring>
77 </property>
78 <property name="Ip4Config" type="o" access="read">
79 <tp:docstring>
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.
81 </tp:docstring>
82 </property>
83 <property name="Dhcp4Config" type="o" access="read">
84 <tp:docstring>
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.
86 </tp:docstring>
87 </property>
88 <property name="Ip6Config" type="o" access="read">
89 <tp:docstring>
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.
91 </tp:docstring>
92 </property>
93 <property name="Dhcp6Config" type="o" access="read">
94 <tp:docstring>
95 Object path of the Dhcp6Config object describing the DHCP options
96 returned by the DHCP server. Only valid when the device is in the
97 NM_DEVICE_STATE_ACTIVATED state.
98 </tp:docstring>
99 </property>
100 <property name="Managed" type="b" access="read">
101 <tp:docstring>
102 Whether or not this device is managed by NetworkManager.
103 </tp:docstring>
104 </property>
105 <property name="Autoconnect" type="b" access="readwrite">
106 <tp:docstring>
107 If TRUE, indicates the device is allowed to autoconnect. If FALSE,
108 manual intervention is required before the device will automatically
109 connect to a known network, such as activating a connection using the
110 device, or setting this property to TRUE.
111 </tp:docstring>
112 </property>
113 <property name="FirmwareMissing" type="b" access="read">
114 <tp:docstring>
115 If TRUE, indicates the device is likely missing firmware necessary for
116 its operation.
117 </tp:docstring>
118 </property>
119 <property name="DeviceType" type="u" access="read" tp:type="NM_DEVICE_TYPE">
120 <tp:docstring>
121 The general type of the network device; ie Ethernet, WiFi, etc.
122 </tp:docstring>
123 </property>
124 <property name="AvailableConnections" type="ao" access="read">
125 <tp:docstring>
126 An array of object paths of every configured connection that is currently 'available' through this device.
127 </tp:docstring>
128 </property>
129
130 <method name="Disconnect">
131 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_disconnect"/>
132 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
133 <tp:docstring>
134 Disconnects a device and prevents the device from automatically activating further connections without user intervention.
135 </tp:docstring>
136 </method>
137
138 <signal name="StateChanged">
139 <arg name="new_state" type="u" tp:type="NM_DEVICE_STATE">
140 <tp:docstring>
141 The new state of the device.
142 </tp:docstring>
143 </arg>
144 <arg name="old_state" type="u" tp:type="NM_DEVICE_STATE">
145 <tp:docstring>
146 The previous state of the device.
147 </tp:docstring>
148 </arg>
149 <arg name="reason" type="u" tp:type="NM_DEVICE_STATE_REASON">
150 <tp:docstring>
151 A reason for the state transition.
152 </tp:docstring>
153 </arg>
154 </signal>
155
156 <tp:enum name="NM_DEVICE_STATE" type="u">
157 <tp:enumvalue suffix="UNKNOWN" value="0">
158 <tp:docstring>
159 The device is in an unknown state.
160 </tp:docstring>
161 </tp:enumvalue>
162 <tp:enumvalue suffix="UNMANAGED" value="10">
163 <tp:docstring>
164 The device is recognized but not managed by NetworkManager.
165 </tp:docstring>
166 </tp:enumvalue>
167 <tp:enumvalue suffix="UNAVAILABLE" value="20">
168 <tp:docstring>
169 The device cannot be used (carrier off, rfkill, etc).
170 </tp:docstring>
171 </tp:enumvalue>
172 <tp:enumvalue suffix="DISCONNECTED" value="30">
173 <tp:docstring>
174 The device is not connected.
175 </tp:docstring>
176 </tp:enumvalue>
177 <tp:enumvalue suffix="PREPARE" value="40">
178 <tp:docstring>
179 The device is preparing to connect.
180 </tp:docstring>
181 </tp:enumvalue>
182 <tp:enumvalue suffix="CONFIG" value="50">
183 <tp:docstring>
184 The device is being configured.
185 </tp:docstring>
186 </tp:enumvalue>
187 <tp:enumvalue suffix="NEED_AUTH" value="60">
188 <tp:docstring>
189 The device is awaiting secrets necessary to continue connection.
190 </tp:docstring>
191 </tp:enumvalue>
192 <tp:enumvalue suffix="IP_CONFIG" value="70">
193 <tp:docstring>
194 The IP settings of the device are being requested and configured.
195 </tp:docstring>
196 </tp:enumvalue>
197 <tp:enumvalue suffix="IP_CHECK" value="80">
198 <tp:docstring>
199 The device's IP connectivity ability is being determined.
200 </tp:docstring>
201 </tp:enumvalue>
202 <tp:enumvalue suffix="SECONDARIES" value="90">
203 <tp:docstring>
204 The device is waiting for secondary connections to be activated.
205 </tp:docstring>
206 </tp:enumvalue>
207 <tp:enumvalue suffix="ACTIVATED" value="100">
208 <tp:docstring>
209 The device is active.
210 </tp:docstring>
211 </tp:enumvalue>
212 <tp:enumvalue suffix="DEACTIVATING" value="110">
213 <tp:docstring>
214 The device's network connection is being torn down.
215 </tp:docstring>
216 </tp:enumvalue>
217 <tp:enumvalue suffix="FAILED" value="120">
218 <tp:docstring>
219 The device is in a failure state following an attempt to activate it.
220 </tp:docstring>
221 </tp:enumvalue>
222 </tp:enum>
223
224 <tp:enum name="NM_DEVICE_TYPE" type="u">
225 <tp:enumvalue suffix="UNKNOWN" value="0">
226 <tp:docstring>
227 The device type is unknown.
228 </tp:docstring>
229 </tp:enumvalue>
230 <tp:enumvalue suffix="ETHERNET" value="1">
231 <tp:docstring>
232 The device is wired Ethernet device.
233 </tp:docstring>
234 </tp:enumvalue>
235 <tp:enumvalue suffix="WIFI" value="2">
236 <tp:docstring>
237 The device is an 802.11 WiFi device.
238 </tp:docstring>
239 </tp:enumvalue>
240 <tp:enumvalue suffix="UNUSED1" value="3">
241 <tp:docstring>Unused</tp:docstring>
242 </tp:enumvalue>
243 <tp:enumvalue suffix="UNUSED2" value="4">
244 <tp:docstring>Unused</tp:docstring>
245 </tp:enumvalue>
246 <tp:enumvalue suffix="BT" value="5">
247 <tp:docstring>
248 The device is Bluetooth device that provides PAN or DUN capabilities.
249 </tp:docstring>
250 </tp:enumvalue>
251 <tp:enumvalue suffix="OLPC_MESH" value="6">
252 <tp:docstring>
253 The device is an OLPC mesh networking device.
254 </tp:docstring>
255 </tp:enumvalue>
256 <tp:enumvalue suffix="WIMAX" value="7">
257 <tp:docstring>
258 The device is an 802.16e Mobile WiMAX device.
259 </tp:docstring>
260 </tp:enumvalue>
261 <tp:enumvalue suffix="MODEM" value="8">
262 <tp:docstring>
263 The device is a modem supporting one or more of analog telephone,
264 CDMA/EVDO, GSM/UMTS/HSPA, or LTE standards to access a cellular or
265 wireline data network.
266 </tp:docstring>
267 </tp:enumvalue>
268 <tp:enumvalue suffix="INFINIBAND" value="9">
269 <tp:docstring>
270 The device is an IP-capable InfiniBand interface.
271 </tp:docstring>
272 </tp:enumvalue>
273 <tp:enumvalue suffix="BOND" value="10">
274 <tp:docstring>
275 The device is a bond master interface.
276 </tp:docstring>
277 </tp:enumvalue>
278 <tp:enumvalue suffix="VLAN" value="11">
279 <tp:docstring>
280 The device is a VLAN interface.
281 </tp:docstring>
282 </tp:enumvalue>
283 <tp:enumvalue suffix="ADSL" value="12">
284 <tp:docstring>
285 The device is an ADSL device supporting PPPoE and PPPoATM protocols.
286 </tp:docstring>
287 </tp:enumvalue>
288 <tp:enumvalue suffix="BRIDGE" value="13">
289 <tp:docstring>
290 The device is a bridge interface.
291 </tp:docstring>
292 </tp:enumvalue>
293 </tp:enum>
294
295 <tp:flags name="NM_DEVICE_CAP" value-prefix="NM_DEVICE_CAP" type="u">
296 <tp:flag suffix="NONE" value="0x0">
297 <tp:docstring>Null capability.</tp:docstring>
298 </tp:flag>
299 <tp:flag suffix="NM_SUPPORTED" value="0x1">
300 <tp:docstring>The device is supported by NetworkManager.</tp:docstring>
301 </tp:flag>
302 <tp:flag suffix="CARRIER_DETECT" value="0x2">
303 <tp:docstring>The device supports carrier detection.</tp:docstring>
304 </tp:flag>
305 </tp:flags>
306
307 <tp:enum name="NM_DEVICE_STATE_REASON" type="u">
308 <tp:enumvalue suffix="UNKNOWN" value="0">
309 <tp:docstring>
310 The reason for the device state change is unknown.
311 </tp:docstring>
312 </tp:enumvalue>
313 <tp:enumvalue suffix="NONE" value="1">
314 <tp:docstring>
315 The state change is normal.
316 </tp:docstring>
317 </tp:enumvalue>
318 <tp:enumvalue suffix="NOW_MANAGED" value="2">
319 <tp:docstring>
320 The device is now managed.
321 </tp:docstring>
322 </tp:enumvalue>
323 <tp:enumvalue suffix="NOW_UNMANAGED" value="3">
324 <tp:docstring>
325 The device is no longer managed.
326 </tp:docstring>
327 </tp:enumvalue>
328 <tp:enumvalue suffix="CONFIG_FAILED" value="4">
329 <tp:docstring>
330 The device could not be readied for configuration.
331 </tp:docstring>
332 </tp:enumvalue>
333 <tp:enumvalue suffix="CONFIG_UNAVAILABLE" value="5">
334 <tp:docstring>
335 IP configuration could not be reserved (no available address, timeout, etc).
336 </tp:docstring>
337 </tp:enumvalue>
338 <tp:enumvalue suffix="CONFIG_EXPIRED" value="6">
339 <tp:docstring>
340 The IP configuration is no longer valid.
341 </tp:docstring>
342 </tp:enumvalue>
343 <tp:enumvalue suffix="NO_SECRETS" value="7">
344 <tp:docstring>
345 Secrets were required, but not provided.
346 </tp:docstring>
347 </tp:enumvalue>
348 <tp:enumvalue suffix="SUPPLICANT_DISCONNECT" value="8">
349 <tp:docstring>
350 The 802.1X supplicant disconnected from the access point or authentication server.
351 </tp:docstring>
352 </tp:enumvalue>
353 <tp:enumvalue suffix="SUPPLICANT_CONFIG_FAILED" value="9">
354 <tp:docstring>
355 Configuration of the 802.1X supplicant failed.
356 </tp:docstring>
357 </tp:enumvalue>
358 <tp:enumvalue suffix="SUPPLICANT_FAILED" value="10">
359 <tp:docstring>
360 The 802.1X supplicant quit or failed unexpectedly.
361 </tp:docstring>
362 </tp:enumvalue>
363 <tp:enumvalue suffix="SUPPLICANT_TIMEOUT" value="11">
364 <tp:docstring>
365 The 802.1X supplicant took too long to authenticate.
366 </tp:docstring>
367 </tp:enumvalue>
368 <tp:enumvalue suffix="PPP_START_FAILED" value="12">
369 <tp:docstring>
370 The PPP service failed to start within the allowed time.
371 </tp:docstring>
372 </tp:enumvalue>
373 <tp:enumvalue suffix="PPP_DISCONNECT" value="13">
374 <tp:docstring>
375 The PPP service disconnected unexpectedly.
376 </tp:docstring>
377 </tp:enumvalue>
378 <tp:enumvalue suffix="PPP_FAILED" value="14">
379 <tp:docstring>
380 The PPP service quit or failed unexpectedly.
381 </tp:docstring>
382 </tp:enumvalue>
383 <tp:enumvalue suffix="DHCP_START_FAILED" value="15">
384 <tp:docstring>
385 The DHCP service failed to start within the allowed time.
386 </tp:docstring>
387 </tp:enumvalue>
388 <tp:enumvalue suffix="DHCP_ERROR" value="16">
389 <tp:docstring>
390 The DHCP service reported an unexpected error.
391 </tp:docstring>
392 </tp:enumvalue>
393 <tp:enumvalue suffix="DHCP_FAILED" value="17">
394 <tp:docstring>
395 The DHCP service quit or failed unexpectedly.
396 </tp:docstring>
397 </tp:enumvalue>
398 <tp:enumvalue suffix="SHARED_START_FAILED" value="18">
399 <tp:docstring>
400 The shared connection service failed to start.
401 </tp:docstring>
402 </tp:enumvalue>
403 <tp:enumvalue suffix="SHARED_FAILED" value="19">
404 <tp:docstring>
405 The shared connection service quit or failed unexpectedly.
406 </tp:docstring>
407 </tp:enumvalue>
408 <tp:enumvalue suffix="AUTOIP_START_FAILED" value="20">
409 <tp:docstring>
410 The AutoIP service failed to start.
411 </tp:docstring>
412 </tp:enumvalue>
413 <tp:enumvalue suffix="AUTOIP_ERROR" value="21">
414 <tp:docstring>
415 The AutoIP service reported an unexpected error.
416 </tp:docstring>
417 </tp:enumvalue>
418 <tp:enumvalue suffix="AUTOIP_FAILED" value="22">
419 <tp:docstring>
420 The AutoIP service quit or failed unexpectedly.
421 </tp:docstring>
422 </tp:enumvalue>
423 <tp:enumvalue suffix="MODEM_BUSY" value="23">
424 <tp:docstring>
425 Dialing failed because the line was busy.
426 </tp:docstring>
427 </tp:enumvalue>
428 <tp:enumvalue suffix="MODEM_NO_DIAL_TONE" value="24">
429 <tp:docstring>
430 Dialing failed because there was no dial tone.
431 </tp:docstring>
432 </tp:enumvalue>
433 <tp:enumvalue suffix="MODEM_NO_CARRIER" value="25">
434 <tp:docstring>
435 Dialing failed because there was carrier.
436 </tp:docstring>
437 </tp:enumvalue>
438 <tp:enumvalue suffix="MODEM_DIAL_TIMEOUT" value="26">
439 <tp:docstring>
440 Dialing timed out.
441 </tp:docstring>
442 </tp:enumvalue>
443 <tp:enumvalue suffix="MODEM_DIAL_FAILED" value="27">
444 <tp:docstring>
445 Dialing failed.
446 </tp:docstring>
447 </tp:enumvalue>
448 <tp:enumvalue suffix="MODEM_INIT_FAILED" value="28">
449 <tp:docstring>
450 Modem initialization failed.
451 </tp:docstring>
452 </tp:enumvalue>
453 <tp:enumvalue suffix="GSM_APN_FAILED" value="29">
454 <tp:docstring>
455 Failed to select the specified GSM APN.
456 </tp:docstring>
457 </tp:enumvalue>
458 <tp:enumvalue suffix="GSM_REGISTRATION_NOT_SEARCHING" value="30">
459 <tp:docstring>
460 Not searching for networks.
461 </tp:docstring>
462 </tp:enumvalue>
463 <tp:enumvalue suffix="GSM_REGISTRATION_DENIED" value="31">
464 <tp:docstring>
465 Network registration was denied.
466 </tp:docstring>
467 </tp:enumvalue>
468 <tp:enumvalue suffix="GSM_REGISTRATION_TIMEOUT" value="32">
469 <tp:docstring>
470 Network registration timed out.
471 </tp:docstring>
472 </tp:enumvalue>
473 <tp:enumvalue suffix="GSM_REGISTRATION_FAILED" value="33">
474 <tp:docstring>
475 Failed to register with the requested GSM network.
476 </tp:docstring>
477 </tp:enumvalue>
478 <tp:enumvalue suffix="GSM_PIN_CHECK_FAILED" value="34">
479 <tp:docstring>
480 PIN check failed.
481 </tp:docstring>
482 </tp:enumvalue>
483 <tp:enumvalue suffix="FIRMWARE_MISSING" value="35">
484 <tp:docstring>
485 Necessary firmware for the device may be missing.
486 </tp:docstring>
487 </tp:enumvalue>
488 <tp:enumvalue suffix="REMOVED" value="36">
489 <tp:docstring>
490 The device was removed.
491 </tp:docstring>
492 </tp:enumvalue>
493 <tp:enumvalue suffix="SLEEPING" value="37">
494 <tp:docstring>
495 NetworkManager went to sleep.
496 </tp:docstring>
497 </tp:enumvalue>
498 <tp:enumvalue suffix="CONNECTION_REMOVED" value="38">
499 <tp:docstring>
500 The device's active connection was removed or disappeared.
501 </tp:docstring>
502 </tp:enumvalue>
503 <tp:enumvalue suffix="USER_REQUESTED" value="39">
504 <tp:docstring>
505 A user or client requested the disconnection.
506 </tp:docstring>
507 </tp:enumvalue>
508 <tp:enumvalue suffix="CARRIER" value="40">
509 <tp:docstring>
510 The device's carrier/link changed.
511 </tp:docstring>
512 </tp:enumvalue>
513 <tp:enumvalue suffix="CONNECTION_ASSUMED" value="41">
514 <tp:docstring>
515 The device's existing connection was assumed.
516 </tp:docstring>
517 </tp:enumvalue>
518 <tp:enumvalue suffix="SUPPLICANT_AVAILABLE" value="42">
519 <tp:docstring>
520 The 802.1x supplicant is now available.
521 </tp:docstring>
522 </tp:enumvalue>
523 <tp:enumvalue suffix="MODEM_NOT_FOUND" value="43">
524 <tp:docstring>
525 The modem could not be found.
526 </tp:docstring>
527 </tp:enumvalue>
528 <tp:enumvalue suffix="BT_FAILED" value="44">
529 <tp:docstring>
530 The Bluetooth connection timed out or failed.
531 </tp:docstring>
532 </tp:enumvalue>
533 <tp:enumvalue suffix="GSM_SIM_NOT_INSERTED" value="45">
534 <tp:docstring>
535 GSM Modem's SIM Card not inserted.
536 </tp:docstring>
537 </tp:enumvalue>
538 <tp:enumvalue suffix="GSM_SIM_PIN_REQUIRED" value="46">
539 <tp:docstring>
540 GSM Modem's SIM Pin required.
541 </tp:docstring>
542 </tp:enumvalue>
543 <tp:enumvalue suffix="GSM_SIM_PUK_REQUIRED" value="47">
544 <tp:docstring>
545 GSM Modem's SIM Puk required.
546 </tp:docstring>
547 </tp:enumvalue>
548 <tp:enumvalue suffix="GSM_SIM_WRONG" value="48">
549 <tp:docstring>
550 GSM Modem's SIM wrong
551 </tp:docstring>
552 </tp:enumvalue>
553 <tp:enumvalue suffix="INFINIBAND_MODE" value="49">
554 <tp:docstring>
555 InfiniBand device does not support connected mode.
556 </tp:docstring>
557 </tp:enumvalue>
558 <tp:enumvalue suffix="DEPENDENCY_FAILED" value="50">
559 <tp:docstring>
560 A dependency of the connection failed.
561 </tp:docstring>
562 </tp:enumvalue>
563 <tp:enumvalue suffix="BR2684_FAILED" value="51">
564 <tp:docstring>
565 Problem with the RFC 2684 Ethernet over ADSL bridge.
566 </tp:docstring>
567 </tp:enumvalue>
568 <tp:enumvalue suffix="MODEM_MANAGER_UNAVAILABLE" value="52">
569 <tp:docstring>
570 ModemManager was not running or quit unexpectedly.
571 </tp:docstring>
572 </tp:enumvalue>
573 <tp:enumvalue suffix="SSID_NOT_FOUND" value="53">
574 <tp:docstring>
575 The 802.11 Wi-Fi network could not be found.
576 </tp:docstring>
577 </tp:enumvalue>
578 <tp:enumvalue suffix="SECONDARY_CONNECTION_FAILED" value="54">
579 <tp:docstring>
580 A secondary connection of the base connection failed.
581 </tp:docstring>
582 </tp:enumvalue>
583 </tp:enum>
584
585 <tp:struct name="NM_DEVICE_STATE_REASON_STRUCT">
586 <tp:member type="u" name="state" tp:type="NM_DEVICE_STATE">
587 <tp:docstring>
588 The device state.
589 </tp:docstring>
590 </tp:member>
591 <tp:member type="u" name="reason" tp:type="NM_DEVICE_STATE_REASON">
592 <tp:docstring>
593 The reason for originally changing to the device state.
594 </tp:docstring>
595 </tp:member>
596 </tp:struct>
597 </interface>
598</node>
0599
=== added file 'data/nm-manager.xml'
--- data/nm-manager.xml 1970-01-01 00:00:00 +0000
+++ data/nm-manager.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,412 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/org/freedesktop/NetworkManager" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4 <interface name="org.freedesktop.NetworkManager">
5 <method name="GetDevices">
6 <tp:docstring>
7 Get the list of network devices.
8 </tp:docstring>
9 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_devices"/>
10 <arg name="devices" type="ao" direction="out">
11 <tp:docstring>
12 List of object paths of network devices known to the system.
13 </tp:docstring>
14 </arg>
15 </method>
16
17 <method name="GetDeviceByIpIface">
18 <tp:docstring>
19 Return the object path of the network device referenced by its IP
20 interface name. Note that some devices (usually modems) only have an
21 IP interface name when they are connected.
22 </tp:docstring>
23 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_device_by_ip_iface"/>
24 <arg name="iface" type="s" direction="in">
25 <tp:docstring>
26 Interface name of the device to find.
27 </tp:docstring>
28 </arg>
29 <arg name="device" type="o" direction="out">
30 <tp:docstring>
31 Object path of the network device.
32 </tp:docstring>
33 </arg>
34 </method>
35
36 <method name="ActivateConnection">
37 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_activate_connection"/>
38 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
39 <tp:docstring>
40 Activate a connection using the supplied device.
41 </tp:docstring>
42 <arg name="connection" type="o" direction="in">
43 <tp:docstring>
44 The connection to activate the devices with.
45 </tp:docstring>
46 </arg>
47 <arg name="device" type="o" direction="in">
48 <tp:docstring>
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.
50 </tp:docstring>
51 </arg>
52 <arg name="specific_object" type="o" direction="in">
53 <tp:docstring>
54 The path of a connection-type-specific object this activation should use.
55 This parameter is currently ignored for wired and mobile broadband connections,
56 and the value of "/" should be used (ie, no specific object). For WiFi
57 connections, pass the object path of a specific AP from the card's scan
58 list, or "/" to pick and AP automatically. For VPN connections, pass
59 the object path of an ActiveConnection object that should serve as the
60 "base" connection (to which the VPN connections lifetime will be tied),
61 or pass "/" and NM will automatically use the current default device.
62 </tp:docstring>
63 </arg>
64 <arg name="active_connection" type="o" direction="out">
65 <tp:docstring>
66 The path of the active connection object representing this active connection.
67 </tp:docstring>
68 </arg>
69 <tp:possible-errors>
70 <tp:error name="org.freedesktop.NetworkManager.Error.UnknownConnection"/>
71 <tp:error name="org.freedesktop.NetworkManager.Error.UnknownDevice"/>
72 <tp:error name="org.freedesktop.NetworkManager.Error.ConnectionActivating">
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>
74 </tp:error>
75 <tp:error name="org.freedesktop.NetworkManager.Error.ConnectionInvalid">
76 <tp:docstring>The connection is invalid for this device.</tp:docstring>
77 </tp:error>
78 </tp:possible-errors>
79 </method>
80
81 <method name="AddAndActivateConnection">
82 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_add_and_activate_connection"/>
83 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
84 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantDictMap"/>
85 <tp:docstring>
86 Adds a new connection using the given details (if any) as a template
87 (automatically filling in missing settings with the capabilities of the
88 given device and specific object), then activate the new connection.
89 Cannot be used for VPN connections at this time.
90 </tp:docstring>
91 <arg name="connection" type="a{sa{sv}}" direction="in">
92 <tp:docstring>
93 Connection settings and properties; if incomplete missing settings will
94 be automatically completed using the given device and specific object.
95 </tp:docstring>
96 </arg>
97 <arg name="device" type="o" direction="in">
98 <tp:docstring>
99 The object path of device to be activated using the given connection.
100 </tp:docstring>
101 </arg>
102 <arg name="specific_object" type="o" direction="in">
103 <tp:docstring>
104 The path of a connection-type-specific object this activation should use.
105 This parameter is currently ignored for wired and mobile broadband connections,
106 and the value of "/" should be used (ie, no specific object). For WiFi
107 connections, pass the object path of a specific AP from the card's scan
108 list, which will be used to complete the details of the newly added
109 connection.
110 </tp:docstring>
111 </arg>
112 <arg name="path" type="o" direction="out">
113 <tp:docstring>
114 Object path of the new connection that was just added.
115 </tp:docstring>
116 </arg>
117 <arg name="active_connection" type="o" direction="out">
118 <tp:docstring>
119 The path of the active connection object representing this active connection.
120 </tp:docstring>
121 </arg>
122 <tp:possible-errors>
123 <tp:error name="org.freedesktop.NetworkManager.Error.UnknownConnection"/>
124 <tp:error name="org.freedesktop.NetworkManager.Error.UnknownDevice"/>
125 <tp:error name="org.freedesktop.NetworkManager.Error.ConnectionInvalid">
126 <tp:docstring>The connection is invalid for this device.</tp:docstring>
127 </tp:error>
128 </tp:possible-errors>
129 </method>
130
131 <method name="DeactivateConnection">
132 <tp:docstring>
133 Deactivate an active connection.
134 </tp:docstring>
135 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_deactivate_connection"/>
136 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
137 <arg name="active_connection" type="o" direction="in">
138 <tp:docstring>
139 The currently active connection to deactivate.
140 </tp:docstring>
141 </arg>
142 </method>
143
144 <method name="Sleep">
145 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_sleep"/>
146 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
147 <tp:docstring>
148 Control the NetworkManager daemon's sleep state. When asleep, all
149 interfaces that it manages are deactivated. When awake, devices are
150 available to be activated. This command should not be called directly
151 by users or clients; it is intended for system suspend/resume tracking.
152 </tp:docstring>
153 <arg name="sleep" type="b" direction="in">
154 <tp:docstring>
155 Indicates whether the NetworkManager daemon should sleep or wake.
156 </tp:docstring>
157 </arg>
158 </method>
159
160 <method name="Enable">
161 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_enable"/>
162 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
163 <tp:docstring>
164 Control whether overall networking is enabled or disabled. When
165 disabled, all interfaces that NM manages are deactivated. When enabled,
166 all managed interfaces are re-enabled and available to be activated.
167 This command should be used by clients that provide to users the ability
168 to enable/disable all networking.
169 </tp:docstring>
170 <arg name="enable" type="b" direction="in">
171 <tp:docstring>
172 If FALSE, indicates that all networking should be disabled. If TRUE,
173 indicates that NetworkManager should begin managing network devices.
174 </tp:docstring>
175 </arg>
176 </method>
177
178 <method name="GetPermissions">
179 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_permissions"/>
180 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
181 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
182 <tp:docstring>
183 Returns the permissions a caller has for various authenticated operations
184 that NetworkManager provides, like Enable/Disable networking, changing
185 WiFi, WWAN, and WiMAX state, etc.
186 </tp:docstring>
187 <arg name="permissions" type="a{ss}" direction="out">
188 <tp:docstring>
189 Dictionary of available permissions and results. Each permission
190 is represented by a name (ie "org.freedesktop.NetworkManager.Foobar")
191 and each result is one of the following values: "yes" (the permission
192 is available), "auth" (the permission is available after a successful
193 authentication), or "no" (the permission is denied). Clients may use
194 these values in the UI to indicate the ability to perform certain
195 operations.
196 </tp:docstring>
197 </arg>
198 </method>
199
200 <signal name="CheckPermissions">
201 <tp:docstring>
202 Emitted when system authorization details change, indicating that
203 clients may wish to recheck permissions with GetPermissions.
204 </tp:docstring>
205 </signal>
206
207 <method name="SetLogging">
208 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_set_logging"/>
209 <tp:docstring>
210 Set logging verbosity and which operations are logged.
211 </tp:docstring>
212 <arg name="level" type="s" direction="in">
213 <tp:docstring>
214 One of [ERR, WARN, INFO, DEBUG].
215 </tp:docstring>
216 </arg>
217 <arg name="domains" type="s" direction="in">
218 <tp:docstring>
219 A combination of logging domains separated by commas (','), or "NONE"
220 to disable logging. Each domain enables logging for operations
221 related to that domain. Available domains are: [HW, RFKILL, ETHER,
222 WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS,
223 VPN, SHARING, SUPPLICANT, AGENTS, SETTINGS, SUSPEND, CORE, DEVICE,
224 OLPC, WIMAX, INFINIBAND, FIREWALL, ADSL, BOND, VLAN]. In addition to
225 these domains, the following special domains can be used: [NONE, ALL,
226 DEFAULT, DHCP, IP]. If an empty string is given, the log level is
227 changed but the current set of log domains remains unchanged.
228 </tp:docstring>
229 </arg>
230 </method>
231
232 <method name="GetLogging">
233 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_logging"/>
234 <tp:docstring>
235 Get current logging verbosity level and operations domains.
236 </tp:docstring>
237 <arg name="level" type="s" direction="out">
238 <tp:docstring>
239 One of [ERR, WARN, INFO, DEBUG].
240 </tp:docstring>
241 </arg>
242 <arg name="domains" type="s" direction="out">
243 <tp:docstring>
244 For available domains see SetLogging() call.
245 </tp:docstring>
246 </arg>
247 </method>
248
249 <method name="state">
250 <tp:docstring>
251 The overall networking state as determined by the NetworkManager daemon,
252 based on the state of network devices under it's management.
253 </tp:docstring>
254 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_manager_get_state"/>
255 <arg name="state" type="u" direction="out" tp:type="NM_STATE"/>
256 </method>
257
258 <property name="NetworkingEnabled" type="b" access="read">
259 <tp:docstring>
260 Indicates if overall networking is currently enabled or not. See the
261 Enable() method.
262 </tp:docstring>
263 </property>
264
265 <property name="WirelessEnabled" type="b" access="readwrite">
266 <tp:docstring>
267 Indicates if wireless is currently enabled or not.
268 </tp:docstring>
269 </property>
270
271 <property name="WirelessHardwareEnabled" type="b" access="read">
272 <tp:docstring>
273 Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
274 </tp:docstring>
275 </property>
276
277 <property name="WwanEnabled" type="b" access="readwrite">
278 <tp:docstring>
279 Indicates if mobile broadband devices are currently enabled or not.
280 </tp:docstring>
281 </property>
282
283 <property name="WwanHardwareEnabled" type="b" access="read">
284 <tp:docstring>
285 Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
286 </tp:docstring>
287 </property>
288
289 <property name="WimaxEnabled" type="b" access="readwrite">
290 <tp:docstring>
291 Indicates if WiMAX devices are currently enabled or not.
292 </tp:docstring>
293 </property>
294
295 <property name="WimaxHardwareEnabled" type="b" access="read">
296 <tp:docstring>
297 Indicates if the WiMAX hardware is currently enabled, i.e. the state of the RF kill switch.
298 </tp:docstring>
299 </property>
300
301 <property name="ActiveConnections" type="ao" access="read">
302 <tp:docstring>
303 List of active connection object paths.
304 </tp:docstring>
305 </property>
306
307 <property name="Version" type="s" access="read">
308 <tp:docstring>
309 NetworkManager version.
310 </tp:docstring>
311 </property>
312
313 <property name="State" type="u" access="read" tp:type="NM_STATE">
314 <tp:docstring>
315 The overall state of the NetworkManager daemon.
316 </tp:docstring>
317 </property>
318
319 <signal name="StateChanged">
320 <tp:docstring>
321 NetworkManager's state changed.
322 </tp:docstring>
323 <arg name="state" type="u" tp:type="NM_STATE">
324 <tp:docstring>
325 The new state of NetworkManager.
326 </tp:docstring>
327 </arg>
328 </signal>
329
330 <signal name="PropertiesChanged">
331 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
332 <tp:docstring>
333 NetworkManager's properties changed.
334 </tp:docstring>
335 <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
336 <tp:docstring>
337 The changed properties.
338 </tp:docstring>
339 </arg>
340 </signal>
341
342 <signal name="DeviceAdded">
343 <tp:docstring>
344 A device was added to the system
345 </tp:docstring>
346 <arg name="device_path" type="o">
347 <tp:docstring>
348 The object path of the newly added device.
349 </tp:docstring>
350 </arg>
351 </signal>
352
353 <signal name="DeviceRemoved">
354 <tp:docstring>
355 A device was removed from the system, and is no longer available.
356 </tp:docstring>
357 <arg name="device_path" type="o">
358 <tp:docstring>
359 The object path of the device that was just removed.
360 </tp:docstring>
361 </arg>
362 </signal>
363
364 <tp:enum name="NM_STATE" type="u">
365 <tp:docstring>
366 Describes the overall state of the daemon.
367 </tp:docstring>
368 <tp:enumvalue suffix="UNKNOWN" value="0">
369 <tp:docstring>
370 Networking state is unknown.
371 </tp:docstring>
372 </tp:enumvalue>
373 <tp:enumvalue suffix="ASLEEP" value="10">
374 <tp:docstring>
375 Networking is inactive and all devices are disabled.
376 </tp:docstring>
377 </tp:enumvalue>
378 <tp:enumvalue suffix="DISCONNECTED" value="20">
379 <tp:docstring>
380 There is no active network connection.
381 </tp:docstring>
382 </tp:enumvalue>
383 <tp:enumvalue suffix="DISCONNECTING" value="30">
384 <tp:docstring>
385 Network connections are being cleaned up.
386 </tp:docstring>
387 </tp:enumvalue>
388 <tp:enumvalue suffix="CONNECTING" value="40">
389 <tp:docstring>
390 A network device is connecting to a network and there is no other
391 available network connection.
392 </tp:docstring>
393 </tp:enumvalue>
394 <tp:enumvalue suffix="CONNECTED_LOCAL" value="50">
395 <tp:docstring>
396 A network device is connected, but there is only link-local connectivity.
397 </tp:docstring>
398 </tp:enumvalue>
399 <tp:enumvalue suffix="CONNECTED_SITE" value="60">
400 <tp:docstring>
401 A network device is connected, but there is only site-local connectivity.
402 </tp:docstring>
403 </tp:enumvalue>
404 <tp:enumvalue suffix="CONNECTED_GLOBAL" value="70">
405 <tp:docstring>
406 A network device is connected, with global network connectivity.
407 </tp:docstring>
408 </tp:enumvalue>
409 </tp:enum>
410
411 </interface>
412</node>
0413
=== added file 'data/nm-settings-connection.xml'
--- data/nm-settings-connection.xml 1970-01-01 00:00:00 +0000
+++ data/nm-settings-connection.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,157 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
4
5 <interface name="org.freedesktop.NetworkManager.Settings.Connection">
6 <tp:docstring>
7 Represents a single network connection configuration.
8 </tp:docstring>
9
10 <method name="Update">
11 <tp:docstring>
12 Update the connection with new settings and properties (replacing
13 all previous settings and properties) and save the connection to
14 disk. Secrets may be part of the update request, and will be either
15 stored in persistent storage or sent to a Secret Agent for storage,
16 depending on the flags associated with each secret.
17 </tp:docstring>
18 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_update"/>
19 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
20 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantDictMap"/>
21 <arg name="properties" type="a{sa{sv}}" direction="in">
22 <tp:docstring>
23 New connection settings, properties, and (optionally) secrets.
24 </tp:docstring>
25 </arg>
26 </method>
27
28 <method name="UpdateUnsaved">
29 <tp:docstring>
30 Update the connection with new settings and properties (replacing
31 all previous settings and properties) but do not immediately save
32 the connection to disk. Secrets may be part of the update request
33 and may sent to a Secret Agent for storage, depending on the
34 flags associated with each secret.
35
36 Use the 'Save' method to save these changes to disk. Note
37 that unsaved changes will be lost if the connection is
38 reloaded from disk (either automatically on file change or
39 due to an explicit ReloadConnections call).
40 </tp:docstring>
41 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_update_unsaved"/>
42 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
43 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantDictMap"/>
44 <arg name="properties" type="a{sa{sv}}" direction="in">
45 <tp:docstring>
46 New connection settings, properties, and (optionally) secrets.
47 </tp:docstring>
48 </arg>
49 </method>
50
51 <method name="Delete">
52 <tp:docstring>
53 Delete the connection.
54 </tp:docstring>
55 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_delete"/>
56 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
57 </method>
58
59 <method name="GetSettings">
60 <tp:docstring>
61 Get the settings maps describing this network configuration.
62 This will never include any secrets required for connection
63 to the network, as those are often protected. Secrets must
64 be requested separately using the GetSecrets() call.
65 </tp:docstring>
66 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_get_settings"/>
67 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
68 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantDictMap"/>
69 <arg name="settings" type="a{sa{sv}}" direction="out" tp:type="String_String_Variant_Map_Map">
70 <tp:docstring>
71 The nested settings maps describing this object.
72 </tp:docstring>
73 </arg>
74 </method>
75
76 <method name="GetSecrets">
77 <tp:docstring>
78 Get the secrets belonging to this network configuration. Only
79 secrets from persistent storage or a Secret Agent running in
80 the requestor's session will be returned. The user will never
81 be prompted for secrets as a result of this request.
82 </tp:docstring>
83 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_get_secrets"/>
84 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
85 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantDictMap"/>
86 <arg name="setting_name" type="s" direction="in">
87 <tp:docstring>
88 Name of the setting to return secrets for. If empty, all
89 all secrets will be returned.
90 </tp:docstring>
91 </arg>
92
93 <arg name="secrets" type="a{sa{sv}}" direction="out" tp:type="String_String_Variant_Map_Map">
94 <tp:docstring>
95 Nested settings maps containing secrets.
96 </tp:docstring>
97 </arg>
98 </method>
99
100 <method name="ClearSecrets">
101 <tp:docstring>
102 Clear the secrets belonging to this network connection profile.
103 </tp:docstring>
104 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_clear_secrets"/>
105 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
106 </method>
107
108 <method name="Save">
109 <tp:docstring>
110 Saves a "dirty" connection (that had previously been
111 updated with UpdateUnsaved) to persistent storage.
112 </tp:docstring>
113 <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_connection_save"/>
114 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
115 </method>
116
117 <signal name="Updated">
118 <tp:docstring>
119 Emitted when any settings or permissions change. When handling
120 this signal, clients should re-read the connection using the
121 GetSettings method to get the changes and to ensure the client
122 still has permission to access the connection.
123 </tp:docstring>
124 </signal>
125
126 <signal name="Removed">
127 <tp:docstring>
128 Emitted when this connection is no longer available. This
129 happens when the connection is deleted or if it is no longer
130 accessible by any of the system's logged-in users. After
131 receipt of this signal, the object no longer exists. Also
132 see the Settings.ConnectionRemoved signal.
133 </tp:docstring>
134 </signal>
135
136 <property name="Unsaved" type="b" access="read">
137 <tp:docstring>
138 If set, indicates that the in-memory state of the
139 connection does not match the on-disk state. This flag
140 will be set when UpdateUnsaved() is called or when any
141 connection details change, and cleared when the connection
142 is saved to disk via Save() or from internal operations.
143 </tp:docstring>
144 </property>
145
146 <signal name="PropertiesChanged">
147 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
148 <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
149 <tp:docstring>
150 A dictionary mapping property names to variant boxed values.
151 </tp:docstring>
152 </arg>
153 </signal>
154
155 </interface>
156
157</node>
0158
=== added file 'data/org.freedesktop.URfkill.Device.xml'
--- data/org.freedesktop.URfkill.Device.xml 1970-01-01 00:00:00 +0000
+++ data/org.freedesktop.URfkill.Device.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,143 @@
1<!DOCTYPE node PUBLIC
2"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
3"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
4<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
5
6 <interface name="org.freedesktop.URfkill.Device">
7 <doc:doc>
8 <doc:description>
9 <doc:para>
10 Objects implementing this interface are usually discovered through
11 the <doc:tt>org.freedesktop.URfkill</doc:tt> interface on
12 the <doc:tt>/org/freedesktop/URfkill</doc:tt> object on
13 the D-Bus system bus service with the well-known
14 name <doc:tt>org.freedesktop.URfkill</doc:tt> using
15 the
16 <doc:ref type="method" to="Rfkill.EnumerateDevices">EnumerateDevices</doc:ref>
17 method.
18 </doc:para>
19 <doc:para>
20 <doc:example language="shell" title="simple example">
21 <doc:code>
22$ gdbus call -y \
23 -d org.freedesktop.URfkill \
24 -o /org/freedesktop/URfkill/devices/0 \
25 -m org.freedesktop.DBus.Properties.GetAll \
26 "org.freedesktop.URfkill.Device"
27
28({'index': &lt;uint32 0&gt;, 'type': &lt;uint32 2&gt;, 'name': &lt;'tpacpi_bluetooth_sw'&gt;, 'soft': &lt;true&gt;, 'hard': &lt;true&gt;, 'platform': &lt;true&gt;},)
29 </doc:code>
30 </doc:example>
31 </doc:para>
32 </doc:description>
33 </doc:doc>
34
35 <!-- ************************************************************ -->
36
37 <signal name="Changed">
38 <doc:doc>
39 <doc:description>
40 <doc:para>
41 Emitted when a property of the device is changed.
42 </doc:para>
43 <doc:para>
44 Note: This signal is deprecated since 0.4.0. Use the standard signal,
45 PropertiesChanged from org.freedesktop.DBus.Properties instead.
46 </doc:para>
47 </doc:description>
48 </doc:doc>
49 </signal>
50
51 <!-- ************************************************************ -->
52
53 <property name="index" type="u" access="read">
54 <doc:doc>
55 <doc:description>
56 <doc:para>
57 The index of the rfkill device
58 </doc:para>
59 </doc:description>
60 </doc:doc>
61 </property>
62
63 <property name="type" type="u" access="read">
64 <doc:doc>
65 <doc:description>
66 <doc:para>
67 The type of the rfkill device
68 </doc:para>
69 <doc:list>
70 <doc:item>
71 <doc:term>0</doc:term><doc:definition>All</doc:definition>
72 </doc:item>
73 <doc:item>
74 <doc:term>1</doc:term><doc:definition>WLAN</doc:definition>
75 </doc:item>
76 <doc:item>
77 <doc:term>2</doc:term><doc:definition>Bluetooth</doc:definition>
78 </doc:item>
79 <doc:item>
80 <doc:term>3</doc:term><doc:definition>UWB</doc:definition>
81 </doc:item>
82 <doc:item>
83 <doc:term>4</doc:term><doc:definition>WIMAX</doc:definition>
84 </doc:item>
85 <doc:item>
86 <doc:term>5</doc:term><doc:definition>WWAN</doc:definition>
87 </doc:item>
88 <doc:item>
89 <doc:term>6</doc:term><doc:definition>GPS</doc:definition>
90 </doc:item>
91 <doc:item>
92 <doc:term>7</doc:term><doc:definition>FM</doc:definition>
93 </doc:item>
94 <doc:item>
95 <doc:term>8</doc:term><doc:definition>NFC</doc:definition>
96 </doc:item>
97 </doc:list>
98 </doc:description>
99 </doc:doc>
100 </property>
101
102 <property name="name" type="s" access="read">
103 <doc:doc>
104 <doc:description>
105 <doc:para>
106 The name of the rfkill device
107 </doc:para>
108 </doc:description>
109 </doc:doc>
110 </property>
111
112 <property name="soft" type="b" access="read">
113 <doc:doc>
114 <doc:description>
115 <doc:para>
116 Whether the soft block of the device is on or not
117 </doc:para>
118 </doc:description>
119 </doc:doc>
120 </property>
121
122 <property name="hard" type="b" access="read">
123 <doc:doc>
124 <doc:description>
125 <doc:para>
126 Whether the hard block of the device is on or not
127 </doc:para>
128 </doc:description>
129 </doc:doc>
130 </property>
131
132 <property name="platform" type="b" access="read">
133 <doc:doc>
134 <doc:description>
135 <doc:para>
136 Whether the device is generated by a platform driver or not
137 </doc:para>
138 </doc:description>
139 </doc:doc>
140 </property>
141
142 </interface>
143</node>
0144
=== added file 'data/org.freedesktop.URfkill.Killswitch.xml'
--- data/org.freedesktop.URfkill.Killswitch.xml 1970-01-01 00:00:00 +0000
+++ data/org.freedesktop.URfkill.Killswitch.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,78 @@
1<!DOCTYPE node PUBLIC
2"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
3"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
4<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
5
6 <interface name="org.freedesktop.URfkill.Killswitch">
7 <doc:doc>
8 <doc:description>
9 <doc:para>
10 Objects implementing this interface represent different types
11 of killswitches and are discovered through the
12 <doc:tt>org.freedesktop.URfkill.Killswitch</doc:tt> interface
13 on the <doc:tt>/org/freedesktop/URfkill/TYPENAME</doc:tt>
14 object on the D-Bus system bus service with the well-known
15 name <doc:tt>org.freedesktop.URfkill</doc:tt>. The TYPENAME
16 could be <doc:tt>"WLAN"</doc:tt>, <doc:tt>"BLUETOOTH"</doc:tt>,
17 <doc:tt>"UWB"</doc:tt>, <doc:tt>"WIMAX"</doc:tt>,
18 <doc:tt>"WWAN"</doc:tt>, <doc:tt>"GPS"</doc:tt>,
19 <doc:tt>"FM"</doc:tt>, or <doc:tt>"NFC"</doc:tt>.
20 </doc:para>
21 <doc:para>
22 <doc:example language="shell" title="simple example">
23 <doc:code>
24$ gdbus call -y \
25 -d org.freedesktop.URfkill \
26 -o /org/freedesktop/URfkill/WLAN \
27 -m org.freedesktop.DBus.Properties.GetAll \
28 "org.freedesktop.URfkill.Killswitch"
29
30({'state': &lt;2&gt;},)
31 </doc:code>
32 </doc:example>
33 </doc:para>
34 </doc:description>
35 </doc:doc>
36
37 <signal name="StateChanged">
38 <doc:doc>
39 <doc:description>
40 <doc:para>
41 Emitted when the state of the killswitch changed.
42 </doc:para>
43 <doc:para>
44 Note: This signal is deprecated since 0.4.0. Use the standard signal,
45 PropertiesChanged from org.freedesktop.DBus.Properties instead.
46 </doc:para>
47 </doc:description>
48 </doc:doc>
49 </signal>
50
51 <!-- ************************************************************ -->
52
53 <property name="state" type="i" access="read">
54 <doc:doc>
55 <doc:description>
56 <doc:para>
57 The state of the killswitch
58 </doc:para>
59 <doc:list>
60 <doc:item>
61 <doc:term>-1</doc:term><doc:definition>killswitch is not available.</doc:definition>
62 </doc:item>
63 <doc:item>
64 <doc:term>0</doc:term><doc:definition>killswitch is unblocked.</doc:definition>
65 </doc:item>
66 <doc:item>
67 <doc:term>1</doc:term><doc:definition>killswitch is soft-blocked.</doc:definition>
68 </doc:item>
69 <doc:item>
70 <doc:term>2</doc:term><doc:definition>killswitch is hard-blocked.</doc:definition>
71 </doc:item>
72 </doc:list>
73 </doc:description>
74 </doc:doc>
75 </property>
76
77 </interface>
78</node>
079
=== added file 'data/org.freedesktop.URfkill.xml'
--- data/org.freedesktop.URfkill.xml 1970-01-01 00:00:00 +0000
+++ data/org.freedesktop.URfkill.xml 2015-04-01 15:30:55 +0000
@@ -0,0 +1,388 @@
1<!DOCTYPE node PUBLIC
2"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
3"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
4<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
5
6 <interface name="org.freedesktop.URfkill">
7 <doc:doc>
8 <doc:description>
9 <doc:para>
10 The urfkill service is available via the system message
11 bus. To access the service, use
12 the <doc:tt>org.freedesktop.URfkill</doc:tt> interface on
13 the <doc:tt>/org/freedesktop/URfkill</doc:tt> object on
14 the D-Bus system bus service with the well-known
15 name <doc:tt>org.freedesktop.URfkill</doc:tt>.
16 </doc:para>
17 <doc:para>
18 <doc:example language="shell" title="simple example">
19 <doc:code>
20$ gdbus call -y \
21 -d org.freedesktop.URfkill \
22 -o /org/freedesktop/URfkill \
23 -m org.freedesktop.URfkill.EnumerateDevices
24
25([objectpath '/org/freedesktop/URfkill/devices/0', '/org/freedesktop/URfkill/devices/1'],)
26 </doc:code>
27 </doc:example>
28 </doc:para>
29 </doc:description>
30 </doc:doc>
31
32 <!-- ************************************************************ -->
33
34 <method name="Block">
35 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
36 <arg type="u" name="type" direction="in">
37 <doc:doc><doc:summary>
38 The type of devices to be blocked/unblocked
39 </doc:summary></doc:doc>
40 </arg>
41 <arg type="b" name="block" direction="in">
42 <doc:doc><doc:summary>
43 TRUE to block the devices, FALSE to unblock
44 </doc:summary></doc:doc>
45 </arg>
46 <arg type="b" name="ret" direction="out">
47 <doc:doc><doc:summary>
48 TRUE for success, otherwise FALSE
49 </doc:summary></doc:doc>
50 </arg>
51
52 <doc:doc>
53 <doc:description>
54 <doc:para>
55 Block or unblock the devices belonging to the type.
56 The types are defined as the followings:
57 </doc:para>
58 <doc:list>
59 <doc:item>
60 <doc:term>0</doc:term><doc:definition>All</doc:definition>
61 </doc:item>
62 <doc:item>
63 <doc:term>1</doc:term><doc:definition>WLAN</doc:definition>
64 </doc:item>
65 <doc:item>
66 <doc:term>2</doc:term><doc:definition>Bluetooth</doc:definition>
67 </doc:item>
68 <doc:item>
69 <doc:term>3</doc:term><doc:definition>UWB</doc:definition>
70 </doc:item>
71 <doc:item>
72 <doc:term>4</doc:term><doc:definition>WIMAX</doc:definition>
73 </doc:item>
74 <doc:item>
75 <doc:term>5</doc:term><doc:definition>WWAN</doc:definition>
76 </doc:item>
77 <doc:item>
78 <doc:term>6</doc:term><doc:definition>GPS</doc:definition>
79 </doc:item>
80 <doc:item>
81 <doc:term>7</doc:term><doc:definition>FM</doc:definition>
82 </doc:item>
83 </doc:list>
84 <doc:para>
85 Note: This method only changes soft block. Hard block is controlled
86 by BIOS or the hardware and there is no way to change the
87 state of hard block through kernel functions.
88 </doc:para>
89 </doc:description>
90 <doc:permission>
91 This method is restricted to the active session user.
92 </doc:permission>
93 </doc:doc>
94 </method>
95
96 <!-- ************************************************************ -->
97
98 <method name="BlockIdx">
99 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
100 <arg type="u" name="index" direction="in">
101 <doc:doc><doc:summary>
102 The index of the device to be blocked/unblocked
103 </doc:summary></doc:doc>
104 </arg>
105 <arg type="b" name="block" direction="in">
106 <doc:doc><doc:summary>
107 TRUE to block the device, FALSE to unblock
108 </doc:summary></doc:doc>
109 </arg>
110 <arg type="b" name="ret" direction="out">
111 <doc:doc><doc:summary>
112 TRUE for success, otherwise FALSE
113 </doc:summary></doc:doc>
114 </arg>
115
116 <doc:doc>
117 <doc:description>
118 <doc:para>
119 Block or unblock the device by the index.
120 </doc:para>
121 <doc:para>
122 Note: This method only changes soft block. Hard block is controlled
123 by BIOS or the hardware and there is no way to change the
124 state of hard block through kernel functions.
125 </doc:para>
126 </doc:description>
127 <doc:permission>
128 This method is restricted to the currently active session user.
129 </doc:permission>
130 </doc:doc>
131 </method>
132
133 <!-- ************************************************************ -->
134
135 <method name="EnumerateDevices">
136 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
137 <arg type="ao" name="array" direction="out">
138 <doc:doc><doc:summary>
139 An array of the object pathes for the devices
140 </doc:summary></doc:doc>
141 </arg>
142
143 <doc:doc>
144 <doc:description>
145 <doc:para>
146 Enumerate all rfkill objects on the system.
147 </doc:para>
148 </doc:description>
149 </doc:doc>
150 </method>
151
152 <!-- ************************************************************ -->
153
154 <method name="FlightMode">
155 <arg type="b" name="block" direction="in">
156 <doc:doc><doc:summary>
157 TRUE of flight mode should be enabled, otherwise FALSE
158 </doc:summary></doc:doc>
159 </arg>
160 <arg type="b" name="ret" direction="out">
161 <doc:doc><doc:summary>
162 TRUE if successful, otherwise FALSE
163 </doc:summary></doc:doc>
164 </arg>
165
166 <doc:doc>
167 <doc:description>
168 <doc:para>
169 Enable or disable flight mode.
170 </doc:para>
171 </doc:description>
172 </doc:doc>
173 </method>
174
175 <!-- ************************************************************ -->
176
177 <method name="IsFlightMode">
178 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
179 <arg type="b" name="is_flight_mode" direction="out">
180 <doc:doc><doc:summary>
181 TRUE if flight mode is enabled, otherwise FALSE
182 </doc:summary></doc:doc>
183 </arg>
184
185 <doc:doc>
186 <doc:description>
187 <doc:para>
188 Get whether flight mode is enabled or not.
189 </doc:para>
190 </doc:description>
191 </doc:doc>
192 </method>
193
194 <!-- ************************************************************ -->
195
196 <method name="IsInhibited">
197 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
198 <arg type="b" name="is_inhibited" direction="out">
199 <doc:doc><doc:summary>
200 TRUE if the key control is inhibited, otherwise FALSE
201 </doc:summary></doc:doc>
202 </arg>
203
204 <doc:doc>
205 <doc:description>
206 <doc:para>
207 Get whether the rfkill key handling function is inhibited or not.
208 </doc:para>
209 </doc:description>
210 </doc:doc>
211 </method>
212
213 <!-- ************************************************************ -->
214
215 <method name="Inhibit">
216 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
217 <arg type="s" name="reason" direction="in">
218 <doc:doc><doc:summary>
219 The reason to inhibit the key control
220 </doc:summary></doc:doc>
221 </arg>
222 <arg type="u" name="inhibit_cookie" direction="out">
223 <doc:doc><doc:summary>
224 The cookie
225 </doc:summary></doc:doc>
226 </arg>
227
228 <doc:doc>
229 <doc:description>
230 <doc:para>
231 Inhibit the rfkill key handling function for the session.
232 </doc:para>
233 </doc:description>
234 </doc:doc>
235 </method>
236
237 <!-- ************************************************************ -->
238
239 <method name="Uninhibit">
240 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
241 <arg type="u" name="inhibit_cookie" direction="in">
242 <doc:doc><doc:summary>
243 The cookie
244 </doc:summary></doc:doc>
245 </arg>
246
247 <doc:doc>
248 <doc:description>
249 <doc:para>
250 Cancel a previous call to <doc:ref type="method" to="org.freedesktop.URfkill.Inhibit">Inhibit()</doc:ref>
251 identified by the cookie.
252 </doc:para>
253 </doc:description>
254 </doc:doc>
255 </method>
256
257 <!-- ************************************************************ -->
258
259 <signal name="DeviceAdded">
260 <arg type="o" name="device" direction="out">
261 <doc:doc><doc:summary>
262 The object path for the device that was added
263 </doc:summary></doc:doc>
264 </arg>
265
266 <doc:doc>
267 <doc:description>
268 <doc:para>
269 Emitted when a device is added.
270 </doc:para>
271 </doc:description>
272 </doc:doc>
273 </signal>
274
275 <!-- ************************************************************ -->
276
277 <signal name="DeviceRemoved">
278 <arg type="o" name="device" direction="out">
279 <doc:doc><doc:summary>
280 The object path for the device that was removed
281 </doc:summary></doc:doc>
282 </arg>
283
284 <doc:doc>
285 <doc:description>
286 <doc:para>
287 Emitted when a device is removed.
288 </doc:para>
289 </doc:description>
290 </doc:doc>
291 </signal>
292
293 <!-- ************************************************************ -->
294
295 <signal name="DeviceChanged">
296 <arg type="o" name="device" direction="out">
297 <doc:doc><doc:summary>
298 The object path for the device that was changed
299 </doc:summary></doc:doc>
300 </arg>
301
302 <doc:doc>
303 <doc:description>
304 <doc:para>
305 Emitted when a device is changed.
306 </doc:para>
307 </doc:description>
308 </doc:doc>
309 </signal>
310
311 <!-- ************************************************************ -->
312
313 <signal name="FlightModeChanged">
314 <arg type="b" name="flight_mode" direction="out">
315 <doc:doc><doc:summary>
316 TRUE if flight mode has been enabled, otherwise FALSE
317 </doc:summary></doc:doc>
318 </arg>
319
320 <doc:doc>
321 <doc:description>
322 <doc:para>
323 Emitted when flight mode is enabled or disabled.
324 </doc:para>
325 </doc:description>
326 </doc:doc>
327 </signal>
328
329 <!-- ************************************************************ -->
330
331 <signal name="UrfkeyPressed">
332 <arg type="i" name="keycode" direction="out">
333 <doc:doc><doc:summary>
334 The keycode emitted from the input device
335 </doc:summary></doc:doc>
336 </arg>
337
338 <doc:doc>
339 <doc:description>
340 <doc:para>
341 Emitted when a rfkill key is pressed. The keycode is defined in
342 &lt;linux/input.h&gt;.
343 </doc:para>
344 <doc:list>
345 <doc:item>
346 <doc:term>237</doc:term><doc:definition>KEY_BLUETOOTH</doc:definition>
347 </doc:item>
348 <doc:item>
349 <doc:term>238</doc:term><doc:definition>KEY_WLAN</doc:definition>
350 </doc:item>
351 <doc:item>
352 <doc:term>239</doc:term><doc:definition>KEY_UWB</doc:definition>
353 </doc:item>
354 <doc:item>
355 <doc:term>246</doc:term><doc:definition>KEY_WIMAX</doc:definition>
356 </doc:item>
357 <doc:item>
358 <doc:term>247</doc:term><doc:definition>KEY_RFKILL</doc:definition>
359 </doc:item>
360 </doc:list>
361 </doc:description>
362 </doc:doc>
363 </signal>
364
365 <!-- ************************************************************ -->
366
367 <property name="DaemonVersion" type="s" access="read">
368 <doc:doc>
369 <doc:description>
370 <doc:para>
371 The version the running daemon. e.g. 0.2.0
372 </doc:para>
373 </doc:description>
374 </doc:doc>
375 </property>
376
377 <property name="KeyControl" type="b" access="read">
378 <doc:doc>
379 <doc:description>
380 <doc:para>
381 Whether the key control is enabled or not
382 </doc:para>
383 </doc:description>
384 </doc:doc>
385 </property>
386
387 </interface>
388</node>
0389
=== modified file 'debian/control'
--- debian/control 2014-10-29 19:46:09 +0000
+++ debian/control 2015-04-01 15:30:55 +0000
@@ -9,22 +9,21 @@
9 g++-4.9,9 g++-4.9,
10 debhelper (>= 9.0.0),10 debhelper (>= 9.0.0),
11 google-mock (>= 1.6.0+svn437),11 google-mock (>= 1.6.0+svn437),
12 dbus-test-runner,
13 libdbus-1-dev,
14 libdbus-cpp-dev (>= 4.1.0),
15 libglib2.0-dev,12 libglib2.0-dev,
16 libnm-glib-dev (>= 0.9),
17 libnm-util-dev (>= 0.9),
18 libnotify-dev,13 libnotify-dev,
19 libprocess-cpp-dev,14#///! TODO: The next line should be removed once all dependancy on qmenumodel is removed
20 libproperties-cpp-dev,
21 libqmenumodel-dev,15 libqmenumodel-dev,
16 libqofono-dev,
17 libqofono-qt5-0,
18#///! TODO: The next line should be replaced with: libqtdbusmock1-dev (>= 0.3),
22 libqtdbusmock1-dev,19 libqtdbusmock1-dev,
23 libqtdbustest1-dev,20 libqtdbustest1-dev,
24 liburl-dispatcher1-dev,21 liburl-dispatcher1-dev,
22 libunity-api-dev,
25 network-manager-dev,23 network-manager-dev,
26 ofono-dev,24 ofono-dev,
27 pkg-config,25 pkg-config,
26#///! TODO: The next line should be replaced with: python3-dbusmock (>= 0.14),
28 python3-dbusmock,27 python3-dbusmock,
29 python3-setuptools,28 python3-setuptools,
30 qt5-default,29 qt5-default,
@@ -69,4 +68,3 @@
69Description: Autopilot tests for the network indicator for Ubuntu68Description: Autopilot tests for the network indicator for Ubuntu
70 The Indicator-network service is responsible for exporting the system settings69 The Indicator-network service is responsible for exporting the system settings
71 menu through dbus. This package contains its autopilot tests.70 menu through dbus. This package contains its autopilot tests.
72
7371
=== added directory 'sniffer'
=== added file 'sniffer/CMakeLists.txt'
--- sniffer/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ sniffer/CMakeLists.txt 2015-04-01 15:30:55 +0000
@@ -0,0 +1,36 @@
1add_executable(i-n-sniffer
2eventprinter.cpp
3eventprinter.h
4i-n-extractor.cpp
5nmaccesspoint.cpp
6nmaccesspoint.h
7nmactiveconnection.cpp
8nmactiveconnection.h
9nmconnsettings.cpp
10nmconnsettings.h
11nmroot.cpp
12nmroot.h
13nmsettings.cpp
14nmsettings.h
15nmwirelessdevice.cpp
16nmwirelessdevice.h
17ofonomodemmodem.cpp
18ofonomodemmodem.h
19ofonomodemnetworkregistration.cpp
20ofonomodemnetworkregistration.h
21ofonomodemsimmanager.cpp
22ofonomodemsimmanager.h
23ofonoroot.cpp
24ofonoroot.h
25urfkillroot.cpp
26urfkillroot.h
27urfkillswitch.cpp
28urfkillswitch.h
29)
30
31qt5_use_modules(i-n-sniffer Core DBus)
32
33install(
34 TARGETS i-n-sniffer
35 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
36)
037
=== added file 'sniffer/eventprinter.h'
--- sniffer/eventprinter.h 1970-01-01 00:00:00 +0000
+++ sniffer/eventprinter.h 2015-04-01 15:30:55 +0000
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Jussi Pakkanen <jussi.pakkanen@canonical.com>
18 */
19
20#pragma once
21
22#include <QObject>
23#include <QDBusVariant>
24
25class UrfkillRoot;
26class UrfkillSwitch;
27class NetworkManagerRoot;
28class OfonoModemModem;
29class OfonoModemSimManager;
30class OfonoModemNetworkRegistration;
31
32class EventPrinter : QObject {
33 Q_OBJECT
34
35public:
36 explicit EventPrinter(QObject *parent = nullptr);
37 ~EventPrinter();
38
39public Q_SLOTS:
40 void flightModeChanged(bool new_mode);
41 void btKillswitchChanged();
42 void wlanKillswitchChanged();
43 void nmStateChanged(uint new_state);
44 void nmPropertiesChanged(const QVariantMap &props);
45 void modem1PropertyChanged(const QString name, const QDBusVariant value);
46 void modem2PropertyChanged(const QString name, const QDBusVariant value);
47 void simman1PropertyChanged(const QString name, const QDBusVariant value);
48 void simman2PropertyChanged(const QString name, const QDBusVariant value);
49 void netreg1PropertyChanged(const QString name, const QDBusVariant value);
50 void netreg2PropertyChanged(const QString name, const QDBusVariant value);
51
52private:
53
54 void modemPropertyChanged(const int modem, const QString &name, const QDBusVariant &value);
55 void simmanPropertyChanged(const int simman, const QString &name, const QDBusVariant &value);
56 void netregPropertyChanged(const int modem, const QString &name, const QDBusVariant &value);
57 void activeConnectionsChanged(const QVariant &list);
58 void primaryConnectionTypeChanged(const QString &type);
59
60 UrfkillRoot *urfkill;
61 UrfkillSwitch *btkill;
62 UrfkillSwitch *wlankill;
63 NetworkManagerRoot *nmroot;
64 OfonoModemModem *modem1;
65 OfonoModemModem *modem2;
66 OfonoModemSimManager *simman1;
67 OfonoModemSimManager *simman2;
68 OfonoModemNetworkRegistration *netreg1;
69 OfonoModemNetworkRegistration *netreg2;
70};
071
=== added file 'sniffer/i-n-extractor.cpp'
--- sniffer/i-n-extractor.cpp 1970-01-01 00:00:00 +0000
+++ sniffer/i-n-extractor.cpp 2015-04-01 15:30:55 +0000
@@ -0,0 +1,152 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Jussi Pakkanen <jussi.pakkanen@canonical.com>
18 */
19
20
21#include <QCoreApplication>
22
23#include "dbusdata.h"
24#include "eventprinter.h"
25#include "nmaccesspoint.h"
26#include "nmactiveconnection.h"
27#include "nmconnsettings.h"
28#include "nmroot.h"
29#include "nmsettings.h"
30#include "nmwirelessdevice.h"
31#include "ofonomodemnetworkregistration.h"
32#include "ofonomodemsimmanager.h"
33#include "ofonoroot.h"
34#include "urfkillroot.h"
35#include "urfkillswitch.h"
36
37static std::map<const int, const char*> nm_active_connection_strings = {{0, "Unknown"}, {1, "Activating"},
38 {2, "Activated"}, {3, "Deactivating"}, {4, "Deactivated"}};
39static std::map<const int, const char*> nm_connectivity_strings = {{0, "Unknown"}, {1, "None"}, {2, "Portal"},
40 {3, "Limited"}, {4, "Full"}};
41static std::map<const int, const char*> nm_state_strings = {{0, "Unknown"}, {10, "Asleep"}, {20, "Disconnected"},
42 {30, "Disconnecting"}, {40, "Connecting"}, {50, "Connected local"}, {60, "Connected site"}, {70, "Connected global"}};
43static std::map<const int, const char*> nm_ap_mode_strings = {{0, "Unknown"}, {1, "Adhoc"}, {2, "Infra"}, {3, "Access point"}};
44
45void print_nm_wlans(NetworkManagerRoot *nmroot) {
46 auto paths = nmroot->activeConnections();
47 for(const auto &path : paths) {
48 NetworkManagerActiveConnection ac(NM_SERVICE, path.path(), QDBusConnection::systemBus(), nullptr);
49 auto devices = ac.devices();
50 // FIXME, should check all but most connections only have one.
51 NetworkManagerWirelessDevice dev(NM_SERVICE, devices[0].path(), QDBusConnection::systemBus(), nullptr);
52 auto reply = dev.GetAccessPoints();
53 reply.waitForFinished();
54 if(reply.isValid()) {
55 // FIXME and the same here.
56 // FIXME also that active access point might not exist
57 NetworkManagerAccessPoint ap(NM_SERVICE, dev.activeAccessPoint().path(), QDBusConnection::systemBus(), nullptr);
58 printf("Connection %s:\n", path.path().toUtf8().data());
59 auto raw_ssid = ap.ssid();
60 std::string ssid(raw_ssid.cbegin(), raw_ssid.cend());
61 printf(" ssid: %s\n", ssid.c_str());
62 printf(" mode: %d (%s)\n", ap.mode(), nm_ap_mode_strings[ap.mode()]);
63 printf(" visible networks:\n");
64 for(const auto &c : reply.value()) {
65 NetworkManagerAccessPoint i(NM_SERVICE, c.path(), QDBusConnection::systemBus(), nullptr);
66 auto i_raw_ssid = i.ssid();
67 std::string i_ssid(i_raw_ssid.cbegin(), i_raw_ssid.cend());
68 printf(" %s %d\n", i_ssid.c_str(), (int)i.strength());
69 }
70 } else {
71 printf("Connection %s is not wireless.\n", path.path().toUtf8().data());
72 }
73 }
74}
75
76void print_info(QCoreApplication &app) {
77 UrfkillRoot *urfkill = new UrfkillRoot(URFKILL_SERVICE, URFKILL_OBJECT,
78 QDBusConnection::systemBus(), &app);
79 UrfkillSwitch *urfkillwlan = new UrfkillSwitch(URFKILL_SERVICE, URFKILL_WLAN_OBJECT,
80 QDBusConnection::systemBus(), &app);
81 UrfkillSwitch *urfkillbt = new UrfkillSwitch(URFKILL_SERVICE, URFKILL_BLUETOOTH_OBJECT,
82 QDBusConnection::systemBus(), &app);
83 UrfkillSwitch *urfkillgps = new UrfkillSwitch(URFKILL_SERVICE, URFKILL_GPS_OBJECT,
84 QDBusConnection::systemBus(), &app);
85 NetworkManagerRoot *nmroot = new NetworkManagerRoot(NM_SERVICE, NM_OBJECT,
86 QDBusConnection::systemBus(), &app);
87 OfonoRoot *ofonoroot = new OfonoRoot(OFONO_SERVICE, OFONO_OBJECT,
88 QDBusConnection::systemBus(), &app);
89
90 printf("Urfkill flightmode: %d\n", urfkill->IsFlightMode().value());
91 printf("Urfkill WLAN killswitch: %d\n", urfkillwlan->state());
92 printf("Urfkill BLUETOOTH killswitch: %d\n", urfkillbt->state());
93 printf("Urfkill GPS killswitch: %d\n", urfkillgps->state());
94 printf("\n");
95 auto nm_connectivity = nmroot->connectivity();
96 printf("NetworkManager connectivity: %d (%s)\n", nm_connectivity, nm_connectivity_strings[nm_connectivity]);
97 auto nm_state = nmroot->state().value();
98 printf("NetworkManager state: %d (%s).\n", nm_state, nm_state_strings[nm_state]);
99 printf("NetworkManager networking enabled: %d\n", nmroot->networkingEnabled());
100 printf("NetworkManager wireless enabled: %d\n", nmroot->wirelessEnabled());
101 printf("NetworkManager wireless hardware enabled: %d\n", nmroot->wirelessHardwareEnabled());
102 print_nm_wlans(nmroot);
103 printf("\n");
104 auto modems = ofonoroot->GetModems().value();
105 printf("Ofono modem count: %d\n", modems.size());
106 for(const auto &m : modems) {
107 OfonoModemSimManager man(OFONO_SERVICE, m.first.path(), QDBusConnection::systemBus(), nullptr);
108 OfonoModemNetworkRegistration netreg(OFONO_SERVICE, m.first.path(), QDBusConnection::systemBus(), nullptr);
109 auto mprops = man.GetProperties().value();
110 auto regprops = netreg.GetProperties().value();
111
112 const auto &props = m.second;
113 printf("Modem %s:\n", m.first.path().toUtf8().data());
114 // For proper usage should check for existance before indexing.
115 printf(" Powered: %d\n", props["Powered"].toBool());
116 printf(" Online: %d\n", props["Online"].toBool());
117 printf(" Model: %s\n", props["Model"].toString().toUtf8().data());
118 printf(" Manufacturer: %s\n", props["Manufacturer"].toString().toUtf8().data());
119 printf(" Pin required: %s\n", mprops["PinRequired"].toString().toUtf8().data());
120 printf(" Status: %s\n", regprops["Status"].toString().toUtf8().data());
121 printf(" Strength: %d\n", regprops["Strength"].toInt());
122 printf(" Operator: %s\n", regprops["Name"].toString().toUtf8().data());
123 }
124}
125
126int run_daemon(QCoreApplication &app) {
127 new EventPrinter(&app);
128 return app.exec();
129}
130
131int main(int argc, char **argv) {
132 QCoreApplication app(argc, argv);
133 qRegisterMetaType<QVariantDictMap>("QVariantDictMap");
134 qDBusRegisterMetaType<QVariantDictMap>();
135 qRegisterMetaType<ModemPropertyList>("ModemPropertyList");
136 qDBusRegisterMetaType<ModemPropertyList>();
137 qDBusRegisterMetaType<QPair<QDBusObjectPath, QVariantMap>>();
138
139 if(argc == 1) {
140 print_info(app);
141 } else if(argc == 2) {
142 static const std::string arg("-d"); // For daemon mode. Feel free to change to something saner.
143 if(argv[1] == arg)
144 return run_daemon(app);
145 printf("Unknown argument.\n");
146 return 1;
147 } else {
148 printf("Too many arguments.\n");
149 return 1;
150 }
151 return 0;
152}
0153
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2015-02-16 18:34:37 +0000
+++ src/CMakeLists.txt 2015-04-01 15:30:55 +0000
@@ -3,10 +3,11 @@
3 set(COMMON_FLAGS "${COMMON_FLAGS} -Werror")3 set(COMMON_FLAGS "${COMMON_FLAGS} -Werror")
4endif()4endif()
55
6add_subdirectory(dbus-cpp)6#add_subdirectory(dbus-cpp)
7add_subdirectory(connectivity-cpp)7#add_subdirectory(connectivity-cpp)
8add_subdirectory(indicator)8add_subdirectory(indicator)
9add_subdirectory(menumodel-cpp)9add_subdirectory(menumodel-cpp)
10add_subdirectory(qdbus-stubs)
10add_subdirectory(notify-cpp)11add_subdirectory(notify-cpp)
11add_subdirectory(secret-agent)12add_subdirectory(secret-agent)
12add_subdirectory(url-dispatcher-cpp)13add_subdirectory(url-dispatcher-cpp)
1314
=== modified file 'src/connectivity-cpp/CMakeLists.txt'
--- src/connectivity-cpp/CMakeLists.txt 2014-08-19 21:13:53 +0000
+++ src/connectivity-cpp/CMakeLists.txt 2015-04-01 15:30:55 +0000
@@ -3,13 +3,11 @@
3set(CONNECTIVITY_CPP_VERSION_MINOR 0)3set(CONNECTIVITY_CPP_VERSION_MINOR 0)
4set(CONNECTIVITY_CPP_VERSION_PATCH 1)4set(CONNECTIVITY_CPP_VERSION_PATCH 1)
55
6include(CTest)6include_directories(
77 "${CMAKE_CURRENT_SOURCE_DIR}/include"
8find_package(PkgConfig REQUIRED)8 "${CMAKE_CURRENT_SOURCE_DIR}/backend"
99 "${CMAKE_CURRENT_BINARY_DIR}/backend"
10include_directories(include)10)
11include_directories(dbus-cpp)
12
13pkg_check_modules(11pkg_check_modules(
14 PROPERTIESCPP REQUIRED12 PROPERTIESCPP REQUIRED
15 properties-cpp13 properties-cpp
@@ -45,15 +43,7 @@
45)43)
46add_custom_target(QtCreatorHeaderHack SOURCES ${CONNECTIVITY_INTERFACES})44add_custom_target(QtCreatorHeaderHack SOURCES ${CONNECTIVITY_INTERFACES})
4745
48# list these here to have them visible in Qt Creator
49set(DBUS_INTERFACES
50 dbus-cpp/services/nm.h
51 dbus-cpp/services/ofono.h
52 dbus-cpp/services/urfkill.h
53)
54add_custom_target(QtCreatorHeaderHack2 SOURCES ${DBUS_INTERFACES})
55
56add_subdirectory(data)46add_subdirectory(data)
57#add_subdirectory(doc)47#add_subdirectory(doc)
58add_subdirectory(examples)48#add_subdirectory(examples)
59add_subdirectory(src)49add_subdirectory(src)
6050
=== removed directory 'src/connectivity-cpp/dbus-cpp'
=== removed directory 'src/connectivity-cpp/dbus-cpp/services'
=== removed file 'src/connectivity-cpp/dbus-cpp/services/nm.h'
--- src/connectivity-cpp/dbus-cpp/services/nm.h 2014-10-31 13:50:05 +0000
+++ src/connectivity-cpp/dbus-cpp/services/nm.h 1970-01-01 00:00:00 +0000
@@ -1,979 +0,0 @@
1/*
2 * Copyright © 2012-2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
17 */
18#ifndef PLATFORM_MANAGER_NMOFONO_NM_H
19#define PLATFORM_MANAGER_NMOFONO_NM_H
20
21#include <core/dbus/bus.h>
22#include <core/dbus/object.h>
23#include <core/dbus/property.h>
24#include <core/dbus/service.h>
25#include <core/dbus/types/object_path.h>
26#include <core/dbus/types/any.h>
27#include <core/dbus/types/struct.h>
28#include <core/dbus/types/stl/map.h>
29#include <core/dbus/types/stl/string.h>
30#include <core/dbus/types/stl/tuple.h>
31#include <core/dbus/types/stl/vector.h>
32#include <NetworkManager/NetworkManager.h>
33#include "util.h"
34
35namespace org
36{
37namespace freedesktop
38{
39namespace NetworkManager
40{
41 struct Interface {
42
43 struct AccessPoint
44 {
45 static const std::string& name()
46 {
47 static const std::string s{NM_DBUS_INTERFACE_ACCESS_POINT};
48 return s;
49 }
50
51 struct Property {
52 struct Frequency
53 {
54 static const std::string& name()
55 {
56 static const std::string s{"Frequency"};
57 return s;
58 }
59
60 typedef AccessPoint Interface;
61 typedef std::uint32_t ValueType;
62 static const bool readable = true;
63 static const bool writable = false;
64 };
65
66 struct Flags
67 {
68 static const std::string& name()
69 {
70 static const std::string s{"Flags"};
71 return s;
72 }
73
74 typedef AccessPoint Interface;
75 typedef std::uint32_t ValueType;
76 static const bool readable = true;
77 static const bool writable = false;
78 };
79
80 struct WpaFlags
81 {
82 static const std::string& name()
83 {
84 static const std::string s{"WpaFlags"};
85 return s;
86 }
87
88 typedef AccessPoint Interface;
89 typedef std::uint32_t ValueType;
90 static const bool readable = true;
91 static const bool writable = false;
92 };
93
94 struct RsnFlags
95 {
96 static const std::string& name()
97 {
98 static const std::string s{"RsnFlags"};
99 return s;
100 }
101
102 typedef AccessPoint Interface;
103 typedef std::uint32_t ValueType;
104 static const bool readable = true;
105 static const bool writable = false;
106 };
107
108 struct Mode
109 {
110 static const std::string& name()
111 {
112 static const std::string s{"Mode"};
113 return s;
114 }
115
116 typedef AccessPoint Interface;
117 typedef std::uint32_t ValueType;
118 static const bool readable = true;
119 static const bool writable = false;
120 };
121
122 struct Ssid
123 {
124 static const std::string& name()
125 {
126 static const std::string s{"Ssid"};
127 return s;
128 }
129
130 typedef AccessPoint Interface;
131 /// @todo bug tvoss.. D-Bus BYTE(y) should be unsigned
132 typedef std::vector<std::int8_t> ValueType;
133 static const bool readable = true;
134 static const bool writable = false;
135 };
136
137 struct HwAddress
138 {
139 static const std::string& name()
140 {
141 static const std::string s{"HwAddress"};
142 return s;
143 }
144
145 typedef AccessPoint Interface;
146 typedef std::string ValueType;
147 static const bool readable = true;
148 static const bool writable = false;
149 };
150
151 struct Strength
152 {
153 static const std::string& name()
154 {
155 static const std::string s{"Strength"};
156 return s;
157 }
158
159 typedef AccessPoint Interface;
160 typedef std::int8_t ValueType;
161 static const bool readable = true;
162 static const bool writable = false;
163 };
164 };
165
166 struct Signal {
167 struct PropertiesChanged
168 {
169 static const std::string& name()
170 {
171 static const std::string s{"PropertiesChanged"};
172 return s;
173 }
174
175 typedef AccessPoint Interface;
176 typedef std::map<std::string, core::dbus::types::Variant> ArgumentType;
177 };
178 };
179
180 AccessPoint(const std::shared_ptr<core::dbus::Object>& object)
181 : object(object),
182 frequency(object->get_property<Property::Frequency>()),
183 hw_address(object->get_property<Property::HwAddress>()),
184 strength(object->get_property<Property::Strength>()),
185 flags(object->get_property<Property::Flags>()),
186 wpa_flags(object->get_property<Property::WpaFlags>()),
187 rsn_flags(object->get_property<Property::RsnFlags>()),
188 mode(object->get_property<Property::Mode>()),
189 ssid(object->get_property<Property::Ssid>()),
190 properties_changed(object->get_signal<Signal::PropertiesChanged>())
191
192 {}
193
194 std::shared_ptr<core::dbus::Object> object;
195 std::shared_ptr<core::dbus::Property<Property::Frequency>> frequency;
196 std::shared_ptr<core::dbus::Property<Property::HwAddress>> hw_address;
197 std::shared_ptr<core::dbus::Property<Property::Strength>> strength;
198 std::shared_ptr<core::dbus::Property<Property::Flags>> flags;
199 std::shared_ptr<core::dbus::Property<Property::WpaFlags>> wpa_flags;
200 std::shared_ptr<core::dbus::Property<Property::RsnFlags>> rsn_flags;
201 std::shared_ptr<core::dbus::Property<Property::Mode>> mode;
202 std::shared_ptr<core::dbus::Property<Property::Ssid>> ssid;
203 std::shared_ptr<core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>> properties_changed;
204 }; // Interface::AccessPoint
205
206
207 struct ActiveConnection
208 {
209 static const std::string& name()
210 {
211 static const std::string s{NM_DBUS_INTERFACE_ACTIVE_CONNECTION};
212 return s;
213 }
214
215 struct Property {
216 struct Connection
217 {
218 static const std::string& name()
219 {
220 static const std::string s{"Connection"};
221 return s;
222 }
223
224 typedef ActiveConnection Interface;
225 typedef core::dbus::types::ObjectPath ValueType;
226 static const bool readable = true;
227 static const bool writable = false;
228 };
229 struct SpecificObject
230 {
231 static const std::string& name()
232 {
233 static const std::string s{"SpecificObject"};
234 return s;
235 }
236
237 typedef ActiveConnection Interface;
238 typedef core::dbus::types::ObjectPath ValueType;
239 static const bool readable = true;
240 static const bool writable = false;
241 };
242 struct Uuid
243 {
244 static const std::string& name()
245 {
246 static const std::string s{"Uuid"};
247 return s;
248 }
249
250 typedef ActiveConnection Interface;
251 typedef std::string ValueType;
252 static const bool readable = true;
253 static const bool writable = false;
254 };
255 struct Devices
256 {
257 static const std::string& name()
258 {
259 static const std::string s{"Devices"};
260 return s;
261 }
262
263 typedef ActiveConnection Interface;
264 typedef std::vector<core::dbus::types::ObjectPath> ValueType;
265 static const bool readable = true;
266 static const bool writable = false;
267 };
268 struct State
269 {
270 static const std::string& name()
271 {
272 static const std::string s{"State"};
273 return s;
274 }
275
276 typedef ActiveConnection Interface;
277 typedef std::uint32_t ValueType;
278 static const bool readable = true;
279 static const bool writable = false;
280 };
281 struct Default
282 {
283 static const std::string& name()
284 {
285 static const std::string s{"Default"};
286 return s;
287 }
288
289 typedef ActiveConnection Interface;
290 typedef bool ValueType;
291 static const bool readable = true;
292 static const bool writable = false;
293 };
294 struct Default6
295 {
296 static const std::string& name()
297 {
298 static const std::string s{"Default6"};
299 return s;
300 }
301
302 typedef ActiveConnection Interface;
303 typedef bool ValueType;
304 static const bool readable = true;
305 static const bool writable = false;
306 };
307 struct Vpn
308 {
309 static const std::string& name()
310 {
311 static const std::string s{"Vpn"};
312 return s;
313 }
314
315 typedef ActiveConnection Interface;
316 typedef bool ValueType;
317 static const bool readable = true;
318 static const bool writable = false;
319 };
320 struct Master
321 {
322 static const std::string& name()
323 {
324 static const std::string s{"Master"};
325 return s;
326 }
327
328 typedef ActiveConnection Interface;
329 typedef bool ValueType;
330 static const bool readable = true;
331 static const bool writable = false;
332 };
333 }; // struct Property
334
335 struct Signal {
336 struct PropertiesChanged
337 {
338 static const std::string& name()
339 {
340 static const std::string s{"PropertiesChanged"};
341 return s;
342 }
343
344 typedef ActiveConnection Interface;
345 typedef std::map<std::string, core::dbus::types::Variant> ArgumentType;
346 };
347 };
348
349 enum class State
350 {
351 unknown = NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
352 activating = NM_ACTIVE_CONNECTION_STATE_ACTIVATING,
353 activated = NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
354 deactivating = NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
355 deactivated = NM_ACTIVE_CONNECTION_STATE_DEACTIVATED
356 };
357
358 ActiveConnection(const std::shared_ptr<core::dbus::Object>& object)
359 : object(object),
360 connection(object->get_property<Property::Connection>()),
361 specific_object(object->get_property<Property::SpecificObject>()),
362 uuid(object->get_property<Property::Uuid>()),
363 devices(object->get_property<Property::Devices>()),
364 state(object->get_property<Property::State>()),
365 default_ipv4(object->get_property<Property::Default>()),
366 default_ipv6(object->get_property<Property::Default6>()),
367 vpn(object->get_property<Property::Vpn>()),
368 master(object->get_property<Property::Master>()),
369 properties_changed(object->get_signal<Signal::PropertiesChanged>())
370 {
371 token = properties_changed->connect([this](const Signal::PropertiesChanged::ArgumentType &map){
372 for (auto entry: map) {
373 if (entry.first == "State") {
374#if 0
375 std::uint32_t new_value = entry.second.as<std::uint32_t>();
376 state->update([&new_value](std::uint32_t &current_value){
377 if (new_value == current_value)
378 return false;
379 current_value = new_value;
380 return true;
381 });
382#endif
383 continue;
384 }
385 else {
386#ifdef INDICATOR_NETWORK_TRACE_MESSAGES
387 std::cout << "Unexpected Connection.Active update: " << entry.first << std::endl;
388#endif
389 }
390 }
391 });
392 }
393 ~ActiveConnection()
394 {
395 /// @todo fix dbus-cpp...
396 //properties_changed->disconnect(token);
397 }
398
399 State get_state() { return static_cast<State>(state->get()); }
400
401 std::shared_ptr<core::dbus::Object> object;
402 std::shared_ptr<core::dbus::Property<Property::Connection>> connection;
403 std::shared_ptr<core::dbus::Property<Property::SpecificObject>> specific_object;
404 std::shared_ptr<core::dbus::Property<Property::Uuid>> uuid;
405 std::shared_ptr<core::dbus::Property<Property::Devices>> devices;
406 std::shared_ptr<core::dbus::Property<Property::State>> state;
407 std::shared_ptr<core::dbus::Property<Property::Default>> default_ipv4;
408 std::shared_ptr<core::dbus::Property<Property::Default6>> default_ipv6;
409 std::shared_ptr<core::dbus::Property<Property::Vpn>> vpn;
410 std::shared_ptr<core::dbus::Property<Property::Master>> master;
411
412 private:
413 std::shared_ptr<core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>> properties_changed;
414 core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>::SubscriptionToken token;
415 }; // Interface::ActiveConnection
416
417 struct Connection
418 {
419 std::shared_ptr<core::dbus::Object> object;
420
421 Connection(const std::shared_ptr<core::dbus::Object>& object)
422 : object(object)
423 {}
424
425 static const std::string& name()
426 {
427 static const std::string s{NM_DBUS_IFACE_SETTINGS_CONNECTION};
428 return s;
429 }
430
431 struct Method {
432 struct GetSettings
433 {
434 static const std::string& name()
435 {
436 static const std::string s{"GetSettings"};
437 return s;
438 }
439
440 typedef Connection Interface;
441 typedef std::map<std::string, std::map<std::string, core::dbus::types::Variant>> ResultType;
442
443 static std::chrono::milliseconds default_timeout()
444 {
445 return std::chrono::seconds{30};
446 }
447 };
448 };
449
450 Method::GetSettings::ResultType
451 get_settings()
452 {
453
454 auto result = object->invoke_method_synchronously<Method::GetSettings, Method::GetSettings::ResultType>();
455
456 if (result.is_error())
457 connectivity::throw_dbus_exception(result.error());
458
459 return result.value();
460 }
461 }; // Interface::Connection
462
463 struct Device
464 {
465 static const std::string& name()
466 {
467 static const std::string s{NM_DBUS_INTERFACE_DEVICE};
468 return s;
469 }
470
471 enum class Type
472 {
473 unknown = NM_DEVICE_TYPE_UNKNOWN,
474 ethernet = NM_DEVICE_TYPE_ETHERNET,
475 wifi = NM_DEVICE_TYPE_WIFI,
476 unused_1 = NM_DEVICE_TYPE_UNUSED1,
477 unused_2 = NM_DEVICE_TYPE_UNUSED2,
478 bluetooth = NM_DEVICE_TYPE_BT,
479 olpc_mesh = NM_DEVICE_TYPE_OLPC_MESH,
480 wimax = NM_DEVICE_TYPE_WIMAX,
481 modem = NM_DEVICE_TYPE_MODEM,
482 infiniband = NM_DEVICE_TYPE_INFINIBAND,
483 bond = NM_DEVICE_TYPE_BOND,
484 vlan = NM_DEVICE_TYPE_VLAN,
485 adsl = NM_DEVICE_TYPE_ADSL,
486 bridge = NM_DEVICE_TYPE_BRIDGE
487 };
488
489 struct Wireless
490 {
491 static const std::string& name()
492 {
493 static const std::string s{NM_DBUS_INTERFACE_DEVICE_WIRELESS};
494 return s;
495 }
496
497 struct Method {
498 struct GetAccessPoints
499 {
500 static const std::string& name()
501 {
502 static const std::string s{"GetAccessPoints"};
503 return s;
504 }
505
506 typedef Wireless Interface;
507 typedef std::vector<core::dbus::types::ObjectPath> ResultType;
508
509 static std::chrono::milliseconds default_timeout()
510 {
511 return std::chrono::seconds{30};
512 }
513 };
514 };
515
516 struct Signal {
517 struct AccessPointAdded
518 {
519 static const std::string& name()
520 {
521 static const std::string s{"AccessPointAdded"};
522 return s;
523 }
524
525 typedef Wireless Interface;
526 typedef core::dbus::types::ObjectPath ArgumentType;
527 };
528
529 struct AccessPointRemoved
530 {
531 static const std::string& name()
532 {
533 static const std::string s{"AccessPointRemoved"};
534 return s;
535 }
536
537 typedef Wireless Interface;
538 typedef core::dbus::types::ObjectPath ArgumentType;
539 };
540 };
541
542 Wireless(std::shared_ptr<core::dbus::Object> &base)
543 : access_point_added(base->get_signal<Signal::AccessPointAdded>()),
544 access_point_removed(base->get_signal<Signal::AccessPointRemoved>())
545 {}
546
547 std::shared_ptr<core::dbus::Signal<Signal::AccessPointAdded, Signal::AccessPointAdded::ArgumentType>> access_point_added;
548 std::shared_ptr<core::dbus::Signal<Signal::AccessPointRemoved, Signal::AccessPointRemoved::ArgumentType>> access_point_removed;
549
550 }; // Interface::Device::Wireless
551
552 struct Property {
553 struct DeviceType
554 {
555 static const std::string& name()
556 {
557 static const std::string s{"DeviceType"};
558 return s;
559 }
560
561 typedef Device Interface;
562 typedef std::uint32_t ValueType;
563 static const bool readable = true;
564 static const bool writable = false;
565 };
566
567 struct DeviceInterface {
568 static const std::string& name()
569 {
570 static const std::string s{"Interface"};
571 return s;
572 }
573
574 typedef Device Interface;
575 typedef std::string ValueType;
576 static const bool readable = true;
577 static const bool writable = false;
578 };
579
580 struct Autoconnect
581 {
582 static const std::string& name()
583 {
584 static const std::string s{"Autoconnect"};
585 return s;
586 }
587
588 typedef Device Interface;
589 typedef bool ValueType;
590 static const bool readable = true;
591 static const bool writable = true;
592 };
593
594 struct State {
595 static const std::string &name()
596 {
597 static const std::string s{"State"};
598 return s;
599 }
600
601 typedef Device Interface;
602 typedef std::uint32_t ValueType;
603 static const bool readable = true;
604 static const bool writable = false;
605 };
606
607 struct AvailableConnections {
608 static const std::string &name()
609 {
610 static const std::string s{"AvailableConnections"};
611 return s;
612 }
613
614 typedef Device Interface;
615 typedef std::vector<core::dbus::types::ObjectPath> ValueType;
616 static const bool readable = true;
617 static const bool writable = false;
618 };
619
620 struct ActiveConnection {
621 static const std::string &name()
622 {
623 static const std::string s{"ActiveConnection"};
624 return s;
625 }
626
627 typedef Device Interface;
628 typedef core::dbus::types::ObjectPath ValueType;
629 static const bool readable = true;
630 static const bool writable = false;
631 };
632 };
633
634 std::vector<Connection>
635 get_available_connections() {
636 std::vector<Connection> list;
637 for (auto c: available_connections->get()) {
638 list.push_back(Connection(service->object_for_path(c)));
639 }
640 return list;
641 }
642
643 struct Method {
644
645 struct Disconnect
646 {
647 static const std::string& name()
648 {
649 static const std::string s{"Disconnect"};
650 return s;
651 }
652
653 typedef Device Interface;
654 typedef void ResultType;
655
656 static std::chrono::milliseconds default_timeout()
657 {
658 return std::chrono::seconds{30};
659 }
660 };
661 };
662
663 void disconnect()
664 {
665 auto result =
666 object->invoke_method_synchronously<
667 Device::Method::Disconnect, Device::Method::Disconnect::ResultType>();
668
669 if (result.is_error())
670 connectivity::throw_dbus_exception(result.error());
671 }
672
673 struct Signal {
674 struct StateChanged
675 {
676 static const std::string& name()
677 {
678 static const std::string s{"StateChanged"};
679 return s;
680 }
681
682 typedef Device Interface;
683 typedef std::tuple<std::uint32_t, std::uint32_t, std::uint32_t> ArgumentType;
684 };
685 };
686
687
688 Type type() const
689 {
690 return static_cast<Type>(device_type->get());
691 }
692
693 std::string interface() const
694 {
695 return device_interface->get();
696 }
697
698 Wireless::Method::GetAccessPoints::ResultType get_access_points() const
699 {
700 auto result = object->invoke_method_synchronously<Wireless::Method::GetAccessPoints,
701 Wireless::Method::GetAccessPoints::ResultType>();
702
703 if (result.is_error())
704 connectivity::throw_dbus_exception(result.error());
705
706 return result.value();
707 }
708
709 Device(const std::shared_ptr<core::dbus::Service>& service,
710 const std::shared_ptr<core::dbus::Object>& object)
711 : service(service),
712 object(object),
713 device_type(object->get_property<Property::DeviceType>()),
714 autoconnect(object->get_property<Property::Autoconnect>()),
715 device_interface(object->get_property<Property::DeviceInterface>()),
716 state(object->get_property<Property::State>()),
717 state_changed(object->get_signal<Signal::StateChanged>()),
718 available_connections(object->get_property<Property::AvailableConnections>()),
719 active_connection(object->get_property<Property::ActiveConnection>())
720 {}
721
722 std::shared_ptr<core::dbus::Service> service;
723 std::shared_ptr<core::dbus::Object> object;
724 std::shared_ptr<core::dbus::Property<Property::DeviceType>> device_type;
725 std::shared_ptr<core::dbus::Property<Property::Autoconnect>> autoconnect;
726 std::shared_ptr<core::dbus::Property<Property::DeviceInterface>> device_interface;
727 std::shared_ptr<core::dbus::Property<Property::State>> state;
728 std::shared_ptr<core::dbus::Signal<Signal::StateChanged, Signal::StateChanged::ArgumentType>> state_changed;
729 std::shared_ptr<core::dbus::Property<Property::AvailableConnections>> available_connections;
730 std::shared_ptr<core::dbus::Property<Property::ActiveConnection>> active_connection;
731 }; // Interface::Device
732
733 struct NetworkManager
734 {
735 static const std::string& name()
736 {
737 static const std::string s{NM_DBUS_INTERFACE};
738 return s;
739 }
740
741 struct Method {
742 struct ActivateConnection
743 {
744 static const std::string& name()
745 {
746 static const std::string s{"ActivateConnection"};
747 return s;
748 }
749
750 typedef NetworkManager Interface;
751 typedef core::dbus::types::ObjectPath ResultType;
752
753 static std::chrono::milliseconds default_timeout()
754 {
755 return std::chrono::seconds{30};
756 }
757 };
758
759 struct AddAndActivateConnection
760 {
761 static const std::string& name()
762 {
763 static const std::string s{"AddAndActivateConnection"};
764 return s;
765 }
766
767 typedef NetworkManager Interface;
768 typedef std::tuple<core::dbus::types::ObjectPath, core::dbus::types::ObjectPath> ResultType;
769
770 static std::chrono::milliseconds default_timeout()
771 {
772 return std::chrono::seconds{30};
773 }
774 };
775
776 struct GetDevices
777 {
778 static const std::string& name()
779 {
780 static const std::string s{"GetDevices"};
781 return s;
782 }
783
784 typedef NetworkManager Interface;
785 typedef std::vector<core::dbus::types::ObjectPath> ResultType;
786
787 static std::chrono::milliseconds default_timeout()
788 {
789 return std::chrono::seconds{30};
790 }
791 };
792
793 };
794
795
796 struct Property
797 {
798 struct WirelessEnabled {
799 static const std::string &name()
800 {
801 static const std::string s{"WirelessEnabled"};
802 return s;
803 }
804
805 typedef NetworkManager Interface;
806 typedef bool ValueType;
807 static const bool readable = true;
808 static const bool writable = true;
809 };
810
811 struct State {
812 static const std::string &name()
813 {
814 static const std::string s{"State"};
815 return s;
816 }
817
818 typedef NetworkManager Interface;
819 typedef std::uint32_t ValueType;
820 static const bool readable = true;
821 static const bool writable = false;
822 };
823
824 struct PrimaryConnection {
825 static const std::string &name()
826 {
827 static const std::string s{"PrimaryConnection"};
828 return s;
829 }
830
831 typedef NetworkManager Interface;
832 typedef core::dbus::types::ObjectPath ValueType;
833 static const bool readable = true;
834 static const bool writable = false;
835 };
836
837 };
838
839 struct Signal {
840
841 struct PropertiesChanged
842 {
843 static const std::string& name()
844 {
845 static const std::string s{"PropertiesChanged"};
846 return s;
847 }
848
849 typedef NetworkManager Interface;
850 typedef std::map<std::string, core::dbus::types::Variant> ArgumentType;
851 };
852
853 struct DeviceAdded
854 {
855 static const std::string& name()
856 {
857 static const std::string s{"DeviceAdded"};
858 return s;
859 }
860
861 typedef NetworkManager Interface;
862 typedef core::dbus::types::ObjectPath ArgumentType;
863 };
864
865 struct DeviceRemoved
866 {
867 static const std::string& name()
868 {
869 static const std::string s{"DeviceRemoved"};
870 return s;
871 }
872
873 typedef NetworkManager Interface;
874 typedef core::dbus::types::ObjectPath ArgumentType;
875 };
876 };
877
878 Method::ActivateConnection::ResultType
879 activate_connection(const core::dbus::types::ObjectPath &connection,
880 const core::dbus::types::ObjectPath &device,
881 const core::dbus::types::ObjectPath &specific_object)
882 {
883 auto result =
884 object->invoke_method_synchronously<
885 Method::ActivateConnection,
886 Method::ActivateConnection::ResultType>
887 (connection, device, specific_object);
888
889 if (result.is_error())
890 connectivity::throw_dbus_exception(result.error());
891
892 return result.value();
893 }
894
895 Method::AddAndActivateConnection::ResultType
896 add_and_activate_connection(std::map<std::string, std::map<std::string, core::dbus::types::Variant>> &connection,
897 const core::dbus::types::ObjectPath &device,
898 const core::dbus::types::ObjectPath &specific_object)
899 {
900 auto result =
901 object->invoke_method_synchronously<
902 Method::AddAndActivateConnection,
903 Method::AddAndActivateConnection::ResultType>
904 (connection, device, specific_object);
905
906 if (result.is_error())
907 connectivity::throw_dbus_exception(result.error());
908
909
910 /// @todo return the settings (std::get<0>) object at some point
911 return result.value();
912 }
913
914 std::vector<core::dbus::types::ObjectPath> get_devices()
915 {
916 auto result =
917 object->invoke_method_synchronously<
918 Method::GetDevices,
919 Method::GetDevices::ResultType>();
920
921 if (result.is_error())
922 connectivity::throw_dbus_exception(result.error());
923
924 return result.value();
925 }
926
927 NetworkManager(std::shared_ptr<core::dbus::Service> &service,
928 std::shared_ptr<core::dbus::Object> &object)
929 : service(service),
930 object(object),
931 wireless_enabled(object->get_property<Property::WirelessEnabled>()),
932 state(object->get_property<Property::State>()),
933 properties_changed(object->get_signal<Signal::PropertiesChanged>()),
934 primary_connection(object->get_property<Property::PrimaryConnection>()),
935 device_added(object->get_signal<Signal::DeviceAdded>()),
936 device_removed(object->get_signal<Signal::DeviceRemoved>())
937 {
938 }
939
940 std::shared_ptr<core::dbus::Service> service;
941 std::shared_ptr<core::dbus::Object> object;
942
943 std::shared_ptr<core::dbus::Property<Property::WirelessEnabled>> wireless_enabled;
944 std::shared_ptr<core::dbus::Property<Property::State>> state;
945 std::shared_ptr<core::dbus::Signal<Signal::PropertiesChanged, Signal::PropertiesChanged::ArgumentType>> properties_changed;
946 std::shared_ptr<core::dbus::Property<Property::PrimaryConnection>> primary_connection;
947 std::shared_ptr<core::dbus::Signal<Signal::DeviceAdded, Signal::DeviceAdded::ArgumentType>> device_added;
948 std::shared_ptr<core::dbus::Signal<Signal::DeviceRemoved, Signal::DeviceRemoved::ArgumentType>> device_removed;
949 }; // Interface::NetworkManager
950 };
951
952 struct Service
953 {
954 std::shared_ptr<Interface::NetworkManager> nm;
955
956 Service(const core::dbus::Bus::Ptr& bus)
957 {
958 auto service = core::dbus::Service::use_service<Interface::NetworkManager>(bus);
959 auto object = service->object_for_path(core::dbus::types::ObjectPath(NM_DBUS_PATH));
960 nm = std::make_shared<Interface::NetworkManager>(service, object);
961 }
962
963 struct Mock
964 {
965 std::shared_ptr<Interface::NetworkManager> nm;
966
967 Mock(const core::dbus::Bus::Ptr& bus)
968 {
969 auto service = core::dbus::Service::add_service<Interface::NetworkManager>(bus);
970 auto object = service->add_object_for_path(core::dbus::types::ObjectPath(NM_DBUS_PATH));
971 nm = std::make_shared<Interface::NetworkManager>(service, object);
972 }
973 };
974 };
975}
976}
977}
978
979#endif // PLATFORM_MANAGER_NMOFONO_NM_H
9800
=== removed file 'src/connectivity-cpp/dbus-cpp/services/ofono.h'
--- src/connectivity-cpp/dbus-cpp/services/ofono.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/dbus-cpp/services/ofono.h 1970-01-01 00:00:00 +0000
@@ -1,339 +0,0 @@
1/*
2 * Copyright © 2012-2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */
18#ifndef LOCATION_SERVICE_LOCATION_CONNECTIVITY_OFONO_H
19#define LOCATION_SERVICE_LOCATION_CONNECTIVITY_OFONO_H
20
21#include <core/dbus/bus.h>
22#include <core/dbus/object.h>
23#include <core/dbus/property.h>
24#include <core/dbus/service.h>
25#include <core/dbus/types/object_path.h>
26#include <core/dbus/types/struct.h>
27#include <core/dbus/types/stl/map.h>
28#include <core/dbus/types/stl/string.h>
29#include <core/dbus/types/stl/tuple.h>
30#include <core/dbus/types/stl/vector.h>
31#include<com/ubuntu/connectivity/util.h>
32
33namespace org
34{
35struct Ofono
36{
37static const std::string& name()
38{
39 static const std::string s{"org.ofono"};
40 return s;
41}
42struct Manager
43{
44 static const std::string& name()
45 {
46 static const std::string s{"org.ofono.Manager"};
47 return s;
48 }
49
50 struct GetModems
51 {
52 static const std::string& name()
53 {
54 static const std::string s{"GetModems"};
55 return s;
56 }
57
58 typedef Manager Interface;
59 typedef std::vector<
60 core::dbus::types::Struct<
61 core::dbus::types::ObjectPath
62 >
63 > ResultType;
64
65 static std::chrono::milliseconds default_timeout()
66 {
67 return std::chrono::seconds{1};
68 }
69 };
70
71 struct ModemAdded
72 {
73 static const std::string& name()
74 {
75 static const std::string s{"ModemAdded"};
76 return s;
77 }
78
79 typedef Manager Interface;
80 typedef std::tuple<core::dbus::types::ObjectPath, std::map<std::string, std::string>> ArgumentType;
81 };
82
83 struct ModemRemoved
84 {
85 static const std::string& name()
86 {
87 static const std::string s{"ModemRemoved"};
88 return s;
89 }
90
91 typedef Manager Interface;
92 typedef core::dbus::types::ObjectPath ArgumentType;
93 };
94
95 struct Modem
96 {
97 struct NetworkRegistration
98 {
99 static const std::string& name()
100 {
101 static const std::string s{"org.ofono.NetworkRegistration"};
102 return s;
103 }
104
105 struct GetProperties
106 {
107 static const std::string& name()
108 {
109 static const std::string s{"GetProperties"};
110 return s;
111 }
112
113 typedef NetworkRegistration Interface;
114 typedef std::map<std::string, core::dbus::types::Variant<>> ValueType;
115
116 static std::chrono::milliseconds default_timeout()
117 {
118 return std::chrono::seconds{1};
119 }
120 };
121
122 struct Mode
123 {
124 static const char* unregistered() { return "unregistered"; }
125 static const char* registered() { return "registered"; }
126 static const char* searching() { return "searching"; }
127 static const char* denied() { return "denied"; }
128 static const char* unknown() { return "unknown"; }
129 static const char* roaming() { return "roaming"; }
130
131 static const std::string& name()
132 {
133 static const std::string s{"Mode"};
134 return s;
135 }
136
137 typedef NetworkRegistration Interface;
138 typedef std::string ValueType;
139 static const bool readable = true;
140 static const bool writable = false;
141 };
142
143 struct LocationAreaCode
144 {
145 static const std::string& name()
146 {
147 static const std::string s{"LocationAreaCode"};
148 return s;
149 }
150
151 typedef NetworkRegistration Interface;
152 typedef std::uint16_t ValueType;
153 static const bool readable = true;
154 static const bool writable = false;
155 };
156
157 struct CellId
158 {
159 static const std::string& name()
160 {
161 static const std::string s{"CellId"};
162 return s;
163 }
164
165 typedef NetworkRegistration Interface;
166 typedef std::uint32_t ValueType;
167 static const bool readable = true;
168 static const bool writable = false;
169 };
170
171 struct MobileCountryCode
172 {
173 static const std::string& name()
174 {
175 static const std::string s{"MobileCountryCode"};
176 return s;
177 }
178
179 typedef NetworkRegistration Interface;
180 typedef std::string ValueType;
181 static const bool readable = true;
182 static const bool writable = false;
183 };
184
185 struct MobileNetworkCode
186 {
187 static const std::string& name()
188 {
189 static const std::string s{"MobileNetworkCode"};
190 return s;
191 }
192
193 typedef NetworkRegistration Interface;
194 typedef std::string ValueType;
195 static const bool readable = true;
196 static const bool writable = false;
197 };
198
199 struct Technology
200 {
201 static const char* gsm() { return "gsm"; }
202 static const char* edge() { return "edge"; }
203 static const char* umts() { return "umts"; }
204 static const char* hspa() { return "hspa"; }
205 static const char* lte() { return "lte"; }
206
207 static const std::string& name()
208 {
209 static const std::string s{"Technology"};
210 return s;
211 }
212
213 typedef NetworkRegistration Interface;
214 typedef std::string ValueType;
215 static const bool readable = true;
216 static const bool writable = false;
217 };
218
219 struct Strength
220 {
221 static const std::string& name()
222 {
223 static const std::string s{"Strength"};
224 return s;
225 }
226
227 typedef NetworkRegistration Interface;
228 typedef std::int8_t ValueType;
229 static const bool readable = true;
230 static const bool writable = false;
231 };
232
233 NetworkRegistration(const std::shared_ptr<core::dbus::Object>& object)
234 : object(object),
235 properties{}
236 {
237 auto result = object->invoke_method_synchronously<GetProperties, GetProperties::ValueType>();
238 if (result.is_error())
239 connectivity::throw_dbus_exception(result.error());
240
241 properties = result.value();
242 }
243
244 template<typename Property>
245 typename Property::ValueType get(
246 const typename Property::ValueType& default_value = typename Property::ValueType{}) const
247 {
248 try
249 {
250 core::dbus::types::Any value = properties.at(Property::name()).get();
251 typename Property::ValueType result; value.reader() >> result;
252
253 return result;
254 } catch(...)
255 {
256 }
257
258 return default_value;
259 }
260
261 std::shared_ptr<core::dbus::Object> object;
262 GetProperties::ValueType properties;
263 };
264
265 Modem(const std::shared_ptr<core::dbus::Service>& service,
266 const std::shared_ptr<core::dbus::Object>& object)
267 : service(service),
268 object(object),
269 network_registration{object}
270 {
271 }
272
273 std::shared_ptr<core::dbus::Service> service;
274 std::shared_ptr<core::dbus::Object> object;
275 NetworkRegistration network_registration;
276 };
277
278 Manager(const core::dbus::Bus::Ptr& bus)
279 : service(core::dbus::Service::use_service<org::Ofono>(bus)),
280 object(service->object_for_path(core::dbus::types::ObjectPath("/"))),
281 modem_added(object->get_signal<ModemAdded>()),
282 modem_removed(object->get_signal<ModemRemoved>())
283 {
284 auto result = object->invoke_method_synchronously<GetModems, GetModems::ResultType>();
285
286 if (result.is_error())
287 connectivity::throw_dbus_exception(result.error());
288
289 for (const auto& element : result.value())
290 {
291 modems.insert(
292 std::make_pair(
293 element.value,
294 Modem
295 {
296 service,
297 service->object_for_path(element.value)
298 }));
299 }
300
301 modem_added->connect([this](const ModemAdded::ArgumentType& arg)
302 {
303 std::lock_guard<std::mutex> lg(guard);
304 modems.insert(
305 std::make_pair(
306 std::get<0>(arg),
307 Modem{
308 service,
309 service->object_for_path(std::get<0>(arg))
310 }));
311 });
312
313 modem_removed->connect([this](const ModemRemoved::ArgumentType& arg)
314 {
315 std::lock_guard<std::mutex> lg(guard);
316 modems.erase(arg);
317 });
318 }
319
320 void for_each_modem(const std::function<void(const Modem&)>& functor) const
321 {
322 std::lock_guard<std::mutex> lg(guard);
323 for (const auto& modem : modems)
324 {
325 functor(modem.second);
326 }
327 }
328
329 std::shared_ptr<core::dbus::Service> service;
330 std::shared_ptr<core::dbus::Object> object;
331 std::shared_ptr<core::dbus::Signal<ModemAdded, ModemAdded::ArgumentType>> modem_added;
332 std::shared_ptr<core::dbus::Signal<ModemRemoved, ModemRemoved::ArgumentType>> modem_removed;
333 mutable std::mutex guard;
334 std::map<core::dbus::types::ObjectPath, Modem> modems;
335};
336};
337}
338
339#endif // LOCATION_SERVICE_LOCATION_CONNECTIVITY_OFONO_H
3400
=== removed file 'src/connectivity-cpp/dbus-cpp/services/urfkill.h'
--- src/connectivity-cpp/dbus-cpp/services/urfkill.h 2014-10-23 21:46:41 +0000
+++ src/connectivity-cpp/dbus-cpp/services/urfkill.h 1970-01-01 00:00:00 +0000
@@ -1,338 +0,0 @@
1/*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
17 */
18#ifndef PLATFORM_MANAGER_NMOFONO_URFKILL_H
19#define PLATFORM_MANAGER_NMOFONO_URFKILL_H
20
21#include <core/dbus/bus.h>
22#include <core/dbus/object.h>
23#include <core/dbus/property.h>
24#include <core/dbus/service.h>
25#include <core/dbus/types/object_path.h>
26#include <core/dbus/types/any.h>
27#include <core/dbus/types/struct.h>
28#include <core/dbus/types/stl/map.h>
29#include <core/dbus/types/stl/string.h>
30#include <core/dbus/types/stl/tuple.h>
31#include <core/dbus/types/stl/vector.h>
32#include "util.h"
33
34namespace org
35{
36namespace freedesktop
37{
38namespace URfkill
39{
40
41struct Interface
42{
43 struct Killswitch
44 {
45 static const std::string& name()
46 {
47 static const std::string s{"org.freedesktop.URfkill.Killswitch"};
48 return s;
49 }
50
51 struct Property
52 {
53 struct State
54 {
55 static const std::string& name()
56 {
57 static const std::string s{"state"};
58 return s;
59 }
60
61 typedef Killswitch Interface;
62 typedef std::int32_t ValueType;
63 static const bool readable = true;
64 static const bool writable = false;
65 };
66 };
67
68 enum class Type;
69 Killswitch(const std::shared_ptr<core::dbus::Object>& object,
70 Type type)
71 : object(object),
72 type(type),
73 _state(object->get_property<Property::State>())
74 {
75 _state->changed().connect(std::bind(&Killswitch::_stateChanged, this, std::placeholders::_1));
76 _stateChanged(_state->get());
77 }
78
79 enum class State
80 {
81 not_available = -1,
82 unblocked = 0,
83 soft_blocked = 1,
84 hard_blocked = 2
85 };
86
87 enum class Type {
88 bluetooth,
89 fm,
90 gps,
91 nfc,
92 uwb,
93 wimax,
94 wlan,
95 wwan
96 };
97
98 static const std::string path(Type type)
99 {
100 switch(type) {
101 case Type::bluetooth:
102 return "/org/freedesktop/URfkill/BLUETOOTH";
103 case Type::fm:
104 return "/org/freedesktop/URfkill/FM";
105 case Type::gps:
106 return "/org/freedesktop/URfkill/GPS";
107 case Type::nfc:
108 return "/org/freedesktop/URfkill/NFC";
109 case Type::uwb:
110 return "/org/freedesktop/URfkill/UWB";
111 case Type::wimax:
112 return "/org/freedesktop/URfkill/WIMAX";
113 case Type::wlan:
114 return "/org/freedesktop/URfkill/WLAN";
115 case Type::wwan:
116 return "/org/freedesktop/URfkill/WWAN";
117 }
118
119 return "";
120 }
121
122 void _stateChanged(Property::State::ValueType val)
123 {
124 if (val == -1)
125 state.set(State::not_available);
126 else if (val == 0)
127 state.set(State::unblocked);
128 else if (val == 1)
129 state.set(State::soft_blocked);
130 else if (val == 2)
131 state.set(State::hard_blocked);
132 else
133 throw std::runtime_error("got unknown Killswitch state from urfkill: " + std::to_string(val));
134 }
135
136 std::shared_ptr<core::dbus::Object> object;
137 const Type type;
138 std::shared_ptr<core::dbus::Property<Property::State>> _state;
139 core::Property<State> state;
140 };
141
142 struct URfkill
143 {
144 static const std::string& name()
145 {
146 static const std::string s{"org.freedesktop.URfkill"};
147 return s;
148 }
149
150 struct Method
151 {
152 struct Block
153 {
154 static const std::string& name()
155 {
156 static const std::string s{"Block"};
157 return s;
158 }
159
160 typedef URfkill Interface;
161 typedef bool ResultType;
162
163 static std::chrono::milliseconds default_timeout()
164 {
165 return std::chrono::seconds{30};
166 }
167 };
168
169 struct FlightMode
170 {
171 static const std::string& name()
172 {
173 static const std::string s{"FlightMode"};
174 return s;
175 }
176
177 typedef URfkill Interface;
178 typedef bool ResultType;
179
180 static std::chrono::milliseconds default_timeout()
181 {
182 return std::chrono::seconds{30};
183 }
184 };
185
186 struct IsFlightMode
187 {
188 static const std::string& name()
189 {
190 static const std::string s{"IsFlightMode"};
191 return s;
192 }
193
194 typedef URfkill Interface;
195 typedef bool ResultType;
196
197 static std::chrono::milliseconds default_timeout()
198 {
199 return std::chrono::seconds{30};
200 }
201 };
202 };
203
204 struct Signal
205 {
206 struct FlightModeChanged
207 {
208 static const std::string& name()
209 {
210 static const std::string s{"FlightModeChanged"};
211 return s;
212 }
213
214 typedef URfkill Interface;
215 typedef bool ArgumentType;
216 };
217 };
218
219 URfkill(std::shared_ptr<core::dbus::Service> &service,
220 std::shared_ptr<core::dbus::Object> &object)
221 : service{service},
222 object{object},
223 flightModeChanged{object->get_signal<Signal::FlightModeChanged>()}
224 {
225 switches[Killswitch::Type::bluetooth] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::bluetooth)), Killswitch::Type::bluetooth);
226 switches[Killswitch::Type::fm] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::fm)), Killswitch::Type::fm);
227 switches[Killswitch::Type::gps] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::gps)), Killswitch::Type::gps);
228 switches[Killswitch::Type::nfc] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::nfc)), Killswitch::Type::nfc);
229 switches[Killswitch::Type::uwb] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::uwb)), Killswitch::Type::uwb);
230 switches[Killswitch::Type::wimax] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::wimax)), Killswitch::Type::wimax);
231 switches[Killswitch::Type::wlan] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::wlan)), Killswitch::Type::wlan);
232 switches[Killswitch::Type::wwan] = std::make_shared<Killswitch>(service->object_for_path(Killswitch::path(Killswitch::Type::wwan)), Killswitch::Type::wwan);
233 }
234
235 bool block(Killswitch::Type type, bool block)
236 {
237 std::uint32_t utype;
238 switch (type) {
239 case Killswitch::Type::bluetooth:
240 utype = 2;
241 break;
242 case Killswitch::Type::fm:
243 utype = 7;
244 break;
245 case Killswitch::Type::gps:
246 utype = 6;
247 break;
248 case Killswitch::Type::nfc:
249 utype = 8; /// @todo verify me
250 break;
251 case Killswitch::Type::uwb:
252 utype = 3;
253 break;
254 case Killswitch::Type::wimax:
255 utype = 4;
256 break;
257 case Killswitch::Type::wlan:
258 utype = 1;
259 break;
260 case Killswitch::Type::wwan:
261 utype = 5;
262 break;
263 }
264 // we can't handle "all" (0) with this, but that's deprecated by FlightMode anyway
265
266 auto result =
267 object->invoke_method_synchronously<
268 Method::Block, Method::Block::ResultType>
269 (utype, block);
270
271 if (result.is_error())
272 throw std::runtime_error(result.error().print());
273
274 return result.value();
275 }
276
277 bool flightMode(bool block)
278 {
279 auto result =
280 object->invoke_method_synchronously<
281 Method::FlightMode, Method::FlightMode::ResultType>
282 (block);
283
284 if (result.is_error())
285 throw std::runtime_error(result.error().print());
286
287 return result.value();
288 }
289
290 bool isFlightMode()
291 {
292 auto result =
293 object->invoke_method_synchronously<
294 Method::IsFlightMode, Method::IsFlightMode::ResultType>
295 ();
296
297 if (result.is_error())
298 throw std::runtime_error(result.error().print());
299
300 return result.value();
301 }
302
303 std::shared_ptr<core::dbus::Service> service;
304 std::shared_ptr<core::dbus::Object> object;
305 std::shared_ptr<core::dbus::Signal<Signal::FlightModeChanged, Signal::FlightModeChanged::ArgumentType>> flightModeChanged;
306
307 std::map<Killswitch::Type, std::shared_ptr<Killswitch>> switches;
308 };
309};
310
311struct Service
312{
313 std::shared_ptr<Interface::URfkill> urfkill;
314
315 Service(const core::dbus::Bus::Ptr& bus)
316 {
317 auto service = core::dbus::Service::use_service<Interface::URfkill>(bus);
318 auto object = service->object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/URfkill"));
319 urfkill = std::make_shared<Interface::URfkill>(service, object);
320 }
321
322 struct Mock
323 {
324 std::shared_ptr<Interface::URfkill> urfkill;
325
326 Mock(const core::dbus::Bus::Ptr& bus)
327 {
328 auto service = core::dbus::Service::add_service<Interface::URfkill>(bus);
329 auto object = service->add_object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/URfkill"));
330 urfkill = std::make_shared<Interface::URfkill>(service, object);
331 }
332 };
333};
334}
335}
336}
337
338#endif // PLATFORM_MANAGER_NMOFONO_URFKILL_H
3390
=== removed file 'src/connectivity-cpp/dbus-cpp/services/util.h'
--- src/connectivity-cpp/dbus-cpp/services/util.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/dbus-cpp/services/util.h 1970-01-01 00:00:00 +0000
@@ -1,36 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Jussi Pakkanen <jussi.pakkanen@canonical.com>
18 */
19
20#ifndef CONNECTIVITY_UTIL_H
21#define CONNECTIVITY_UTIL_H
22
23namespace core {
24namespace dbus {
25class Error;
26}
27}
28
29namespace connectivity {
30
31void throw_dbus_exception(const core::dbus::Error &e);
32
33}
34
35
36#endif
370
=== removed directory 'src/connectivity-cpp/include/connectivity'
=== removed directory 'src/connectivity-cpp/include/connectivity/networking'
=== removed directory 'src/connectivity-cpp/include/connectivity/networking/service'
=== removed file 'src/connectivity-cpp/include/connectivity/networking/service.h'
--- src/connectivity-cpp/include/connectivity/networking/service.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/include/connectivity/networking/service.h 1970-01-01 00:00:00 +0000
@@ -1,83 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
18 */
19
20#ifndef CONNECTIVITY_NETWORKING_SERVICE
21#define CONNECTIVITY_NETWORKING_SERVICE
22
23#include <connectivity/networking/link.h>
24
25#include <memory>
26
27namespace connectivity {
28namespace networking {
29
30#ifndef CONNECTIVITY_CPP_EXPORT
31#define CONNECTIVITY_CPP_EXPORT __attribute ((visibility ("default")))
32#endif
33
34/// @private
35class CONNECTIVITY_CPP_EXPORT
36Service
37{
38public:
39
40 typedef std::shared_ptr<Service> Ptr;
41
42 enum class Type {
43 vpn,
44 tethering,
45 tor
46 };
47 virtual Type type() const = 0;
48
49 enum class Status {
50 stopped,
51 starting,
52 running
53 };
54
55 virtual ~Service() = default;
56
57 virtual const core::Property<Status>& status() const = 0;
58
59 // which other Service this service requires to be active
60 // before it can be activated
61 virtual std::shared_ptr<Service> requires() = 0;
62
63 // possible link this service provides.
64 // check with:
65 // if (service->link()) {
66 // // we have a link coming from the service
67 // do_something_with(link);
68 // }
69 virtual Link::Ptr link() = 0;
70
71 virtual void start() = 0;
72 virtual void stop() = 0;
73
74 typedef unsigned int Id;
75 virtual Id id() const = 0;
76
77 virtual core::Property<std::string>& name() const = 0;
78};
79
80}
81}
82
83#endif
840
=== removed directory 'src/connectivity-cpp/include/connectivity/networking/service/tethering'
=== removed file 'src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h'
--- src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/include/connectivity/networking/service/tethering/service.h 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
18 */
19
20#ifndef CONNECTIVITY_NETWORKING_SERVICE_TETHERING_SERVICE
21#define CONNECTIVITY_NETWORKING_SERVICE_TETHERING_SERVICE
22
23#include <com/ubuntu/connectivity/networking/service.h>
24
25namespace connectivity {
26namespace networking {
27namespace service {
28
29namespace tethering {
30
31/// @private
32class
33Service : public connectivity::networking::Service
34{
35public:
36 typedef std::shared_ptr<Service> Ptr;
37 virtual ~Service() = default;
38
39 /*
40 * Which link is shared to the client devices.
41 */
42 const core::Property<std::shared_ptr<Link>> &shared() = 0;
43
44 /*
45 * Which link is used to serve the clients.
46 */
47 const core::Property<std::shared_ptr<Link>> &sharedOver() = 0;
48
49
50protected:
51 Service() = default;
52};
53
54}
55}
56}
57}
58
59#endif
600
=== removed directory 'src/connectivity-cpp/include/connectivity/networking/service/tor'
=== removed file 'src/connectivity-cpp/include/connectivity/networking/service/tor/service.h'
--- src/connectivity-cpp/include/connectivity/networking/service/tor/service.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/include/connectivity/networking/service/tor/service.h 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
18 */
19
20#ifndef CONNECTIVITY_NETWORKING_SERVICE_TOR_SERVICE
21#define CONNECTIVITY_NETWORKING_SERVICE_TOR_SERVICE
22
23#include <connectivity/networking/service.h>
24
25namespace connectivity {
26namespace networking {
27namespace service {
28namespace tor {
29
30/// @private
31class
32Service : public connectivity::networking::Service
33{
34public:
35 typedef std::shared_ptr<Service> Ptr;
36 virtual ~Service() = default;
37
38 virtual const core::Property<std::shared_ptr<Link>> &establishedOver() const = 0;
39};
40
41}
42}
43}
44}
45
46#endif
470
=== removed directory 'src/connectivity-cpp/include/connectivity/networking/service/vpn'
=== removed file 'src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h'
--- src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/include/connectivity/networking/service/vpn/service.h 1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
18 */
19
20#ifndef CONNECTIVITY_NETWORKING_SERVICE_VPN_SERVICE
21#define CONNECTIVITY_NETWORKING_SERVICE_VPN_SERVICE
22
23#include <connectivity/networking/service.h>
24
25namespace connectivity {
26namespace networking {
27namespace service {
28namespace vpn {
29
30/// @private
31class
32Service : public connectivity::networking::Service
33{
34public:
35 typedef std::shared_ptr<Service> Ptr;
36 virtual ~Service() = default;
37
38 virtual const core::Property<std::shared_ptr<Link>> &establishedOver() const = 0;
39
40protected:
41 Service() = default;
42};
43
44}
45}
46}
47}
48
49#endif
500
=== removed directory 'src/connectivity-cpp/include/connectivity/networking/wifi'
=== modified file 'src/connectivity-cpp/src/CMakeLists.txt'
--- src/connectivity-cpp/src/CMakeLists.txt 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/src/CMakeLists.txt 2015-04-01 15:30:55 +0000
@@ -16,15 +16,34 @@
16# Antti Kaijanmäki <antti.kaijanmaki@canonical.com>16# Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
1717
18add_library(connectivity-cpp STATIC18add_library(connectivity-cpp STATIC
19 platform/nmofono/kill-switch.cpp
20 platform/nmofono/manager.cpp
21 platform/nmofono/manager.h
22 platform/nmofono/service.cpp
23 platform/nmofono/service.h
24 platform/nmofono/wifi/access-point-impl.h
25 platform/nmofono/wifi/access-point-impl.cpp
26 platform/nmofono/wifi/grouped-access-point.h
27 platform/nmofono/wifi/grouped-access-point.cpp
28 platform/nmofono/wifi/link.h
29 platform/nmofono/wifi/link.cpp
30
31 #platform/nmofono/ofono_nm_connectivity_manager.cpp
32 platform/nmofono/set_name_for_thread.cpp
33 platform/nmofono/set_name_for_thread.h
34
35 ../include/connectivity/networking/wifi/access-point.cpp
19 manager.cpp36 manager.cpp
20)37)
38
21set_target_properties(connectivity-cpp PROPERTIES39set_target_properties(connectivity-cpp PROPERTIES
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}
23 SOVERSION ${CONNECTIVITY_CPP_VERSION_MAJOR}41 SOVERSION ${CONNECTIVITY_CPP_VERSION_MAJOR}
24 OUTPUT_NAME "connectivity-cpp"42 OUTPUT_NAME "connectivity-cpp"
25)43)
26target_link_libraries(connectivity-cpp platform_nmofono)44
2745target_link_libraries(connectivity-cpp
28add_subdirectory(platform/nmofono)46 connectivity-backend
2947 ${DBUSCPP_LIBRARIES}
3048 ${GLIB_LIBRARIES}
49)
3150
=== added directory 'src/connectivity-cpp/src/platform'
=== removed directory 'src/connectivity-cpp/src/platform'
=== added directory 'src/connectivity-cpp/src/platform/nmofono'
=== removed file 'src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt'
--- src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt 2014-08-22 14:56:59 +0000
+++ src/connectivity-cpp/src/platform/nmofono/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1# Copyright © 2013 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify it
4# under the terms of the GNU Lesser General Public License version 3,
5# as published by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU Lesser General Public License for more details.
11#
12# You should have received a copy of the GNU Lesser General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14#
15# Authors:
16# Antti Kaijanmäki <antti.kaijanmaki@canonical.com>
17
18set(NMOFONO_PLATFORM_SOURCES
19 kill-switch.cpp
20 manager.cpp
21 manager.h
22 service.cpp
23 service.h
24 wifi/access-point.h
25 wifi/access-point.cpp
26 wifi/grouped-access-point.h
27 wifi/grouped-access-point.cpp
28 wifi/link.h
29 wifi/link.cpp
30 ../util.cpp
31
32 #ofono_nm_connectivity_manager.cpp
33 set_name_for_thread.cpp
34 set_name_for_thread.h
35)
36
37add_library(platform_nmofono STATIC ${NMOFONO_PLATFORM_SOURCES})
38target_link_libraries(
39 platform_nmofono
40 ${DBUSCPP_LIBRARIES}
41 ${GLIB_LIBRARIES}
42)
430
=== removed file 'src/connectivity-cpp/src/platform/nmofono/bounded_integer.h'
--- src/connectivity-cpp/src/platform/nmofono/bounded_integer.h 2014-08-19 19:55:15 +0000
+++ src/connectivity-cpp/src/platform/nmofono/bounded_integer.h 1970-01-01 00:00:00 +0000
@@ -1,178 +0,0 @@
1/*
2 * Copyright © 2012-2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */
18#ifndef LOCATION_SERVICE_LOCATION_CONNECTIVITY_BOUNDED_INTEGER_H_
19#define LOCATION_SERVICE_LOCATION_CONNECTIVITY_BOUNDED_INTEGER_H_
20
21#include <iostream>
22#include <stdexcept>
23
24namespace location
25{
26namespace connectivity
27{
28/**
29 * @brief A helper class to handle bounded integer values, with an optional domain
30 * for tagging domain-specific types.
31 */
32template<int min, int max, int domain = 0>
33class BoundedInteger
34{
35public:
36 static_assert(min < max, "min >= max");
37
38 /**
39 * @brief Access the minimum value of the integer.
40 */
41 inline static int minimum()
42 {
43 return min;
44 }
45
46 /**
47 * @brief Access the maximum value of the integer.
48 */
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches