/osc/state API ক্যামেরার state বৈশিষ্ট্য প্রদান করে। এটি এবং info API-এর মধ্যে পার্থক্য হল যে state ক্যামেরা স্ট্যাটাস (উদাহরণস্বরূপ batteryLevel ) প্রতিনিধিত্বকারী পরিবর্তনযোগ্য মান রয়েছে, যখন info ক্যামেরার শুধুমাত্র স্ট্যাটিক বৈশিষ্ট্য রয়েছে (উদাহরণস্বরূপ, manufacturer বা বৈশিষ্ট্যগুলি যা firmwareVersion) .
ইনপুট
এই কমান্ড কোন ইনপুট নেয় না.
আউটপুট
নাম
টাইপ
বর্ণনা
fingerprint
স্ট্রিং
বর্তমান ক্যামেরা অবস্থার আঙুলের ছাপ (অনন্য শনাক্তকারী)।
state
অবজেক্ট
ক্যামেরার বিভিন্ন অবস্থার স্থিতি সহ একটি JSON অবজেক্ট। পরবর্তী টেবিল দেখুন.
state বস্তু
এই JSON অবজেক্টটি বিভিন্ন ক্যামেরা স্টেটের অবস্থা প্রদান করে। ম্যানুফ্যাকচারাররা নতুন, কাস্টম স্টেট প্রদান করতে পারে, যা নামস্থানের সংঘর্ষ রোধ করার জন্য একটি আন্ডারস্কোর ( _ ) দিয়ে প্রিফিক্স করা উচিত।
নাম
টাইপ
বর্ণনা
sessionId
স্ট্রিং
বর্তমান সেশনের আইডি। এপিআই লেভেল 2-এ এই ক্ষেত্রটি বাতিল করা হয়েছে।
batteryLevel
সংখ্যা
অবশিষ্ট ব্যাটারির ফ্লোটিং পয়েন্ট মান হিসাবে প্রকাশ করা হয়, যেমন 0.5
storageChanged
বুলিয়ান
সত্য যদি একটি নতুন ধরনের সঞ্চয়স্থান (যেমন একটি SD কার্ড বা একটি USB ড্রাইভ) সন্নিবেশিত/মুছে ফেলা হয়৷ এপিআই লেভেল 2-এ এই ক্ষেত্রটি বাতিল করা হয়েছে।
storageUri
স্ট্রিং
বিভিন্ন স্টোরেজ আলাদা করার জন্য একটি অনন্য শনাক্তকারী। স্টোরেজ পরিবর্তন হয়েছে কি না তা জানাতে এটি ব্যবহার করা হয়। এই ক্ষেত্রটি API স্তর 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-11-13 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"]]