The following List Component commands use the DmiListComponentReq command block:
The format for the command block is: ┌──────────────────────────────────────────────────────────────────────────────┐│Table23
.DmiListComponentReqCommandBlock │
├───────────────┬───────────────┬───────────────┬──────────────────────────────┤
│ OFFSET │ SIZE │ TYPE │ VARIABLE NAME │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 0 │ 64 │ STRUCT │ DmiMgmtCommand │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 64 │ 4 │ INT │ iComponentId │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 68 │ 4 │ OFFSET │ osClassString │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 72 │ 4 │ INT │ iGroupKeyCount │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 76 │ 4 │ OFFSET │ oGroupKeyList │
└───────────────┴───────────────┴───────────────┴──────────────────────────────┘
Variable Name
DmiListComponentCmd
For example, if an application is looking for all component ID groups, it uses the string "DMTF|ComponentID|". Because the version string is missing, the service layer considers any version a match, as long as the first two fields match. If no filtering is desired, set this field to zero or to an empty class string ("||").
Issuing DmiListComponentReq displays an example of how to issue the DmiListComponentReq
command to the MI. IssuingDmiListComponentReq
ULONG IssueListComp(ULONG ComponentID,SHORT ListType) // issues the list component command to the SL
{
DMI_ListComponentReq_t *ListComp;
ULONG RC;
ListComp = (DMI_ListComponentReq_t *)malloc(sizeof(DMI_ListComponentReq_t));
memset((void *)ListComp,0,sizeof(DMI_ListComponentReq_t));
ListComp->DmiMgmtCommand.iLevelCheck = DMI_LEVEL_CHECK;
ListComp->DmiMgmtCommand.iMgmtHandle = YOUR_MGMT_HANDLE; // set the app handle
ListComp->DmiMgmtCommand.iCmdHandle = YOUR_COMMAND_HANDLE; // set the command handle
ListComp->DmiMgmtCommand.iCnfBufLen = 8000UL; // set the size of the response buffer
ListComp->DmiMgmtCommand.pCnfBuf = (void *)malloc(8000UL); // set up the response buffer
ListComp->DmiMgmtCommand.iRequestCount = 1;
ListComp->DmiMgmtCommand.iCmdLen = sizeof(DMI_ListComponentReq_t);
ListComp->iComponentId = ComponentID;
switch(ListType){
case 1:
ListComp->DmiMgmtCommand.iCommand = DmiListFirstComponentCmd; // set the command
break;
case 0:
ListComp->DmiMgmtCommand.iCommand = DmiListNextComponentCmd; // look for next one in list
break;
case 10:
ListComp->DmiMgmtCommand.iCommand = DmiListComponentCmd;
break;
}
if((RC = DmiInvoke((DMI_MgmtCommand_t *)ListComp)) != SLERR_NO_ERROR){ // call the SL and register
free(ListComp->DmiMgmtCommand.pCnfBuf); // free up the confirm buffer first
free(ListComp); // then free up the command block
}
return RC;
}