NeXTSTEPDRIVERKIT:Chapter4 2: Difference between revisions

From 흡혈양파의 번역工房
Jump to navigation Jump to search
(NeXTSTEP DRIVER KIT 드라이버 설정하기 영문 내용 추가)
 
(NeXTSTEP DRIVER KIT 드라이버 설정하기 내용 추가)
 
Line 4: Line 4:


After you have built your driver, you need to configure it with the Configure application.<BR>
After you have built your driver, you need to configure it with the Configure application.<BR>
드라이버를 작성한 후에는 Configure 애플리케이션으로 드라이버를 구성해야합니다.






===Configure Application===
===Configure 애플리케이션===


You can configure devices and add drivers with the Configure application. When you select a device, Configure loads the device's inspector, which provides a user interface for manipulating the device configuration (choosing its DMA channels, for example). If you don't supply a device inspector for your driver, Configure uses a default device inspector. See the IODeviceInspector class and IOConfiguration protocol specifications for more information on device inspectors.<BR>
You can configure devices and add drivers with the Configure application. When you select a device, Configure loads the device's inspector, which provides a user interface for manipulating the device configuration (choosing its DMA channels, for example). If you don't supply a device inspector for your driver, Configure uses a default device inspector. See the IODeviceInspector class and IOConfiguration protocol specifications for more information on device inspectors.<BR>
Configure 응용 프로그램을 사용해서 장치를 구성하고 드라이버를 추가할 수 있습니다. 장치를 선택하면 Configure 애플리케이션은 장치 구성을 조작(manipulating)하기 위한 사용자 인터페이스를 제공하는 장치의 inspector 를 로드합니다(예를 들어 DMA 채널 선택). 드라이버에 장치 검사기(device inspector)를 제공하지 않으면 Configure 는 기본 장치 검사기를 사용합니다. 장치 검사기에 대한 자세한 내용은 IODeviceInspector 클래스 및 IOConfiguration 프로토콜 사양을 참조하십시오.




