The following Get commands use the DmiSetAttributeReq command block:
The format for the command block is: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³Table39
.DmiGetRowReqCommandBlock ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ OFFSET ³ SIZE ³ TYPE ³ VARIABLE NAME ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 0 ³ 64 ³ STRUCT ³ DmiMgmtCommand ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 64 ³ 4 ³ INT ³ iComponentId ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 68 ³ 4 ³ INT ³ iGroupId ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 72 ³ 4 ³ INT ³ iGroupKeyCount ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 76 ³ 4 ³ OFFSET ³ oGroupKeyList ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ 80 ³ 4 ³ INT ³ iAttributeId ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Variable Name
DmiGetRowCmd
Issuing DmiGetRowReq displays an example of how to issue the DmiGetRowReq
command to the MI. IssuingDmiGetRowReq
ULONG IssueGetRow(ULONG CompID,ULONG GroupID,DMI_GetRowCnf_t *Row) // get the list group started { DMI_GetRowReq_t *GetRow; // command block to use DMI_GroupKeyData_t *NewKey, *ThisKey; USHORT x; // just a counter char *Working; DMI_STRING *Work; DMI_UNSIGNED Size; ULONG RC; GetRow = (DMI_GetRowReq_t *)malloc(4000); memset((void *)GetRow,0,sizeof(DMI_GetRowReq_t)); GetRow->iGroupId = GroupID; GetRow->iComponentId = CompID; GetRow->DmiMgmtCommand.iLevelCheck = DMI_LEVEL_CHECK; GetRow->DmiMgmtCommand.iMgmtHandle = YOUR_MGMT_HANDLE; // set the app handle GetRow->DmiMgmtCommand.iCmdHandle = YOUR_COMMAND_HANDLE; // point to the addinfo block GetRow->DmiMgmtCommand.iCnfBufLen = 8000UL; // set the size of the response GetRow->DmiMgmtCommand.pCnfBuf = (void *)malloc(8000UL); // set up the response buffer GetRow->DmiMgmtCommand.iRequestCount = 1; GetRow->DmiMgmtCommand.iCmdLen = 4000L; if(Row == (DMI_GetRowCnf_t *)NULL) GetRow->DmiMgmtCommand.iCommand = DmiGetFirstRowCmd; // set the // command else{ GetRow->DmiMgmtCommand.iCommand = DmiGetNextRowCmd; // get the next row in the table ThisKey = (DMI_GroupKeyData_t *)((char *)Row + Row->oGroupKeyList); NewKey = (DMI_GroupKeyData_t *)((char *)GetRow + sizeof(DMI_GetRowReq_t)); GetRow->oGroupKeyList = sizeof(DMI_GetRowReq_t); GetRow->iGroupKeyCount = Row->iGroupKeyCount; Working = (char *)((char *)NewKey + (Row->iGroupKeyCount * sizeof(DMI_GroupKeyData_t))); for(x = 0;x != Row->iGroupKeyCount;x++,ThisKey++,NewKey++){ memcpy(NewKey,ThisKey,sizeof(DMI_GroupKeyData_t)); // move the key block over switch(ThisKey->iAttributeType){ // switch on the data type case MIF_COUNTER: case MIF_COUNTER64: case MIF_GAUGE: case MIF_INT: case MIF_INTEGER64: Size = sizeof(DMI_UNSIGNED); goto FinishGroup; case MIF_DATE: Size = sizeof(DMI_TimeStamp_t); goto FinishGroup; case MIF_DISPLAYSTRING: case MIF_OCTETSTRING: Work = (DMI_STRING *)((char *)Row + ThisKey->oKeyValue); Size = (Work->length + sizeof(DMI_UNSIGNED)); FinishGroup: memcpy(Working,(char *)((char *)Row + ThisKey->oKeyValue),Size); NewKey->oKeyValue = (DMI_OFFSET)((char *)Working - (char *)GetRow); Working += Size; break; case MIF_UNKNOWN_DATA_TYPE: // this is the error case default: break; } } } if((RC = DmiInvoke((DMI_MgmtCommand_t *)GetRow)) != SLERR_NO_ERROR) { // ask for the description free(GetRow->DmiMgmtCommand.pCnfBuf); free(GetRow); free((char *)Handle); // free up the add information (AddInfo) block } return RC; }