camera.switchWifi
アプリはこのコマンドをカメラに送信して、カメラに認証情報を提供します。
インフラストラクチャの Wi-Fi とインターネットへのアクセス。このコマンドには次のものが含まれます。
アプリが後で自身を認証するために使用する事前共有秘密鍵 K
カメラに接続する必要があります。
このコマンドは API レベル 2.1 で追加され、
直接アップロード。
パラメータ
preSharedKey:
: ランダムに生成された 256 ビットの鍵で、ユーザーの認証に使用されます。
アプリの両方でカメラがインフラストラクチャ Wi-Fi に接続されてから、カメラとカメラがオフになります。
たとえば、OpenSSL の RAND_bytes() を使用して生成できます。
- Wi-Fi の SSID:
wifiSsid:
wifiPwd:
Wi-Fi パスワード(ある場合)。
結果
エラー
missingParameter:
一部のパラメータ(preSharedKey
など)がありません。
invalidParameterName:
1 つ以上の入力パラメータ名が
認識されません。
invalidParameterValue:
入力パラメータ名が認識される
無効な値が 1 つ以上渡されました。たとえば、wifiPwd
は文字列ではなく整数として渡されます。
コマンド I/O |
|
コマンド入力 |
{ "parameters": { "preSharedKey": "random key", "wifiSsid": "home Wi-Fi", "wifiPwd": "wifi password" } } |
コマンド出力 |
none |
コマンド出力(エラー) |
{ "error": { "code": "missingParameter", "message": "Parameter preSharedKey is missing." } } |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-21 UTC。
[null,null,["最終更新日 2024-08-21 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."]]],["The app sends a command to the camera to grant it access to an infrastructure Wi-Fi network. This command requires three parameters: a 256-bit pre-shared key (`preSharedKey`) for later authentication, the Wi-Fi SSID (`wifiSsid`), and the Wi-Fi password (`wifiPwd`). The camera uses this information to connect to the network. No result is returned, but errors can occur if parameters are missing, unrecognized, or invalid. This was added in API level 2.1.\n"]]