device-provisioning-api.txt (6969B)
1 Device Provisioning hierarchy 2 ============================= 3 4 Service net.connman.iwd 5 Interface net.connman.iwd.DeviceProvisioning [Experimental] 6 Object path /net/connman/iwd/{phy0,phy1,...}/{1,2,...} 7 8 Methods string StartEnrollee() 9 10 Start a DPP enrollee. Currently only station devices are 11 supported. 12 13 Returns the enrollees URI 14 15 Possible errors: net.connman.iwd.InvalidArguments 16 net.connman.iwd.AlreadyExists 17 net.connman.iwd.NotAvailable 18 19 void Stop() 20 21 Stop an enrollee or configurator that is running. 22 23 Possible errors: net.connman.iwd.NotFound 24 25 string StartConfigurator() 26 27 Start a DPP configurator. Currently only connected 28 station devices are supported, and will only configure 29 the enrollee to the currently connected network. 30 31 Returns the configurator URI 32 33 Possible errors: net.connman.iwd.NotAvailable 34 net.connman.iwd.NotConnected 35 net.connman.iwd.NotConfigured 36 net.connman.iwd.NotSupported 37 net.connman.iwd.Busy 38 39 string ConfigureEnrollee(string uri) 40 41 Start a DPP configurator with an enrollees URI. 42 Only connected station devices are supported and will 43 only configure the enrollee to the currently connected 44 network. 45 46 This API is to handle the use case where the enrollee 47 has shared its URI to IWD (unlike StartConfigurator) 48 49 The URI for IWD is also returned which could be used 50 in the same way as it is with StartConfigurator(). 51 52 Possible errors: net.connman.iwd.NotAvailable 53 net.connman.iwd.NotConnected 54 net.connman.iwd.NotConfigured 55 net.connman.iwd.NotSupported 56 net.connman.iwd.Busy 57 58 Properties boolean Started [readonly] 59 60 True if DPP is currently active. 61 62 string Role [readonly, optional] 63 64 Indicates the DPP role. Possible values are "enrollee" 65 or "configurator". This property is only available when 66 Started is true. 67 68 string URI [readonly, optional] 69 70 Indicates the DPP URI. This property is only available 71 when Started is true. 72 73 74 Interface net.connman.iwd.SharedCodeDeviceProvisioning [Experimental] 75 Object path /net/connman/iwd/{phy0,phy1,...}/{1,2,...} 76 77 void ConfigureEnrollee(a{sv}) 78 79 Starts a DPP configurator using a shared code (and 80 optionally identifier) set in the dictionary argument. 81 Valid dictionary keys are: 82 83 string Code 84 The shared code to use. The code used by both 85 parties (configurator and enrollee) must match. 86 87 string Identifier 88 An optional identifier. The identifier used by 89 both parties must match. Per the DPP spec the 90 identifier "shall be a UTF-8 string not greater 91 than eighty (80) octets" 92 93 As with the DeviceProvisioning interface, configurators 94 must be connected to the network they wish to configure 95 in order to start. 96 97 Once started a configurator (acting as a responder) will 98 listen on the currently connected channel for an 99 enrollee's initial exchange request which will kick off 100 the shared code bootstrapping protocol (PKEX). Once 101 completed DPP will start automatically. Only one 102 enrollee can be configured per call to 103 ConfigureEnrollee, i.e. once PKEX/DPP has finished 104 (including failure) the configurator will stop. 105 106 The SharedCode methods have an eventual timeout and will 107 stop automatically after 2 minutes. 108 109 Possible errors: net.connman.iwd.Busy 110 net.connman.iwd.NotConnected 111 net.connman.InvalidArguments 112 net.connman.NotSupported 113 114 void StartEnrollee(a{sv}) 115 116 Starts a DPP enrollee using a shared code (and 117 optionally identifier) set in the dictionary argument 118 (described above in ConfigureEnrollee). 119 120 As with the device provisioning interface, enrollees 121 must be disconnected in order to start. 122 123 Once started an enrollee (acting as an initiator) will 124 iterate channels sending out broadcast exchange requests 125 waiting for a response from a configurator. A response 126 will kick off the shared code bootstrapping protocol 127 (PKEX), followed by DPP if successful. Once the 128 protocols have completed, or failed, the enrollee will 129 stop. If failed, StartEnrollee will need to be called 130 again to retry. 131 132 Possible errors: net.connman.iwd.Busy 133 net.connman.iwd.InvalidArguments 134 135 void StartConfigurator(object agent_path) 136 137 Start a shared code configurator using an agent 138 (distinguished by 'agent_path') to obtain the shared 139 code. This method is meant for an automated use case 140 where a configurator is capable of configuring multiple 141 enrollees, and distinguishing between them by their 142 identifier. 143 144 If the agent service disappears during the shared code 145 exchange it will be stopped, and the protocol will fail. 146 147 This method behaves nearly the same as ConfigureEnrollee 148 except upon receiving an enrollees first exchange 149 request the registered agent will be asked for the 150 shared code using the RequestSharedCode method. 151 152 Though the agent can provide shared codes for multiple 153 enrollees, this method will only configure a single 154 enrollee at a time. Once completed it will need to be 155 called again to configure additional enrollees. 156 157 Possible errors: net.connman.iwd.Busy 158 net.connman.iwd.NotConnected 159 net.connman.iwd.NoAgent 160 net.connman.iwd.NotSupported 161 162 Stop() 163 164 Stop a currently running configurator/enrollee. Note 165 that this will also interrupt DPP if the protocol has 166 advanced that far. Since DPP is initiated implicitly 167 from the shared code APIs it will also be canceled. 168 Calling Stop() if DPP was started via the 169 DeviceProvisioning interface will not stop it. 170 171 Possible errors: net.connman.iwd.NotFound 172 173 Properties boolean Started [readonly] 174 175 True if shared code device provisioning is currently 176 active. (configurator or enrollee is started) 177 178 string Role [readonly, optional] 179 180 Indicates the DPP role. Possible values are "enrollee" 181 or "configurator". This property is only available when 182 Started is true. 183 184 SharedCodeAgent hierarchy 185 ========================= 186 187 Service unique name 188 Interface net.connman.iwd.SharedCodeAgent [Experimental] 189 Object path freely definable 190 191 Methods void Release() [noreply] 192 193 This method gets called when the service daemon 194 unregisters the agent. 195 196 string RequestSharedCode(string identifier) 197 198 This method gets called when a shared code is requested 199 for a particular enrollee, distinguished by the 200 identifier. The shared code agent should lookup the 201 identifier and return the shared code, or return an 202 error if not found. 203 204 Possible Errors: [service].Error.Canceled 205 [service].Error.NotFound 206 207 void Cancel(string reason) [noreply] 208 209 This method gets called to indicate that the agent 210 request failed before a reply was returned. The 211 argument will indicate why the request is being 212 cancelled and may be "user-canceled", "timed-out" or 213 "shutdown". 214 215 Examples Requesting a shared code for an enrollee identified by "foo" 216 217 RequestSharedCode("foo") ==> "super_secret_code"