Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Tue, 11 Mar 2008 14:57:00 -0700,    group: microsoft.public.win32.programmer.wmi        back       


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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us