Ich habe ein PCMCIA-UMTS-Modem von HUAWEI, das 3 virtuelle
COM-Ports belegt (7[480000],8[9600],9[9600]).
Es hat einen Diagnose-Modus, der genau so funktioniert wie bei anderen Modems auch, d.h. über AT-Befehle (z.B. initialization string "ATE1") kann es angesprochen werden. Ist es vorhanden, wird eine entsprechende Antwort geliefert.
Mit folgendem Script lassen sich viele interessante Werte auslesen:
(lässt sich auch in DELPHI umsetzen)
Delphi-Quellcode:
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("MOBILE")
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_POTSModem", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "AnswerMode: " & objItem.AnswerMode
WScript.Echo "AttachedTo: " & objItem.AttachedTo
WScript.Echo "Availability: " & objItem.Availability
WScript.Echo "BlindOff: " & objItem.BlindOff
WScript.Echo "BlindOn: " & objItem.BlindOn
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "CompatibilityFlags: " & objItem.CompatibilityFlags
WScript.Echo "CompressionInfo: " & objItem.CompressionInfo
WScript.Echo "CompressionOff: " & objItem.CompressionOff
WScript.Echo "CompressionOn: " & objItem.CompressionOn
WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
WScript.Echo "ConfigurationDialog: " & objItem.ConfigurationDialog
strCountriesSupported = Join(objItem.CountriesSupported, ",")
WScript.Echo "CountriesSupported: " & strCountriesSupported
WScript.Echo "CountrySelected: " & objItem.CountrySelected
WScript.Echo "CreationClassName: " & objItem.CreationClassName
strCurrentPasswords = Join(objItem.CurrentPasswords, ",")
WScript.Echo "CurrentPasswords: " & strCurrentPasswords
strDCB = Join(objItem.DCB, ",")
WScript.Echo "DCB: " & strDCB
strDefault = Join(objItem.Default, ",")
WScript.Echo "Default: " & strDefault
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DeviceID: " & objItem.DeviceID
WScript.Echo "DeviceLoader: " & objItem.DeviceLoader
WScript.Echo "DeviceType: " & objItem.DeviceType
WScript.Echo "DialType: " & objItem.DialType
WScript.Echo "DriverDate: " & WMIDateStringToDate(objItem.DriverDate)
WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
WScript.Echo "ErrorControlForced: " & objItem.ErrorControlForced
WScript.Echo "ErrorControlInfo: " & objItem.ErrorControlInfo
WScript.Echo "ErrorControlOff: " & objItem.ErrorControlOff
WScript.Echo "ErrorControlOn: " & objItem.ErrorControlOn
WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
WScript.Echo "FlowControlHard: " & objItem.FlowControlHard
WScript.Echo "FlowControlOff: " & objItem.FlowControlOff
WScript.Echo "FlowControlSoft: " & objItem.FlowControlSoft
WScript.Echo "InactivityScale: " & objItem.InactivityScale
WScript.Echo "InactivityTimeout: " & objItem.InactivityTimeout
WScript.Echo "Index: " & objItem.Index
WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
WScript.Echo "MaxBaudRateToPhone: " & objItem.MaxBaudRateToPhone
WScript.Echo "MaxBaudRateToSerialPort: " & objItem.MaxBaudRateToSerialPort
WScript.Echo "MaxNumberOfPasswords: " & objItem.MaxNumberOfPasswords
WScript.Echo "Model: " & objItem.Model
WScript.Echo "ModemInfPath: " & objItem.ModemInfPath
WScript.Echo "ModemInfSection: " & objItem.ModemInfSection
WScript.Echo "ModulationBell: " & objItem.ModulationBell
WScript.Echo "ModulationCCITT: " & objItem.ModulationCCITT
WScript.Echo "ModulationScheme: " & objItem.ModulationScheme
WScript.Echo "Name: " & objItem.Name
WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
WScript.Echo "PortSubClass: " & objItem.PortSubClass
strPowerManagementCapabilities = Join(objItem.PowerManagementCapabilities, ",")
WScript.Echo "PowerManagementCapabilities: " & strPowerManagementCapabilities
WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
WScript.Echo "Prefix: " & objItem.Prefix
strProperties = Join(objItem.Properties, ",")
WScript.Echo "Properties: " & strProperties
WScript.Echo "ProviderName: " & objItem.ProviderName
WScript.Echo "Pulse: " & objItem.Pulse
WScript.Echo "Reset: " & objItem.Reset
WScript.Echo "ResponsesKeyName: " & objItem.ResponsesKeyName
WScript.Echo "RingsBeforeAnswer: " & objItem.RingsBeforeAnswer
WScript.Echo "SpeakerModeDial: " & objItem.SpeakerModeDial
WScript.Echo "SpeakerModeOff: " & objItem.SpeakerModeOff
WScript.Echo "SpeakerModeOn: " & objItem.SpeakerModeOn
WScript.Echo "SpeakerModeSetup: " & objItem.SpeakerModeSetup
WScript.Echo "SpeakerVolumeHigh: " & objItem.SpeakerVolumeHigh
WScript.Echo "SpeakerVolumeInfo: " & objItem.SpeakerVolumeInfo
WScript.Echo "SpeakerVolumeLow: " & objItem.SpeakerVolumeLow
WScript.Echo "SpeakerVolumeMed: " & objItem.SpeakerVolumeMed
WScript.Echo "Status: " & objItem.Status
WScript.Echo "StatusInfo: " & objItem.StatusInfo
WScript.Echo "StringFormat: " & objItem.StringFormat
WScript.Echo "SupportsCallback: " & objItem.SupportsCallback
WScript.Echo "SupportsSynchronousConnect: " & objItem.SupportsSynchronousConnect
WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
WScript.Echo "SystemName: " & objItem.SystemName
WScript.Echo "Terminator: " & objItem.Terminator
WScript.Echo "TimeOfLastReset: " & WMIDateStringToDate(objItem.TimeOfLastReset)
WScript.Echo "Tone: " & objItem.Tone
WScript.Echo "VoiceSwitchFeature: " & objItem.VoiceSwitchFeature
WScript.Echo
Next
Next
Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function
OUTPUT:
==========================================
Computer: MOBILE
==========================================
AnswerMode:
AttachedTo: COM3
Availability:
BlindOff:
BlindOn:
Caption: HUAWEI Mobile Connect - 3G Modem
CompatibilityFlags:
CompressionInfo:
CompressionOff:
CompressionOn:
ConfigManagerErrorCode:
ConfigManagerUserConfig:
ConfigurationDialog: modemui.dll
CountriesSupported:
CountrySelected:
CreationClassName: Win32_PotsModem
CurrentPasswords:
DCB: xxxxx
Default: 0,0,0,0,0,0,0,0,0,0
Description: HUAWEI Mobile Connect - 3G Modem
DeviceID: Modem0
DeviceLoader:
DeviceType: External Modem
DialType:
ErrorCleared:
ErrorControlForced:
ErrorControlInfo:
ErrorControlOff:
ErrorControlOn:
ErrorDescription:
FlowControlHard:
FlowControlOff:
FlowControlSoft:
InactivityScale: "3c000000"
InactivityTimeout:
Index: 0
LastErrorCode:
MaxBaudRateToPhone:
MaxBaudRateToSerialPort: 115200
MaxNumberOfPasswords:
Model: HUAWEI Mobile Connect - 3G Modem
ModemInfPath: oem2.inf
ModemInfSection: Modem0
ModulationBell:
ModulationCCITT:
ModulationScheme:
Name: HUAWEI Mobile Connect - 3G Modem
PNPDeviceID:
PortSubClass: "02"
PowerManagementCapabilities:
PowerManagementSupported: Falsch
Prefix: AT
Properties: 128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ProviderName: HUAWEI Incorporated
Pulse: P
Reset: AT&F<cr>
ResponsesKeyName: HUAWEI Mobile Connect - 3G Modem::HUAWEI Incorporated::HUAWEI Incorporated
RingsBeforeAnswer:
SpeakerModeDial:
SpeakerModeOff:
SpeakerModeOn:
SpeakerModeSetup:
SpeakerVolumeHigh:
SpeakerVolumeInfo:
SpeakerVolumeLow:
SpeakerVolumeMed:
Status: Unknown
StatusInfo: 2
StringFormat:
SupportsCallback:
SupportsSynchronousConnect:
SystemCreationClassName: Win32_ComputerSystem
SystemName: MOBILE
Terminator: <cr>
Tone: T
VoiceSwitchFeature:
AnswerMode:
AttachedTo: COM5
Availability:
BlindOff:
BlindOn:
Caption: HUAWEI Mobile Connect - 3G Modem
CompatibilityFlags:
CompressionInfo:
CompressionOff:
CompressionOn:
ConfigManagerErrorCode:
ConfigManagerUserConfig:
ConfigurationDialog: modemui.dll
CountriesSupported:
CountrySelected:
CreationClassName: Win32_PotsModem
CurrentPasswords:
DCB: xxxxx
Default: 0,0,0,0,0,0,0,0,0,0
Description: HUAWEI Mobile Connect - 3G Modem
DeviceID: Modem1
DeviceLoader:
DeviceType: External Modem
DialType:
ErrorCleared:
ErrorControlForced:
ErrorControlInfo:
ErrorControlOff:
ErrorControlOn:
ErrorDescription:
FlowControlHard:
FlowControlOff:
FlowControlSoft:
InactivityScale: "3c000000"
InactivityTimeout:
Index: 1
LastErrorCode:
MaxBaudRateToPhone:
MaxBaudRateToSerialPort: 115200
MaxNumberOfPasswords:
Model: HUAWEI Mobile Connect - 3G Modem
ModemInfPath: oem2.inf
ModemInfSection: Modem0
ModulationBell:
ModulationCCITT:
ModulationScheme:
Name: HUAWEI Mobile Connect - 3G Modem #2
PNPDeviceID:
PortSubClass: "02"
PowerManagementCapabilities:
PowerManagementSupported: Falsch
Prefix: AT
Properties: 128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ProviderName: HUAWEI Incorporated
Pulse: P
Reset: AT&F<cr>
ResponsesKeyName: HUAWEI Mobile Connect - 3G Modem::HUAWEI Incorporated::HUAWEI Incorporated
RingsBeforeAnswer:
SpeakerModeDial:
SpeakerModeOff:
SpeakerModeOn:
SpeakerModeSetup:
SpeakerVolumeHigh:
SpeakerVolumeInfo:
SpeakerVolumeLow:
SpeakerVolumeMed:
Status: Unknown
StatusInfo: 2
StringFormat:
SupportsCallback:
SupportsSynchronousConnect:
SystemCreationClassName: Win32_ComputerSystem
SystemName: MOBILE
Terminator: <cr>
Tone: T
VoiceSwitchFeature:
AnswerMode:
AttachedTo: COM7
Availability:
BlindOff:
BlindOn:
Caption: HUAWEI Mobile Connect - 3G Modem
CompatibilityFlags:
CompressionInfo:
CompressionOff:
CompressionOn:
ConfigManagerErrorCode: 0
ConfigManagerUserConfig: Falsch
ConfigurationDialog: modemui.dll
CountriesSupported:
CountrySelected:
CreationClassName: Win32_PotsModem
CurrentPasswords:
DCB: xxxxx
Default: 0,0,0,0,0,0,0,0,0,0
Description: HUAWEI Mobile Connect - 3G Modem
DeviceID: USB\VID_12D1&PID_1001&MI_00\7&7EB8A2F&0&0000
DeviceLoader:
DeviceType: External Modem
DialType:
ErrorCleared:
ErrorControlForced:
ErrorControlInfo:
ErrorControlOff:
ErrorControlOn:
ErrorDescription:
FlowControlHard:
FlowControlOff:
FlowControlSoft:
InactivityScale: "3c000000"
InactivityTimeout:
Index: 2
LastErrorCode:
MaxBaudRateToPhone:
MaxBaudRateToSerialPort: 460800
MaxNumberOfPasswords:
Model: HUAWEI Mobile Connect - 3G Modem
ModemInfPath: oem2.inf
ModemInfSection: Modem0
ModulationBell:
ModulationCCITT:
ModulationScheme:
Name: HUAWEI Mobile Connect - 3G Modem #3
PNPDeviceID: USB\VID_12D1&PID_1001&MI_00\7&7EB8A2F&0&0000
PortSubClass: "02"
PowerManagementCapabilities:
PowerManagementSupported: Falsch
Prefix: AT
Properties: 128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ProviderName: HUAWEI Incorporated
Pulse: P
Reset: AT&F<cr>
ResponsesKeyName: HUAWEI Mobile Connect - 3G Modem::HUAWEI Incorporated::HUAWEI Incorporated
RingsBeforeAnswer:
SpeakerModeDial:
SpeakerModeOff:
SpeakerModeOn:
SpeakerModeSetup:
SpeakerVolumeHigh:
SpeakerVolumeInfo:
SpeakerVolumeLow:
SpeakerVolumeMed:
Status: OK
StatusInfo: 3
StringFormat:
SupportsCallback:
SupportsSynchronousConnect:
SystemCreationClassName: Win32_ComputerSystem
SystemName: MOBILE
Terminator: <cr>
Tone: T
VoiceSwitchFeature: