मुख्य कंटेंट तक स्किप करें

डिवाइस कंट्रोल का परिचय

यह भाग AIBuds SDK में डिवाइस के physical controls और उनसे जुड़ी functions की mapping पढ़ने व बदलने का तरीका बताता है।

सुविधाओं का परिचय

AI की सहायता से लागू करें

AI से बनाएँ

इस वर्कफ़्लो को AI से लागू करें

आधिकारिक “AIBuds भौतिक नियंत्रण प्रबंधित करें” स्किल से वर्कफ़्लो को अपने ऐप के अनुसार लागू करें।

https://docs-aibuds.github.io/hi/skills/manage-aibuds-physical-operations को पढ़ें और निर्देशों का पालन करें। इस स्किल से “AIBuds भौतिक नियंत्रण प्रबंधित करें” को इस iOS प्रोजेक्ट में लागू करें और परिणाम सत्यापित करें।
आधिकारिक स्किल देखें

शुरुआत करें

डिवाइस controls configure करने के लिए:

  1. Device connect करें - AIBuds device से connection बनाएँ
  2. Protocol support जाँचें - पुष्टि करें कि device DevicePhysicalOperationsAPI conform करता है
  3. Operation mapping देखें - physicalOperationsMapping पढ़ें
  4. Function assign करें - DeviceFunction को किसी DeviceOperation पर assign करें

मुख्य अवधारणाएँ

Control mapping

  • Device operations: DeviceOperation click, long press, touch-panel gesture, button और supported slide gesture को दर्शाता है
  • Device functions: DeviceFunction playback, volume, voice assistant, recording और camera जैसे assign किए जा सकने वाले behaviors define करता है
  • Mapping: physicalOperationsMapping operation और function के raw values को NSNumber key-value pairs में store करता है

Protocol reference

Device controls DevicePhysicalOperationsAPI से access होते हैं। Mapping पढ़ने या बदलने से पहले protocol conformance जाँचें:

Swift
guard let device = device as? DevicePhysicalOperationsAPI else {
    print("Device does not support DevicePhysicalOperationsAPI")
    return
}

बेहतर तरीके

  1. Protocol conformance जाँचें: हमेशा पुष्टि करें कि device required protocol support करता है
  2. Reported operations उपयोग करें: केवल physicalOperationsMapping में मौजूद operations दिखाएँ
  3. Errors संभालें: Completion handlers में सही error handling रखें
  4. Feedback दें: Control mapping सफलतापूर्वक update होने पर user को बताएँ

ध्यान देने योग्य बातें

  • Control mapping की उपलब्धता device model पर निर्भर है
  • DeviceOperation या DeviceFunction में enum case होने का अर्थ यह नहीं कि हर device उसे support करता है
  • Enum value मौजूद होने पर भी operation या function unsupported हो सकता है; assignment result संभालें
  • SDK KeyMapping model या asynchronous get-mapping method के बजाय dictionary expose करता है