/osc/state एपीआई, कैमरे के state एट्रिब्यूट दिखाता है. अंतर
इससे और info एपीआई के बीच यह बताना ज़रूरी है कि state में बदली जा सकने वाली वैल्यू हैं
कैमरे की स्थिति दिखा रहा है (उदाहरण के लिए, batteryLevel), जबकि info
इसमें कैमरे के सिर्फ़ स्टैटिक एट्रिब्यूट मौजूद होते हैं. उदाहरण के लिए, manufacturer या
एट्रिब्यूट जो अक्सर नहीं बदलते हैं, जैसे कि firmwareVersion).
इनपुट
यह निर्देश कोई इनपुट नहीं लेता है.
आउटपुट
नाम
स्ट्रीम किस तरह की है
जानकारी
fingerprint
स्ट्रिंग
कैमरे की मौजूदा स्थिति का फ़िंगरप्रिंट (यूनीक आइडेंटिफ़ायर).
state
ऑब्जेक्ट
JSON ऑब्जेक्ट, जिसमें कैमरे की अलग-अलग स्थितियों के बारे में जानकारी दी गई है. अगली टेबल देखें.
state ऑब्जेक्ट
यह JSON ऑब्जेक्ट, कैमरे की अलग-अलग स्थितियों की जानकारी देता है. निर्माता यह कर सकते हैं
नई, कस्टम स्थितियां प्रदान करें, जिनके अंत में अंडरस्कोर ( _ ) लगाया जाना चाहिए
का इस्तेमाल करें.
नाम
स्ट्रीम किस तरह की है
जानकारी
sessionId
स्ट्रिंग
मौजूदा सेशन का आईडी. इस फ़ील्ड को एपीआई लेवल 2 में बंद कर दिया गया था.
batteryLevel
नंबर
बची हुई बैटरी के फ़्लोटिंग पॉइंट वैल्यू के तौर पर दिखाया जाता है, जैसे कि 0.5
storageChanged
बूलियन
नए तरह का स्टोरेज (जैसे कि एसडी कार्ड या यूएसबी ड्राइव) शामिल किए जाने या हटाए जाने पर, यह 'सही' होगा.
इस फ़ील्ड को एपीआई लेवल 2 में बंद कर दिया गया था.
storageUri
स्ट्रिंग
अलग-अलग स्टोरेज में अंतर करने के लिए यूनीक आइडेंटिफ़ायर. इसका इस्तेमाल यह बताने के लिए किया जाता है कि स्टोरेज बदल गया है या नहीं.
इस फ़ील्ड को एपीआई लेवल 2 में जोड़ा गया था.
_vendorSpecific
[टाइप](ज़रूरी नहीं)
वेंडर के हिसाब से कैमरे के बारे में अतिरिक्त जानकारी. नेमस्पेस के टकराव से बचने के लिए, अंडरस्कोर ( _ ) के शुरू में लगाएं.
गड़बड़ी
यह निर्देश कोई गड़बड़ी नहीं दिखाता है.
उदाहरण
अनुरोध करें
POST /osc/state HTTP/1.1 Host:[camera ip address]:[httpPort] Accept: application/json X-XSRF-Protected:1
जवाब
HTTP/1.1200 OK Content-Type: application/json;charset=utf-8 Content-Length:{CONTENT_LENGTH} X-Content-Type-Options: nosniff
[null,null,["आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया."],[[["The `/osc/state` API provides mutable camera status values like battery level, unlike the `/osc/info` API which returns static camera attributes."],["Camera state is represented by a `fingerprint` that uniquely identifies it and changes whenever a tracked state is modified."],["The `state` object contains various camera status details, including `batteryLevel`, storage information, and vendor-specific data."],["Manufacturers can introduce custom states within the `state` object using an underscore (_) prefix to avoid conflicts."]]],["The `/osc/state` API retrieves mutable camera status attributes. It outputs a `fingerprint`, a unique identifier for the current camera state, and a `state` object. The `state` object includes `batteryLevel`, `storageUri` and optional vendor-specific states prefixed with an underscore. It also contained `sessionId` and `storageChanged` which have been deprecated. The API uses POST and the response has a `200 OK` HTTP status with a content-type of `application/json`. The fingerprint changes with any tracked state change.\n"]]