any example C#.Net example for RequestResponse ?
I've only been able to find VBscript examples... such as...
'##############START CODE SNIPPET########
Dim IpmiProviders
IpmiProviders = Array("microsoft_ipmi")
Dim oClass, oIpmi, hasIpmiProvider, strComputer, providerName
hasIpmiProvider = false
Set oSvc = GetObject("winmgmts:\root\wmi")
For Each providerName in IpmiProviders
On Error Resume Next
Set oClass = oSvc.get(providerName)
If Err.number = 0 Then
On Error Goto 0
For Each oInstance In oSvc.instancesof(providerName)
Set oIpmi = oInstance
hasIpmiProvider = true
Next
Exit For
End If
Next
If hasIpmiProvider = false Then
'If we are not able to get the driver, data will not be available
Wscript.echo " Microsoft IPMI Driver not installed"
Else
Wscript.echo "Using ipmi provider: " & providerName
If providerName = "microsoft_ipmi" Then
WriteReadSMBus oClass, oIpmi
End If
End If
Sub WriteReadSMBus (byRef oClass, byRef oIpmi)
Dim oInParams, outParams
Set oInParams = oClass.methods_( "requestresponse" ).inparameters
oInParams.networkfunction = &H06
oInParams.lun = 0
oInParams.responderaddress = 32
oInParams.command = &H52
oInParams.requestdatasize = 4 ' Size of the request data
oInParams.requestdata = Array(&H68, &HE0, &H01, &H0F) 'write 0x0F and read
it back
Set outParams = oIpmi.execmethod_( "requestresponse", oInparams)
Wscript.echo "Completion Code: " & OutParams.CompletionCode
Wscript.echo OutParams.ResponseData(0)
Wscript.echo OutParams.ResponseData(1)
End Sub
' OUTPUT:
' Using ipmi provider: microsoft_ipmi
' Completion Code: 0
' 0
' 15
'################END CODE SNIPPET########
the above VBScript works just great, but why is there a lack of C# and even
VB examples ? Not even MSDN has any working C# or VB examples to send a
RequestResponse IPMI message !!
Does anyone have a working RequestResponse .NET example ?
date: Tue, 11 Mar 2008 14:57:00 -0700
author: Alex