camera.switchWifi
يرسل التطبيق هذا الأمر إلى الكاميرا لتزويدها ببيانات الاعتماد
الوصول إلى شبكة Wi-Fi للبنية التحتية مع إمكانية الوصول إلى الإنترنت. يتضمن الأمر
مفتاح سري تمت مشاركته مسبقًا K والذي سيستخدمه التطبيق لاحقًا لمصادقة نفسه
بالكاميرا بعد تبديل كلا الجهازين إلى شبكة Wi-Fi في البنية الأساسية.
تمت إضافة هذا الأمر في المستوى 2.1 من واجهة برمجة التطبيقات وهو ذا صلة
التحميل المباشر:
المعلمات
preSharedKey:
مفتاح 256 بت يتم إنشاؤه عشوائيًا ويُستخدم لمصادقة
الكاميرا بواسطة التطبيق بعد اتصالهما بشبكة Wi-Fi للبنية الأساسية.
على سبيل المثال، يمكن استخدام RAND_bytes() من OpenSSL لإنشاء هذا.
- معرِّف SSID لشبكة Wi-Fi في
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 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-08-21 (حسب التوقيت العالمي المتفَّق عليه)"],[[["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"]]