डिवाइस कंट्रोल का परिचय
यह भाग AIBuds SDK में डिवाइस के physical controls और उनसे जुड़ी functions की mapping पढ़ने व बदलने का तरीका बताता है।
सुविधाओं का परिचय
ऑपरेशन और फ़ंक्शन
SDK के physical operations और assign किए जा सकने वाले functions समझें
Operation mapping देखें
Device operation से function की mapping पढ़ें
Function assignment
Device operation को function assign करें
AI की सहायता से लागू करें
AI से बनाएँ
इस वर्कफ़्लो को AI से लागू करें
आधिकारिक “AIBuds भौतिक नियंत्रण प्रबंधित करें” स्किल से वर्कफ़्लो को अपने ऐप के अनुसार लागू करें।
https://docs-aibuds.github.io/hi/skills/manage-aibuds-physical-operations को पढ़ें और निर्देशों का पालन करें। इस स्किल से “AIBuds भौतिक नियंत्रण प्रबंधित करें” को इस iOS प्रोजेक्ट में लागू करें और परिणाम सत्यापित करें।शुरुआत करें
डिवाइस controls configure करने के लिए:
- Device connect करें - AIBuds device से connection बनाएँ
- Protocol support जाँचें - पुष्टि करें कि device
DevicePhysicalOperationsAPIconform करता है - Operation mapping देखें -
physicalOperationsMappingपढ़ें - Function assign करें -
DeviceFunctionको किसीDeviceOperationपर assign करें
मुख्य अवधारणाएँ
Control mapping
- Device operations:
DeviceOperationclick, long press, touch-panel gesture, button और supported slide gesture को दर्शाता है - Device functions:
DeviceFunctionplayback, volume, voice assistant, recording और camera जैसे assign किए जा सकने वाले behaviors define करता है - Mapping:
physicalOperationsMappingoperation और function के raw values कोNSNumberkey-value pairs में store करता है
Protocol reference
Device controls DevicePhysicalOperationsAPI से access होते हैं। Mapping पढ़ने या बदलने से पहले protocol conformance जाँचें:
- Swift
- Objective-C
guard let device = device as? DevicePhysicalOperationsAPI else {
print("Device does not support DevicePhysicalOperationsAPI")
return
}id<AIBudsDevicePhysicalOperationsAPI> device =
(id<AIBudsDevicePhysicalOperationsAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsDevicePhysicalOperationsAPI)]) {
NSLog(@"Device does not support AIBudsDevicePhysicalOperationsAPI");
return;
}बेहतर तरीके
- Protocol conformance जाँचें: हमेशा पुष्टि करें कि device required protocol support करता है
- Reported operations उपयोग करें: केवल
physicalOperationsMappingमें मौजूद operations दिखाएँ - Errors संभालें: Completion handlers में सही error handling रखें
- Feedback दें: Control mapping सफलतापूर्वक update होने पर user को बताएँ
ध्यान देने योग्य बातें
- Control mapping की उपलब्धता device model पर निर्भर है
DeviceOperationयाDeviceFunctionमें enum case होने का अर्थ यह नहीं कि हर device उसे support करता है- Enum value मौजूद होने पर भी operation या function unsupported हो सकता है; assignment result संभालें
- SDK
KeyMappingmodel या asynchronous get-mapping method के बजाय dictionary expose करता है