The following List Description commands use the DmiListDescReq command block:
The format for the command block is: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³Table33
.DmiListDescReqCommandBlock ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ OFFSET ³ SIZE ³ TYPE ³ VARIABLE NAME ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 0 ³ 64 ³ STRUCT ³ DmiMgmtCommand ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 64 ³ 4 ³ INT ³ iComponentId ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 68 ³ 4 ³ INT ³ iGroupId ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 72 ³ 4 ³ INT ³ iAttributeId ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 76 ³ 4 ³ INT ³ iOffset ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Variable Name
DmiListComponentDescCmd
On return, the service layer updates this field with the index of the last character written into the confirm buffer and sets iStatus accordingly. If iStatus indicates that there are more characters to be received, the application can re-issue the call to get more of the description text.
On return from this call, the confirm buffer contains the text from the description associated with the entity requested. In the command block, iCnfCount is always set to 1.
Issuing DmiListDescReq displays an example of how to issue the DmiListDescReq
command to the MI. IssuingDmiListDescReq
ULONG IssueLoadDescription(ULONG Comp,ULONG Group,ULONG Attr,ULONG Command) { DMI_ListDescReq_t *ListDesc; ULONG RC; ListDesc = (DMI_ListDescReq_t *)malloc(sizeof(DMI_ListDescReq_t)); memset((void *)ListDesc,0,sizeof(DMI_ListDescReq_t)); ListDesc->iAttributeId = Attr; ListDesc->iGroupId = Group; ListDesc->iComponentId = Comp; ListDesc->iOffset = 0; // start at the beginning of the description ListDesc->DmiMgmtCommand.iLevelCheck = DMI_LEVEL_CHECK; ListDesc->DmiMgmtCommand.iMgmtHandle = YOUR_MGMT_HANDLE; // set the app handle ListDesc->DmiMgmtCommand.iCmdHandle = YOUR_COMMAND_HANDLE; // set the command counter ListDesc->DmiMgmtCommand.iCnfBufLen = 4000UL; // set the size of the response ListDesc->DmiMgmtCommand.pCnfBuf = (void *)malloc(4000UL); // set up the response buffer ListDesc->DmiMgmtCommand.iRequestCount = 1; ListDesc->DmiMgmtCommand.iCmdLen = sizeof(DMI_ListDescReq_t); ListDesc->DmiMgmtCommand.iCommand = Command; // set the command: // DmiListComponentDescCmd // DmiListGroupDescCmd // DmiListAttributeDescCmd if((RC = DmiInvoke((DMI_MgmtCommand_t *)ListDesc)) != SLERR_NO_ERROR) { // ask for the description free(ListDesc->DmiMgmtCommand.pCnfBuf); free(ListDesc); } return RC; }
Processing the Callback from DmiListDescReq displays an example of how to
process the callback from the the DmiListDescReq command.
Processing the Callback from DmiListDescReq
case DmiListComponentDescCmd: // the list component command case DmiListAttributeDescCmd: // this is the description command for the attribute case DmiListGroupDescCmd: // list the group description if(!miCommand->iStatus){ // we've gotten a good return code back Work = (DMI_STRING *)miCommand->pCnfBuf; Working = malloc(Work->length + 1); memcpy(Working,Work->body,Work->length); // Do whatever your application needs to do here free(Working); } break;