สวิตช์กล้อง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แอปจะส่งคำสั่งนี้ไปยังกล้องเพื่อระบุข้อมูลเข้าสู่ระบบให้กับ
เข้าถึง Wi-Fi โครงสร้างพื้นฐานที่มีการเข้าถึงอินเทอร์เน็ต คำสั่งประกอบด้วย
คีย์ลับ K ที่แชร์ล่วงหน้าซึ่งแอปจะใช้เพื่อตรวจสอบสิทธิ์ตัวเองในภายหลัง
กับกล้องหลังจากอุปกรณ์ทั้งสองเปลี่ยนไปใช้ Wi-Fi โครงสร้างพื้นฐาน
คำสั่งนี้เพิ่มขึ้นใน API ระดับ 2.1 และเกี่ยวข้องกับ
การอัปโหลดโดยตรง
พารามิเตอร์
preSharedKey:
คีย์ 256 บิตที่สร้างขึ้นแบบสุ่มซึ่งใช้สำหรับการตรวจสอบสิทธิ์
กล้องกับแอปหลังจากทั้งคู่เชื่อมต่อกับ Wi-Fi โครงสร้างพื้นฐาน
ตัวอย่างเช่น RAND_bytes() จาก OpenSSL สามารถสร้างได้
wifiSsid:
SSID ของ Wi-Fi
wifiPwd:
รหัสผ่าน Wi-Fi (หากมี)
ผลลัพธ์
ข้อผิดพลาด
missingParameter:
พารามิเตอร์บางอย่าง เช่น preSharedKey
ขาดหายไป
invalidParameterName:
ชื่อพารามิเตอร์อินพุตอย่างน้อย 1 รายการ
ไม่รู้จัก
invalidParameterValue:
จดจำชื่อพารามิเตอร์อินพุตได้
แต่มีค่าที่ส่งผ่านอย่างน้อย 1 ค่าไม่ถูกต้อง ตัวอย่างเช่น wifiPwd
ส่งเป็นจำนวนเต็มแทนสตริง
Command 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"],[[["\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.\" } } ``` |"]]