Instrumentation is program code that the Service Layer starts. The code can be a run-time program that requests attribute values. The code could also be a direct interface program. The direct interface program runs on the system and is connected to the Service Layer.
Use run-time programs for products that provide transitory data or that are not associated with a device driver that is loaded in RAM. Use run-time programs for background tasks such as the system BIOS.
Use direct interface programs when the system requires persistent data for products that use device drivers or background programs.
All instrumentation code should include the header file DMIAPI.H.
Instrumentation code that the Service Layer starts must provide one value at a time. The code must be able to handle the following DMI commands that are accessed through the DmiCiInvoke call from the Service Layer:
Every command must call the pConfirmFunc function, including the set commands and the commands that generate errors. When you use the DmiGetRowCmd command, the Service Layer builds the DmiGetRowCnf structure prior to calling DmiCiInvoke. In addition, the GroupKeyData structures are allocated and the oGroupKeyList slot in the DmiGetRowCnf structure is filled in. Any instrumentation code you provide must change only the confirm buffer, not the DmiInvoke command buffer.
The DMI procedure library (DMIAPI) is part of the Toolkit and provides a simple method of handling these constraints. The Component Interface outline makes use of DMIAPI. If you use the outline program as the basis for your instrumentation program, you need only write the five outlined procedures. When you use the outline program, you do not need to consider any of the issues above.