camera.switchWifi
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برنامه این دستور را به دوربین ارسال می کند تا اعتبارنامه دسترسی به زیرساخت Wi-Fi با دسترسی به اینترنت را در اختیار دوربین قرار دهد. این فرمان شامل یک کلید مخفی از پیش مشترک K میشود که بعداً بعد از اینکه هر دو دستگاه به زیرساخت وایفای رفتند، برنامه برای احراز هویت با دوربین استفاده میکند. این دستور در سطح API 2.1 اضافه شده است و مربوط به آپلود مستقیم است.
پارامترها
-
preSharedKey:
یک کلید 256 بیتی بهطور تصادفی که برای تأیید اعتبار دوربین با برنامه پس از اتصال هر دو به زیرساخت Wi-Fi استفاده میشود. به عنوان مثال، RAND_bytes() از OpenSSL می تواند برای تولید این مورد استفاده شود. -
wifiSsid:
وای فای SSID. -
wifiPwd:
رمز عبور Wi-Fi، در صورت وجود.
نتایج
- این دستور هیچ نتیجه ای را بر نمی گرداند.
خطاها
-
missingParameter:
برخی از پارامترها، به عنوان مثال، preSharedKey
وجود ندارد. -
invalidParameterName:
نام یک یا چند پارامتر ورودی شناسایی نشده است. -
invalidParameterValue:
نام پارامترهای ورودی شناسایی می شود اما یک یا چند مقدار ارسال شده نامعتبر است. به عنوان مثال، wifiPwd
به جای رشته به عنوان یک عدد صحیح ارسال می شود.
دستور I/O | |
---|
ورودی فرمان | { "parameters": { "preSharedKey": "random key", "wifiSsid": "home Wi-Fi", "wifiPwd": "wifi password" } } |
خروجی فرمان | none |
خروجی فرمان (خطا) | { "error": { "code": "missingParameter", "message": "Parameter preSharedKey is missing." } } |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-11-08 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-11-08 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe command enables the app to provide the camera with infrastructure Wi-Fi credentials, including a pre-shared key for subsequent authentication.\u003c/p\u003e\n"],["\u003cp\u003eIntroduced in API level 2.1, this command is specifically for Direct Upload functionality and facilitates camera-app communication over Wi-Fi.\u003c/p\u003e\n"],["\u003cp\u003eIt requires parameters like preSharedKey, wifiSsid, and wifiPwd, and potential errors include missing or invalid parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe command itself doesn't return a result, but errors are indicated through specific error codes and messages.\u003c/p\u003e\n"]]],["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"],null,["# camera.switchWifi\n\nThe app sends this command to the camera to provide it with credentials to\naccess an infrastructure Wi-Fi with access to the Internet. The command includes\na pre-shared secret key K that the app will later use to authenticate itself\nwith the camera after both devices have switched to the infrastructure Wi-Fi.\n*This command was added in API level 2.1 and is relevant to\n[Direct Upload](/streetview/open-spherical-camera/guides/direct-upload).*\n\nParameters\n----------\n\n- `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.\n- `wifiSsid:` Wi-Fi SSID.\n- `wifiPwd:` Wi-Fi password, if any.\n\nResults\n-------\n\n- This command returns no result.\n\nErrors\n------\n\n- `missingParameter:` Some parameter, for example, `preSharedKey` is missing.\n- `invalidParameterName:` One or more input parameter names are unrecognized.\n- `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.\n\n| Command I/O | |\n|----------------------------|----------------------------------------------------------------------------------------------------------------------|\n| **Command Input** | ```text { \"parameters\": { \"preSharedKey\": \"random key\", \"wifiSsid\": \"home Wi-Fi\", \"wifiPwd\": \"wifi password\" } } ``` |\n| **Command Output** | ```text none ``` |\n| **Command Output (Error)** | ```text { \"error\": { \"code\": \"missingParameter\", \"message\": \"Parameter preSharedKey is missing.\" } } ``` |"]]