The Configure application reads the key/value pairs from a driver bundle's '''Default.table''' and displays them in a Configuration Inspector Panel. The user interface allows the user to change the displayed parameters and warns of possible value conflicts. When the user finishes modifying the configuration, Configure writes the updated configuration to the indicated '''Instance'''''n'''''.table''' and configures the driver based on the information in the configuration and kernel tables.<BR>
The Configure application reads the key/value pairs from a driver bundle's '''Default.table''' and displays them in a Configuration Inspector Panel. The user interface allows the user to change the displayed parameters and warns of possible value conflicts. When the user finishes modifying the configuration, Configure writes the updated configuration to the indicated '''Instance'''''n'''''.table''' and configures the driver based on the information in the configuration and kernel tables.<BR>
Configure 애플리케이션은 드라이버 번들(bundle)의 '''Default.table''' 에서 key/value 쌍을 읽고 이를 Configuration 검사기 패널(Inspector Panel)에 표시합니다. 사용자 인터페이스를 통해 사용자는 표시된 매개 변수를 변경할 수 있으며 발생 가능한 값 충돌(value conflicts)에 대해 경고합니다. 사용자가 설정 수정(modifying the configuration)을 완료하면, Configure 는 표시된 '''Instance'''''n'''''.table''' 에 업데이트된 설정을 기록하고 설정 및 커널 테이블의 정보를 기반으로 드라이버를 구성합니다.




When the system starts up, the kernel uses an IOConfigTable object to parse the configuration information in the '''Instance'''''n'''''.table'''. From this information, the kernel instantiates an IODeviceDescription object, which encapsulates information about the driver. The kernel passes the IODeviceDescription object as the parameter to the '''probe:''' method, which instantiates the driver object based on this information.<BR>
When the system starts up, the kernel uses an IOConfigTable object to parse the configuration information in the '''Instance'''''n'''''.table'''. From this information, the kernel instantiates an IODeviceDescription object, which encapsulates information about the driver. The kernel passes the IODeviceDescription object as the parameter to the '''probe:''' method, which instantiates the driver object based on this information.<BR>
시스템이 시작되면 커널은 IOConfigTable 객체를 사용하여 '''Instance'''''n'''''.table''' 의 설정 정보를 구문 분석합니다. 이 정보를 통해 커널은 IODeviceDescription 객체를 인스턴스화 하는데, 이 객체는 드라이버에 대한 정보를 캡슐화합니다. 커널은 IODeviceDescription 객체를 매개 변수로 '''probe:''' 메서드에 전달하는데, 이 메서드는 이 정보를 기반으로 드라이버 객체를 인스턴스화합니다.




There's a list of standard key/value configuration pairs in the "Configuration Keys" section in the Appendix.<BR>
There's a list of standard key/value configuration pairs in the "Configuration Keys" section in the Appendix.<BR>
 
부록의 "Configuration Keys" 섹션에는 표준 key/value 설정 쌍 목록이 있습니다.




----
----
'''How Configuring Kernel-Level Driver Kit Drivers Differs from Configuring Other Loadable Kernel Servers'''<BR>
'''How Configuring Kernel-Level Driver Kit Drivers Differs from Configuring Other Loadable Kernel Servers'''<BR>
'''커널 수준 Driver Kit 드라이버 구성이 다른 로드 가능한 커널 서버 구성과 다른 점'''




The configuration of Driver Kit kernel-level drivers differs from that of other Loadable Kernel Servers (LKSs) in the following ways:<BR>
The configuration of Driver Kit kernel-level drivers differs from that of other Loadable Kernel Servers (LKSs) in the following ways:<BR>
Driver Kit 커널 수준 드라이버의 구성은 다른 로드 가능한 커널 서버 (LKS)의 구성에 비해 다음과 같은 점이 다릅니다:


* Each Driver Kit driver has its own configuration directory under '''/NextLibrary/Devices'''. Other LKSs have no standard way of getting configuration information.<BR>
* Each Driver Kit driver has its own configuration directory under '''/NextLibrary/Devices'''. Other LKSs have no standard way of getting configuration information.<BR>각 Driver Kit 드라이버는 '''/NextLibrary/Devices''' 아래에 자체 설정 디렉토리가 있습니다. 다른 LKS 에는 설정 정보를 가져 오는 표준 방법이 없습니다.
* With the Configure application, users can add Driver Kit drivers to the system, as well as specify configuration information for each driver. Other LKSs are generally added to the system by adding a line to '''/etc/kern_loader.conf'''.<BR>
* With the Configure application, users can add Driver Kit drivers to the system, as well as specify configuration information for each driver. Other LKSs are generally added to the system by adding a line to '''/etc/kern_loader.conf'''.<BR>Configure 애플리케이션을 사용하면 사용자는 Driver Kit 드라이버를 시스템에 추가 할 수 있을 뿐만 아니라 각 드라이버에 대한 설정 정보(configuration information)를 지정할 수 있습니다. 다른 LKS 는 일반적으로 '''/etc/kern_loader.conf''' 에 라인(string)을 추가해서 시스템에 추가됩니다.
* Driver Kit drivers are allocated and loaded with the '''driverLoader''' command, which uses the information in the driver's configuration directory. You can load an LKS with the kernel-server utility, '''kl_util''', but it doesn't cause the driver to be probed.<BR>
* Driver Kit drivers are allocated and loaded with the '''driverLoader''' command, which uses the information in the driver's configuration directory. You can load an LKS with the kernel-server utility, '''kl_util''', but it doesn't cause the driver to be probed.<BR>Driver Kit 드라이버는 드라이버의 구성 디렉토리에 있는 정보를 사용하는 '''driverLoader''' 명령으로 할당되고 로드됩니다. kernel-server 유틸리티인 '''kl_util''' 를 사용해서 LKS 를 로드할 수는 있지만 드라이버가 조사(probed)되지는 않습니다.
* Driver Kit drivers can't currently be unloaded, unlike other LKSs. For example, if you want to change a driver that's already running, you must restart the system to be able to load the new driver.<BR>
* Driver Kit drivers can't currently be unloaded, unlike other LKSs. For example, if you want to change a driver that's already running, you must restart the system to be able to load the new driver.<BR>Driver Kit 드라이버는 다른 LKS 와 달리 현재 언로드 할 수 없습니다. 예를 들어, 이미 실행중인 드라이버를 변경하려면 새 드라이버를 로드할 수 있도록 시스템을 다시 시작해야합니다.
----
----






===Writing a Custom Inspector===
===사용자 정의 관리자 작성하기(Writing a Custom Inspector)===


The Configure application uses inspectors to configure a driver. With the default inspector in Configure, you can configure values that belong to the standard set of keys with no further implementation effort. If you've added custom parameters, however, you need to implement a custom inspector to view and modify them.<BR>
The Configure application uses inspectors to configure a driver. With the default inspector in Configure, you can configure values that belong to the standard set of keys with no further implementation effort. If you've added custom parameters, however, you need to implement a custom inspector to view and modify them.<BR>
Configure 애플리케이션은 검사기(inspectors)를 사용해서 드라이버를 설정(configure)합니다. Configure 기본 검사기(default inspector)를 사용하면 추가 구현 노력없이 표준 키 세트에 속한 값을 구성할 수 있습니다. 그러나 맞춤 매개 변수(custom parameters)를 추가한 경우 맞춤 속성을 보거나 수정해야 합니다.




You have two choices in implementing a custom inspector:<BR>
You have two choices in implementing a custom inspector:<BR>
   
사용자 정의 검사기(custom inspector)를 구현하는 데는 두 가지 방법이 있습니다:
* Add an accessory view to the inspector, with an 80-pixel height limit.<BR>
 
* Replace the standard inspector completely. You're still limited to a 640480 view. However, you can use a button to display a panel if you run out of space.<BR>
* Add an accessory view to the inspector, with an 80-pixel height limit.<BR>80 픽셀 높이 제한으로 검사기에 accessory view 를 추가합니다.
* Replace the standard inspector completely. You're still limited to a 640x480 view. However, you can use a button to display a panel if you run out of space.<BR>표준 검사기(standard inspector )를 완전히 교체하십시오. 여전히 640x480 보기로 제한됩니다. 그러나 공간이 부족하면 버튼을 사용햐서 패널을 표시할 수 있습니다.
 


You implement an inspector by creating a subclass of IODeviceInspector. For example, you can create a subclass of IODisplayInspector (a subclass of IODeviceInspector) to implement a display inspector. For an example, study the inspector in '''/NextLibrary/Documentation/NextDev/Examples/DriverKit/DriverInspector'''.<BR>
You implement an inspector by creating a subclass of IODeviceInspector. For example, you can create a subclass of IODisplayInspector (a subclass of IODeviceInspector) to implement a display inspector. For an example, study the inspector in '''/NextLibrary/Documentation/NextDev/Examples/DriverKit/DriverInspector'''.<BR>
IODeviceInspector 의 하위 클래스를 만들어 검사기를 구현합니다. 예를 들어 IODisplayInspector(IODeviceInspector의 하위 클래스) 의 하위 클래스를 만들어 표시 속성을 구현할 수 있습니다.예를 들어, '''/NextLibrary/Documentation/NextDev/Examples/DriverKit/DriverInspector''' 의 검사기를 연구하십시오.




Other classes relevant to creating an inspector include IOAddressRanger, IODeviceDescription, IODeviceMaster, and IOEISADeviceDescription. Some of these classes adopt the IOConfigurationInspector protocol.<BR>
Other classes relevant to creating an inspector include IOAddressRanger, IODeviceDescription, IODeviceMaster, and IOEISADeviceDescription. Some of these classes adopt the IOConfigurationInspector protocol.<BR>
검사기(inspector) 생성과 관련된 다른 클래스에는 IOAddressRanger, IODeviceDescription, IODeviceMaster 및 IOEISADeviceDescription 이 있습니다. 이러한 클래스 중 일부는 IOConfigurationInspector 프로토콜을 채택합니다.




 
===검사기 생성(Creating an Inspector)===
===Creating an Inspector===


Override the following methods in the IODeviceInspector class and the IOConfigurationInspector protocol:<BR>
Override the following methods in the IODeviceInspector class and the IOConfigurationInspector protocol:<BR>
IODeviceInspector 클래스 및 IOConfigurationInspector 프로토콜에서 다음 메서드를 재정의(Override)하십시오:


* '''init'''. Find and load the nib file that contains the accessory view using the bundle for your inspector. Initialize the user interface and find your driver.<BR>
* '''init'''. Find and load the nib file that contains the accessory view using the bundle for your inspector. Initialize the user interface and find your driver.<BR>'''init'''. 인스펙터의 bundle 을 사용해서 accessory view 가 포함 된 nib 파일을 찾아 로드하십시오. 사용자 인터페이스를 초기화하고 드라이버를 찾으십시오.
* '''inspectionView'''. Override this if you're replacing the standard inspector.<BR>
* '''inspectionView'''. Override this if you're replacing the standard inspector.<BR>'''inspectionView'''. 표준 속성을 바꾸려면 이 옵션을 무시하십시오.
* '''setTable:'''. Invoke the superclass's implementation:<BR><syntaxhighlight lang="objc">
* '''setTable:'''. Invoke the superclass's implementation:<BR>'''setTable:'''. 상위 클래스의 구현 호출:<syntaxhighlight lang="objc">
* [super setTable:]
* [super setTable:]
</syntaxhighlight>Invoke '''setAccessoryView:''' to specify and initialize the accessory View. Initialize the user interface settings from the table being inspected.<BR>
</syntaxhighlight>Invoke '''setAccessoryView:''' to specify and initialize the accessory View. Initialize the user interface settings from the table being inspected.<BR>'''setAccessoryView:''' 를 호출해서 accessory View 를 지정하고 초기화합니다. 검사할 테이블에서 사용자 인터페이스 설정을 초기화하십시오.
* '''resourcesChanged:'''. Update the user interface in response to resources being chosen or dropped in the inspector.<BR>
* '''resourcesChanged:'''. Update the user interface in response to resources being chosen or dropped in the inspector.<BR>'''resourcesChanged:'''. 검사기가 선택하거나 삭제한 리소스에 대한 응답으로 사용자 인터페이스를 업데이트 하십시오.






===Modifying Custom Parameters===
===사용자 지정 매개 변수 수정(Modifying Custom Parameters)===


Implement a set of target/action methods to change the custom parameters. The user interface elements of the inspector invokes these methods. Convert the new parameter state to an appropriate string value for display, and insert it into the inspected table with '''insertKey:value:'''. The key must be a unique string, and you can use the '''NXUniqueString()''' function to generate a unique key based on the string argument. The value should be a copy--use '''NXCopyStringBuffer()''' to copy it:<BR>
Implement a set of target/action methods to change the custom parameters. The user interface elements of the inspector invokes these methods. Convert the new parameter state to an appropriate string value for display, and insert it into the inspected table with '''insertKey:value:'''. The key must be a unique string, and you can use the '''NXUniqueString()''' function to generate a unique key based on the string argument. The value should be a copy--use '''NXCopyStringBuffer()''' to copy it:<BR>
사용자 정의 매개 변수를 변경하기 위한 일련의 target/action 메소드를 구현하십시오. Inspector 의 사용자 인터페이스 요소는 이러한 메소드를 호출합니다. 새 매개 변수 상태를 표시하려는 적절한 문자열 값으로 변환하고 '''insertKey:value:''' 를 사용하여 검사(inspected)된 테이블에 삽입합니다. 키는 고유한 문자열(unique string) 이어야 하며 '''NXUniqueString()''' 함수를 사용해서 문자열 인수를 기반으로 고유한 키(unique key)를 생성 할 수 있습니다. 값은 '''NXCopyStringBuffer()''' 을 사용해서 복사되어야 합니다:


<syntaxhighlight lang="objc">
<syntaxhighlight lang="objc">
Line 76: Line 88:




===Changing Driver Parameters with IODeviceMaster===
===IODeviceMast 로 드라이버 매개 변수 변경(Changing Driver Parameters with IODeviceMaster)===


Besides Configure, another way to change parameters associated with a driver is through the IODeviceMaster class, which provides access to a driver instance. First, find your driver using the '''lookUpByDeviceName:objectNumber:deviceKind:''' method. Then manipulate parameters associated with that instance with these methods:<BR>
Besides Configure, another way to change parameters associated with a driver is through the IODeviceMaster class, which provides access to a driver instance. First, find your driver using the '''lookUpByDeviceName:objectNumber:deviceKind:''' method. Then manipulate parameters associated with that instance with these methods:<BR>
Configure 외에도 드라이버와 관련된 매개 변수를 변경하는 또 다른 방법은, 드라이버 인스턴스에 대한 접근을 제공하는 IODeviceMaster 클래스를 사용하는 것입니다. 먼저 '''lookUpByDeviceName:objectNumber:deviceKind:''' 메소드를 사용하여 드라이버를 찾으십시오. 그런 다음이 메소드로 해당 인스턴스와 관련된 매개 변수를 조작하십시오.


* '''getCharValues:forParameter:objectNumber:count:'''
* '''getCharValues:forParameter:objectNumber:count:'''
Line 84: Line 97:
* '''getIntValues:forParameter:objectNumber:count:'''
* '''getIntValues:forParameter:objectNumber:count:'''
* '''setIntValues:forParameter:objectNumber:count:'''
* '''setIntValues:forParameter:objectNumber:count:'''


Active driver values should be displayed in the user interface--even if they differ from the current configuration table values. If you want the values you change to persist beyond the time the system is powered off or restarted, you must write them to the configuration table.<BR>
Active driver values should be displayed in the user interface--even if they differ from the current configuration table values. If you want the values you change to persist beyond the time the system is powered off or restarted, you must write them to the configuration table.<BR>
활성 드라이버 값(Active driver values)은 현재 설정 테이블 값과 다르더라도 사용자 인터페이스에 표시되어야 합니다. 변경한 값을 시스템의 전원을 t거나 다시 시작한 시간 이상으로 유지하려면 구성 테이블에 값을 기록해야합니다. 변경한 값을 시스템의 전원을 끄거나 다시 시작한 시간외에도 유지하려면 구성 테이블에 값을 기록해야 합니다.

Latest revision as of 15:11, 11 October 2017

Configuring Drivers

드라이버 설정하기(Configuring Drivers)

After you have built your driver, you need to configure it with the Configure application.
드라이버를 작성한 후에는 Configure 애플리케이션으로 드라이버를 구성해야합니다.


Configure 애플리케이션

You can configure devices and add drivers with the Configure application. When you select a device, Configure loads the device's inspector, which provides a user interface for manipulating the device configuration (choosing its DMA channels, for example). If you don't supply a device inspector for your driver, Configure uses a default device inspector. See the IODeviceInspector class and IOConfiguration protocol specifications for more information on device inspectors.
Configure 응용 프로그램을 사용해서 장치를 구성하고 드라이버를 추가할 수 있습니다. 장치를 선택하면 Configure 애플리케이션은 장치 구성을 조작(manipulating)하기 위한 사용자 인터페이스를 제공하는 장치의 inspector 를 로드합니다(예를 들어 DMA 채널 선택). 드라이버에 장치 검사기(device inspector)를 제공하지 않으면 Configure 는 기본 장치 검사기를 사용합니다. 장치 검사기에 대한 자세한 내용은 IODeviceInspector 클래스 및 IOConfiguration 프로토콜 사양을 참조하십시오.


The Configure application reads the key/value pairs from a driver bundle's Default.table and displays them in a Configuration Inspector Panel. The user interface allows the user to change the displayed parameters and warns of possible value conflicts. When the user finishes modifying the configuration, Configure writes the updated configuration to the indicated Instancen.table and configures the driver based on the information in the configuration and kernel tables.
Configure 애플리케이션은 드라이버 번들(bundle)의 Default.table 에서 key/value 쌍을 읽고 이를 Configuration 검사기 패널(Inspector Panel)에 표시합니다. 사용자 인터페이스를 통해 사용자는 표시된 매개 변수를 변경할 수 있으며 발생 가능한 값 충돌(value conflicts)에 대해 경고합니다. 사용자가 설정 수정(modifying the configuration)을 완료하면, Configure 는 표시된 Instancen.table 에 업데이트된 설정을 기록하고 설정 및 커널 테이블의 정보를 기반으로 드라이버를 구성합니다.


When the system starts up, the kernel uses an IOConfigTable object to parse the configuration information in the Instancen.table. From this information, the kernel instantiates an IODeviceDescription object, which encapsulates information about the driver. The kernel passes the IODeviceDescription object as the parameter to the probe: method, which instantiates the driver object based on this information.
시스템이 시작되면 커널은 IOConfigTable 객체를 사용하여 Instancen.table 의 설정 정보를 구문 분석합니다. 이 정보를 통해 커널은 IODeviceDescription 객체를 인스턴스화 하는데, 이 객체는 드라이버에 대한 정보를 캡슐화합니다. 커널은 IODeviceDescription 객체를 매개 변수로 probe: 메서드에 전달하는데, 이 메서드는 이 정보를 기반으로 드라이버 객체를 인스턴스화합니다.


There's a list of standard key/value configuration pairs in the "Configuration Keys" section in the Appendix.
부록의 "Configuration Keys" 섹션에는 표준 key/value 설정 쌍 목록이 있습니다.



How Configuring Kernel-Level Driver Kit Drivers Differs from Configuring Other Loadable Kernel Servers
커널 수준 Driver Kit 드라이버 구성이 다른 로드 가능한 커널 서버 구성과 다른 점


The configuration of Driver Kit kernel-level drivers differs from that of other Loadable Kernel Servers (LKSs) in the following ways:
Driver Kit 커널 수준 드라이버의 구성은 다른 로드 가능한 커널 서버 (LKS)의 구성에 비해 다음과 같은 점이 다릅니다:

  • Each Driver Kit driver has its own configuration directory under /NextLibrary/Devices. Other LKSs have no standard way of getting configuration information.
    각 Driver Kit 드라이버는 /NextLibrary/Devices 아래에 자체 설정 디렉토리가 있습니다. 다른 LKS 에는 설정 정보를 가져 오는 표준 방법이 없습니다.
  • With the Configure application, users can add Driver Kit drivers to the system, as well as specify configuration information for each driver. Other LKSs are generally added to the system by adding a line to /etc/kern_loader.conf.
    Configure 애플리케이션을 사용하면 사용자는 Driver Kit 드라이버를 시스템에 추가 할 수 있을 뿐만 아니라 각 드라이버에 대한 설정 정보(configuration information)를 지정할 수 있습니다. 다른 LKS 는 일반적으로 /etc/kern_loader.conf 에 라인(string)을 추가해서 시스템에 추가됩니다.
  • Driver Kit drivers are allocated and loaded with the driverLoader command, which uses the information in the driver's configuration directory. You can load an LKS with the kernel-server utility, kl_util, but it doesn't cause the driver to be probed.
    Driver Kit 드라이버는 드라이버의 구성 디렉토리에 있는 정보를 사용하는 driverLoader 명령으로 할당되고 로드됩니다. kernel-server 유틸리티인 kl_util 를 사용해서 LKS 를 로드할 수는 있지만 드라이버가 조사(probed)되지는 않습니다.
  • Driver Kit drivers can't currently be unloaded, unlike other LKSs. For example, if you want to change a driver that's already running, you must restart the system to be able to load the new driver.
    Driver Kit 드라이버는 다른 LKS 와 달리 현재 언로드 할 수 없습니다. 예를 들어, 이미 실행중인 드라이버를 변경하려면 새 드라이버를 로드할 수 있도록 시스템을 다시 시작해야합니다.


사용자 정의 관리자 작성하기(Writing a Custom Inspector)

The Configure application uses inspectors to configure a driver. With the default inspector in Configure, you can configure values that belong to the standard set of keys with no further implementation effort. If you've added custom parameters, however, you need to implement a custom inspector to view and modify them.
Configure 애플리케이션은 검사기(inspectors)를 사용해서 드라이버를 설정(configure)합니다. Configure 기본 검사기(default inspector)를 사용하면 추가 구현 노력없이 표준 키 세트에 속한 값을 구성할 수 있습니다. 그러나 맞춤 매개 변수(custom parameters)를 추가한 경우 맞춤 속성을 보거나 수정해야 합니다.


You have two choices in implementing a custom inspector:
사용자 정의 검사기(custom inspector)를 구현하는 데는 두 가지 방법이 있습니다:

  • Add an accessory view to the inspector, with an 80-pixel height limit.
    80 픽셀 높이 제한으로 검사기에 accessory view 를 추가합니다.
  • Replace the standard inspector completely. You're still limited to a 640x480 view. However, you can use a button to display a panel if you run out of space.
    표준 검사기(standard inspector )를 완전히 교체하십시오. 여전히 640x480 보기로 제한됩니다. 그러나 공간이 부족하면 버튼을 사용햐서 패널을 표시할 수 있습니다.


You implement an inspector by creating a subclass of IODeviceInspector. For example, you can create a subclass of IODisplayInspector (a subclass of IODeviceInspector) to implement a display inspector. For an example, study the inspector in /NextLibrary/Documentation/NextDev/Examples/DriverKit/DriverInspector.
IODeviceInspector 의 하위 클래스를 만들어 검사기를 구현합니다. 예를 들어 IODisplayInspector(IODeviceInspector의 하위 클래스) 의 하위 클래스를 만들어 표시 속성을 구현할 수 있습니다.예를 들어, /NextLibrary/Documentation/NextDev/Examples/DriverKit/DriverInspector 의 검사기를 연구하십시오.


Other classes relevant to creating an inspector include IOAddressRanger, IODeviceDescription, IODeviceMaster, and IOEISADeviceDescription. Some of these classes adopt the IOConfigurationInspector protocol.
검사기(inspector) 생성과 관련된 다른 클래스에는 IOAddressRanger, IODeviceDescription, IODeviceMaster 및 IOEISADeviceDescription 이 있습니다. 이러한 클래스 중 일부는 IOConfigurationInspector 프로토콜을 채택합니다.


검사기 생성(Creating an Inspector)

Override the following methods in the IODeviceInspector class and the IOConfigurationInspector protocol:
IODeviceInspector 클래스 및 IOConfigurationInspector 프로토콜에서 다음 메서드를 재정의(Override)하십시오:

  • init. Find and load the nib file that contains the accessory view using the bundle for your inspector. Initialize the user interface and find your driver.
    init. 인스펙터의 bundle 을 사용해서 accessory view 가 포함 된 nib 파일을 찾아 로드하십시오. 사용자 인터페이스를 초기화하고 드라이버를 찾으십시오.
  • inspectionView. Override this if you're replacing the standard inspector.
    inspectionView. 표준 속성을 바꾸려면 이 옵션을 무시하십시오.
  • setTable:. Invoke the superclass's implementation:
    setTable:. 상위 클래스의 구현 호출:
    * [super setTable:]
    
    Invoke setAccessoryView: to specify and initialize the accessory View. Initialize the user interface settings from the table being inspected.
    setAccessoryView: 를 호출해서 accessory View 를 지정하고 초기화합니다. 검사할 테이블에서 사용자 인터페이스 설정을 초기화하십시오.
  • resourcesChanged:. Update the user interface in response to resources being chosen or dropped in the inspector.
    resourcesChanged:. 검사기가 선택하거나 삭제한 리소스에 대한 응답으로 사용자 인터페이스를 업데이트 하십시오.


사용자 지정 매개 변수 수정(Modifying Custom Parameters)

Implement a set of target/action methods to change the custom parameters. The user interface elements of the inspector invokes these methods. Convert the new parameter state to an appropriate string value for display, and insert it into the inspected table with insertKey:value:. The key must be a unique string, and you can use the NXUniqueString() function to generate a unique key based on the string argument. The value should be a copy--use NXCopyStringBuffer() to copy it:
사용자 정의 매개 변수를 변경하기 위한 일련의 target/action 메소드를 구현하십시오. Inspector 의 사용자 인터페이스 요소는 이러한 메소드를 호출합니다. 새 매개 변수 상태를 표시하려는 적절한 문자열 값으로 변환하고 insertKey:value: 를 사용하여 검사(inspected)된 테이블에 삽입합니다. 키는 고유한 문자열(unique string) 이어야 하며 NXUniqueString() 함수를 사용해서 문자열 인수를 기반으로 고유한 키(unique key)를 생성 할 수 있습니다. 값은 NXCopyStringBuffer() 을 사용해서 복사되어야 합니다:

[table insertKey:key value:NXCopyStringBuffer(value)];


IODeviceMast 로 드라이버 매개 변수 변경(Changing Driver Parameters with IODeviceMaster)

Besides Configure, another way to change parameters associated with a driver is through the IODeviceMaster class, which provides access to a driver instance. First, find your driver using the lookUpByDeviceName:objectNumber:deviceKind: method. Then manipulate parameters associated with that instance with these methods:
Configure 외에도 드라이버와 관련된 매개 변수를 변경하는 또 다른 방법은, 드라이버 인스턴스에 대한 접근을 제공하는 IODeviceMaster 클래스를 사용하는 것입니다. 먼저 lookUpByDeviceName:objectNumber:deviceKind: 메소드를 사용하여 드라이버를 찾으십시오. 그런 다음이 메소드로 해당 인스턴스와 관련된 매개 변수를 조작하십시오.

  • getCharValues:forParameter:objectNumber:count:
  • setCharValues:forParameter:objectNumber:count:
  • getIntValues:forParameter:objectNumber:count:
  • setIntValues:forParameter:objectNumber:count:


Active driver values should be displayed in the user interface--even if they differ from the current configuration table values. If you want the values you change to persist beyond the time the system is powered off or restarted, you must write them to the configuration table.
활성 드라이버 값(Active driver values)은 현재 설정 테이블 값과 다르더라도 사용자 인터페이스에 표시되어야 합니다. 변경한 값을 시스템의 전원을 t거나 다시 시작한 시간 이상으로 유지하려면 구성 테이블에 값을 기록해야합니다. 변경한 값을 시스템의 전원을 끄거나 다시 시작한 시간외에도 유지하려면 구성 테이블에 값을 기록해야 합니다.