camera.switchWifi
Stay organized with collections
Save and categorize content based on your preferences.
The app sends this command to the camera to provide it with credentials to
access an infrastructure Wi-Fi with access to the Internet. The command includes
a pre-shared secret key K that the app will later use to authenticate itself
with the camera after both devices have switched to the infrastructure Wi-Fi.
This command was added in API level 2.1 and is relevant to
Direct Upload.
Parameters
preSharedKey:
A randomly generated 256-bit key used for authenticating the
camera with the app after both are connected to the infrastructure Wi-Fi.
For example, RAND_bytes() from OpenSSL can be used to generate this.
wifiSsid:
Wi-Fi SSID.
wifiPwd:
Wi-Fi password, if any.
Results
- This command returns no result.
Errors
missingParameter:
Some parameter, for example, preSharedKey
is missing.
invalidParameterName:
One or more input parameter names are
unrecognized.
invalidParameterValue:
Input parameter names are recognized
but one or more passed value are invalid. For example, the wifiPwd
is passed in as an integer instead of a string.
Command I/O |
|
Command Input |
{ "parameters": { "preSharedKey": "random key", "wifiSsid": "home Wi-Fi", "wifiPwd": "wifi password" } } |
Command Output |
none |
Command Output (Error) |
{ "error": { "code": "missingParameter", "message": "Parameter preSharedKey is missing." } } |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["The command enables the app to provide the camera with infrastructure Wi-Fi credentials, including a pre-shared key for subsequent authentication."],["Introduced in API level 2.1, this command is specifically for Direct Upload functionality and facilitates camera-app communication over Wi-Fi."],["It requires parameters like preSharedKey, wifiSsid, and wifiPwd, and potential errors include missing or invalid parameters."],["The command itself doesn't return a result, but errors are indicated through specific error codes and messages."]]],[]]