Sophie,
Not sure if this is going to be much help, but the following is a bit of code (VB.NET) from a program I've written. It works out the COM port number of a device by looking for a keyword/phrase in the devices name. Fortunately, when installed correctly the mbed appears as 'mbed Serial Port' so I was able to modify the code to simple look for the phrase 'mbed' in my devices.
Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject
Dim intNameLength As Integer
Dim strNameHold, strComPort As String
moSearch = New Management.ManagementObjectSearcher("Select * from Win32_PnPEntity")
moReturn = moSearch.Get
strComPort = ""
For Each mo In moReturn
If CStr(mo.Properties.Item("Name").Value).Contains("mbed") Then
intNameLength = Len(mo.Properties.Item("Name").Value)
strNameHold = mo.Properties.Item("Name").Value
strNameHold = strNameHold.Substring(intNameLength - 7, 7)
For intBracketSearch = 0 To 6
If strNameHold.Substring(intBracketSearch, 1) = "(" Then
If strNameHold.Substring(intBracketSearch + 5, 1) = ")" Then
strComPort = strNameHold.Substring(intBracketSearch + 4, 1)
sptCaliper.PortName = "COM" & strComPort
Else
strComPort = strNameHold.Substring(intBracketSearch + 4, 2)
sptCaliper.PortName = "COM" & strComPort
End If
End If
Next
End If
Next
sptCaliper is a VB SerialPort control.
I've tried this out to see if it's recognised correctly and it all seems to work fine with the mbed.
Hope this helps.
Joe
Hi all,
So far I've used TeraTerm and HyperTerminal with my mbed project. Now I want to write a Windows program that talks to the mbed system but have no idea how a Windows program can find the mbed 'COM' port. Can anyone point me in the right direction, does the mbed Windows driver have a DLL that can be used for this?
Thanks in advance,
Sophie x