1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Use the <code>chrome.dial</code> API to discover devices that support DIAL.
6 // Protocol specification: http://www.dial-multiscreen.org/
9 // Represents a unique device that responded to a DIAL discovery request.
10 dictionary DialDevice
{
12 // A label identifying the device within this instance of the browser.
13 // Not guaranteed to persist beyond browser instances.
14 DOMString deviceLabel
;
16 // A URL pointing to the device description resource for the device.
17 DOMString deviceDescriptionUrl
;
19 // The uPnP configuration ID reported by the device. Corresponds to the
20 // CONFIGID.UPNP.ORG header in the M-SEARCH response.
26 no_valid_network_interfaces
,
33 dictionary DialError
{
37 callback BooleanCallback
= void (boolean result
);
41 // Requests that DIAL discovery happen immediately. The request may not be
42 // honored as discovery may already be happening in the background. The
43 // callback is invoked with |true| if discovery was initiated or |false|
45 static
void discoverNow
(BooleanCallback
callback);
50 // Event fired to inform clients of the current, complete set of responsive
51 // devices. Clients should only need to store the list from the most recent
52 // event. May be fired in response to multiple circumstances:
54 // (1) The DIAL service refreshed its device list through periodic polling.
55 // (2) A client invoked discoverNow().
56 // (3) An event happened that should invalidate the device list
57 // (e.g., a network interface went offline), in which case it is fired
58 // with an empty array.
59 static
void onDeviceList
(DialDevice
[] result
);
61 // Event fired to inform clients on errors during device discovery.
62 static
void onError
(DialError error
);