The following Set commands use the DmiSetAttributeReq command block:
The format for the command block is: ┌──────────────────────────────────────────────────────────────────────────────┐│Table37
.DmiSetAttributeReqCommandBlock │
├───────────────┬───────────────┬───────────────┬──────────────────────────────┤
│ OFFSET │ SIZE │ TYPE │ VARIABLE NAME │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 0 │ 64 │ STRUCT │ DmiMgmtCommand │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 64 │ 4 │ INT │ iComponentId │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 68 │ 20 │ STRUCT │ DmiSetAttributeData[] │
└───────────────┴───────────────┴───────────────┴──────────────────────────────┘
Variable Name
DmiSetAttributeCmd
The format for the DmiSetAttributeData block is as follows: ┌──────────────────────────────────────────────────────────────────────────────┐│Table38
.DmiSetAttributeDataBlock │
├───────────────┬───────────────┬───────────────┬──────────────────────────────┤
│ OFFSET │ SIZE │ TYPE │ VARIABLE NAME │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 0 │ 4 │ INT │ iGroupId │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 4 │ 4 │ INT │ iGroupKeyCount │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 8 │ 4 │ OFFSET │ oGroupKeyList │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 12 │ 4 │ INT │ iAttributeId │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 16 │ 4 │ OFFSET │ oAttributeValue │
└───────────────┴───────────────┴───────────────┴──────────────────────────────┘
Variable Name
There is no data returned from this call in the confirm buffer. The value of iStatus indicates either success or failure. In the case of failure, the value of (iCnfCount + 1) corresponds to the number of the command block that caused the error.
Issuing DmiSetAttributeReq displays an example of how to issue the DmiSetAttributeReq
command to the MI. IssuingDmiSetAttributeReq
ULONG IssueSetAttribute(ULONG CompID,ULONG GroupID, ULONG AttrID,char *Value,USHORT Len) // issues a set
// to the SL
{
DMI_SetAttributeReq_t *ListComp;
DMI_GroupKeyData_t *NewKey;
ULONG RC;
ListComp = (DMI_SetAttributeReq_t *)malloc(4000L); // allocate a big block, in case we have keys
memset((void *)ListComp,0,sizeof(DMI_SetAttributeReq_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 counter
ListComp->DmiMgmtCommand.iCnfBufLen = 4000UL; // set the size of the response
ListComp->DmiMgmtCommand.pCnfBuf = (void *)malloc(4000UL); // set up the response buffer
ListComp->DmiMgmtCommand.iRequestCount = 1;
ListComp->DmiMgmtCommand.iCmdLen = 4000L; e number...
ListComp->iComponentId = CompID; // set to the currently selected component
ListComp->DmiMgmtCommand.iCommand = DmiSetAttributeCmd; // set the command
ListComp->DmiSetAttributeListφ0∙.iGroupId = GroupID;
ListComp->DmiSetAttributeListφ0∙.iAttributeId = AttrID;
ListComp->DmiSetAttributeListφ0∙.oAttributeValue = sizeof(DMI_SetAttributeReq_t);
memcpy((char *)((BYTE *)ListComp + sizeof(DMI_SetAttributeReq_t)),Value,Len);
if(KEY_COUNT){ // there is a key list
ListComp->DmiSetAttributeListφ0∙.iGroupKeyCount = KEY_COUNT;
NewKey = (DMI_GroupKeyData_t *)((BYTE *)ListComp + sizeof(DMI_SetAttributeReq_t) + Len); // this is
// the start of the keylist
ListComp->DmiSetAttributeListφ0∙.oGroupKeyList = (DMI_OFFSET)((BYTE *)NewKey - (BYTE *)ListComp);
// Encode the key list here...
}
if((RC = DmiInvoke((DMI_MgmtCommand_t *)ListComp)) != SLERR_NO_ERROR) { // call SL and register
free(ListComp->DmiMgmtCommand.pCnfBuf);
free(ListComp);
}
return RC;
}