summaryrefslogtreecommitdiff
path: root/doc/device-api.txt
blob: ce50be7bfb01eedd5fc782f053cda752d728de71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
Device hierarchy
================

Service		org.moblin.connman
Interface	org.moblin.connman.Device
Object path	[variable prefix]/{device0,device1,...}

Methods		dict GetProperties()

			Returns properties for the device object. See
			the properties section for available properties.

			Possible Errors: [service].Error.InvalidArguments

		void SetProperty(string name, variant value)

			Changes the value of the specified property. Only
			properties that are listed as read-write are
			changeable. On success a PropertyChanged signal
			will be emitted.

			Possible Errors: [service].Error.InvalidArguments
					 [service].Error.DoesNotExist

		object CreateNetwork(dict network)

			Creates a network object from the specified
			properties. Valid properties are WiFi.SSID,
			WiFi.Security and WiFi.Passphrase. Check the
			network interface description for details.

			Possible Errors: [service].Error.InvalidArguments

		void RemoveNetwork(object network)

			Removes a previously created network object.

			Possible Errors: [service].Error.InvalidArguments
					 [service].Error.DoesNotExist

Signals		PropertyChanged(string name, variant value)

			This signal indicates a changed value of the given
			property.

Properties	string Name [readonly]

			The device name (for example "Wireless" etc.)

			This name can be used for directly displaying it in
			the application. It has pure informational purpose.

		string Type [readonly]

			The device type (for example "ethernet", "wifi" etc.)

		string Interface [readonly]

			The device interface (for example "eth0" etc.)

			This value is for pure informational purposes. It
			is not guaranteed that it is always present.

		string Policy [readwrite]

			Setting of the device power and connection policy.
			Possible values are "ignore", "off", "auto"
			and "manual".

			The policy defines on how the device is initialized
			when brought up and how it connects. The actual
			device power state can be changed independently to
			this value.

			If a device is switched off and the policy is changed
			to "auto" or "manual", the device will be switched
			on. For a current active device changing the policy
			to "off" results in powering down the device.

			The "ignore" policy can be set for devices that are
			detected, but managed by a different entity on the
			system. For example for complex network setups.

			Devices that can connect to various networks, the
			difference between "auto" or "manual" defines if
			known networks are connected automatically or not.
			For simple devices like Ethernet cards, setting
			the "manual" policy might fail.

		uint8 Priority [readwrite]

			The device priority. Higher values indicate the
			preference for this device.

		boolean Powered [readwrite]

			Switch a device on or off. This will also modify
			the list of networks in range. All known networks
			will be still available via the Networks property.

			Changing this value doesn't change the value of the
			Policy property.

			The value of this property can be changed by other
			parts of the system (including the kernel). An
			example would be modifications via the "ifconfig"
			command line utility.

		uint16 ScanInterval [readwrite]

			The scan interval describes the time in seconds
			between automated scan attempts. Setting this
			value to 0 will disable the background scanning.

			The default value is 300 and so every 5 minutes
			a scan procedure will be triggered.

			This property is not available with all types
			of devices. Some might not support background
			scanning at all.

		boolean Scanning [readonly]

			Indicates if a device is scanning. Not all device
			types might support this. Also some hardware might
			execute background scanning without notifying the
			driver about it. Use this property only for visual
			indication.

		array{object} Networks [readonly]

			List of networks objects paths. Every object path
			represents a network in range or a known network.