Index: chrome/common/extensions/api/gcd_private.idl |
diff --git a/chrome/common/extensions/api/gcd_private.idl b/chrome/common/extensions/api/gcd_private.idl |
index 26f57e042b57d8fbaaf28d7b01a6b7c9bd0a5632..23a299c385d5627074df1ff2519288c57a1dc776 100644 |
--- a/chrome/common/extensions/api/gcd_private.idl |
+++ b/chrome/common/extensions/api/gcd_private.idl |
@@ -29,34 +29,35 @@ namespace gcdPrivate { |
DOMString deviceDescription; |
}; |
- // Represents wifi network credentials. |
- dictionary WiFiCredentials { |
- DOMString ssid; |
- DOMString password; |
- }; |
- |
callback CloudDeviceListCallback = void(GCDDevice[] devices); |
+ callback CommandDefinitionsCallback = void(object commandDefinitions); |
Noam Samuel
2014/07/08 18:26:32
Is the object schema in this case a CDD? I think
Vitaly Buka (NO REVIEWS)
2014/07/08 18:49:06
Done.
|
+ callback CommandCallback = void(object command); |
+ callback CommandListCallback = void(object[] commands); |
interface Functions { |
+ // Returns the list of cloud devices visible locally or available in the |
+ // cloud for user account. |
static void getCloudDeviceList(CloudDeviceListCallback callback); |
+ // Queries network for local devices. Triggers an onCloudDeviceStateChanged |
+ // event per device. Call this function *only* after registering for |
+ // onCloudDeviceStateChanged events, or it will do nothing. |
+ static void queryForNewLocalDevices(); |
+ |
// Starts device setup process. Returns id of setup process. Id should be |
// used as |setupId| in all subsequent setup related calls, and for |
// filtering setup events. |
static long startSetup(GCDDevice device); |
- // Sets WiFi network list as reply to |onGetWifiNetworks| event. |
+ // Sets WiFi network as reply to |onGetWifiNetworks| event. |
// |setupId| : The value returned by |startSetup|. |
- // |networks| : The list of network device should be registered on. |
- static void setWiFiNetworks(long setupId, DOMString[] networks); |
+ // |network| : The wifi network for device setup. |
+ static void setWiFiNetwork(long setupId, DOMString network); |
- // Sets WiFi network credentials as reply to |onGetWifiCredentials| |
- // event. |
+ // Sets WiFi network password as reply to |onGetWifiCredentials| event. |
// |setupId| : The value returned by |startSetup|. |
- // |credentials| : The list of ssid with passwoors. The list is not required |
- // to match |networks| provided with |setWiFiNetworks| or |
- // |onGetWifiCredentials|. |
- static void setWiFiCredentials(long setupId, WiFiCredentials[] credentials); |
+ // |password| : The passwords for network selected with |setWiFiNetwork|. |
+ static void setWiFiPassword(long setupId, DOMString password); |
// Confirms that security code known to application match to the code known |
// to device. |
@@ -68,24 +69,66 @@ namespace gcdPrivate { |
// starting new registration. |
// |setupId| : The value returned by |startSetup|. |
static void stopSetup(long setupId); |
+ |
+ // Returns command definitions. |
+ // |device| : The device to get command definitions for. |
+ // |callback| : The result callback. |
+ static void getCommandDefinitions(GCDDevice device, |
+ CommandDefinitionsCallback callback); |
+ |
+ // Creates and sends a new command. |
+ // |device| : The device to send the command to. |
+ // |expireInMs| : The number of milliseconds since now before the command |
+ // expires. Expired command should not be executed by device. Acceptable |
+ // values are 10000 to 2592000000, inclusive. All values outside that range |
+ // will be replaced by 2592000000. |
+ // |callback| : The result callback. |
+ static void insertCommand(GCDDevice device, |
Noam Samuel
2014/07/08 18:26:32
Does this transparently switch between local and c
Vitaly Buka (NO REVIEWS)
2014/07/08 18:49:05
yes
On 2014/07/08 18:26:32, Noam Samuel wrote:
|
+ long expireInMs, |
+ object command, |
Noam Samuel
2014/07/08 18:26:32
Is the schema for the command the GCD command sche
Vitaly Buka (NO REVIEWS)
2014/07/08 18:49:06
Done.
|
+ CommandCallback callback); |
+ |
+ // Returns a particular command. |
+ // |commandId| : Unique command ID. |
+ // |callback| : The result callback. |
+ static void getCommand(DOMString commandId, |
Noam Samuel
2014/07/08 18:26:32
Does this transparently handle local and cloud? If
Vitaly Buka (NO REVIEWS)
2014/07/08 18:49:06
implementation should take care about this.
On 20
|
+ CommandCallback callback); |
+ |
+ // Cancels a command. |
+ // |commandId| : Unique command ID. |
+ // |callback| : The result callback. |
+ static void cancelCommand(DOMString commandId, |
+ CommandCallback callback); |
+ |
+ // Lists all commands in order of creation. |
+ // |device| : The device to get the commands for. |
+ // |byUser| : List all the commands issued by the user. Special value 'me' |
+ // can be used to list by the current user. |
+ // |state| : Command state. |
+ // |callback| : The result callback. |
+ static void getCommandsList(GCDDevice device, |
Noam Samuel
2014/07/08 18:26:32
Is this function cloud-only?
Vitaly Buka (NO REVIEWS)
2014/07/08 18:49:06
No. It going to be local queue for local devices.
|
+ DOMString byUser, |
+ DOMString state, |
+ CommandListCallback callback); |
}; |
interface Events { |
// Subscribe to this event to start listening to cloud devices. New |
- // listeners will get called with all known devices on the network. |
+ // listeners will get called with all known devices on the network, and |
+ // devices available using cloud. |
Noam Samuel
2014/07/08 18:26:32
Does this mean we want to start a cloud request wh
Vitaly Buka (NO REVIEWS)
2014/07/08 18:49:05
Maybe we would need subscribeForDeviceChanges(GCDe
Noam Samuel
2014/07/08 19:04:30
Maybe "and status updates for devices available th
|
static void onCloudDeviceStateChanged(boolean available, GCDDevice device); |
- // Notifies app that setup is waiting for network list. App should reply |
- // with |setWiFiNetworks|. |
+ // Notifies app that setup is waiting for a wifi network. App should reply |
+ // with |setWiFiNetwork|. |
// |setupId| : The value returned by |startSetup|. |
- static void onGetWifiNetworks(long setupId); |
+ static void onGetWifiNetwork(long setupId); |
- // Notifies app that setup is waiting for credentions for |networks| list. |
- // App should reply with |setWiFiCredentials|. |
+ // Notifies app that setup is waiting for password for the network provided |
+ // with |setWiFiNetwork|. Even will be called if setup flow would unable to |
+ // get password from the system. |
+ // App should reply with |setWiFiPassword|. |
// |setupId| : The value returned by |startSetup|. |
- // |networks| : A subset of the list provided in |setWiFiNetworks| for which |
- // setup flow is unable to find credentials |
- static void onGetWifiCredentials(long setupId, DOMString[] networks); |
+ static void onGetWifiPassword(long setupId); |
// Notifies app that setup is waiting for confirmation that code is the same |
// as code known to device. App should reply with |confirmCode|, or |
@@ -98,7 +141,7 @@ namespace gcdPrivate { |
// |setupId| : The value returned by |startSetup|. |
static void onSetupSuccess(long setupId); |
- // Notifies app that setup is failed or stoped. |
+ // Notifies app that setup is failed or stopped. |
// |setupId| : The value returned by |startSetup|. |
static void onSetupError(long setupId); |
}; |