מצלמה.SwitchWi-Fi
האפליקציה שולחת את הפקודה הזו למצלמה כדי לספק לה פרטי כניסה
לגשת לתשתית Wi-Fi עם גישה לאינטרנט. הפקודה כוללת
מפתח סודי משותף מראש K, שהאפליקציה תשתמש בו מאוחר יותר כדי לאמת את עצמה
עם המצלמה, אחרי ששני המכשירים עברו לתשתית Wi-Fi.
הפקודה הזו נוספה ברמת API 2.1 והיא רלוונטית ל-
העלאה ישירה.
פרמטרים
preSharedKey:
מפתח של 256 ביט שמופק באופן אקראי ומשמש לאימות של
את המצלמה עם האפליקציה אחרי ששניהם מחוברים לתשתית Wi-Fi.
לדוגמה, אפשר להשתמש ב-RAND_bytes() מ-OpenSSL כדי ליצור את הרכיב הזה.
- SSID של
wifiSsid:
.
- סיסמה אחת (
wifiPwd:
) ל-Wi-Fi, אם יש.
תוצאות
- הפקודה הזו לא מחזירה תוצאה.
שגיאות
missingParameter:
חסר פרמטר מסוים, לדוגמה preSharedKey
.
invalidParameterName:
שם אחד או יותר של פרמטר קלט
לא מזוהה.
- זוהו
invalidParameterValue:
שמות של פרמטרים של קלט
אבל אחד או יותר מהערכים שהועברו אינם חוקיים. לדוגמה, wifiPwd
מועבר כמספר שלם ולא כמחרוזת.
Command 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 ודוגמאות הקוד הן ברישיון 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"]]