A confirm message is sent if the pConfirmFunc() call is non-zero. The confirm message contains the DmiRegisterCnf block, as pointed to by pCnfBuf in the DmiMgmtCommand block.
The format for the command block is: ┌──────────────────────────────────────────────────────────────────────────────┐
Variable Name
│ Table 22. DmiRegisterCnf Command Block │
├───────────────┬───────────────┬───────────────┬──────────────────────────────┤
│ OFFSET │ SIZE │ TYPE │ VARIABLE NAME │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 0 │ 8 │ STRUCT │ DmiVersion │
├───────────────┼───────────────┼───────────────┼──────────────────────────────┤
│ 8 │ 4 │ INT │ iDmiHandle │
└───────────────┴───────────────┴───────────────┴──────────────────────────────┘
DmiVersion
Variable Description
Processing DmiRegisterCnf displays an example of how to handle the DmiRegisterCnf
callback command block. For this example, all callbacks that are returned
to the management application are processed through a single entry point.
ProcessingDmiRegisterCnf
case DmiRegisterMgmtCmd:
if(miCommand->iStatus == 0){ // all went well
Response = (DMI_RegisterCnf_t *)miCommand->pCnfBuf; // type it first, it's easier
AppInfo.myHandle = Response->iDmiHandle;
Work = (DMI_STRING *)((char *)Response + Response->DmiVersion.osDmiSpecLevel); // point to the
// MIF string
memset(AppInfo.SpecLevel,0,sizeof(AppInfo.SpecLevel));
strncpy(AppInfo.SpecLevel,Work->body,Work->length);
Work = (DMI_STRING *)((char *)Response + Response->DmiVersion.osImplDesc);
memset(AppInfo.SLDescription,0,sizeof(AppInfo.SLDescription));
strncpy(AppInfo.SLDescription,Work->body,Work->length);
// Do whatever your application needs to do here
// to process the callback.
}
else{ // this is an error condition
// Do whatever your application needs to do here
// to process the error condition.
}
break;