Then it is as expected as well…so somehow String s causes this…
Whole snippet:
if device.IsOpen then
dim s as string = device.GetStringDescriptor(desc.IndexProduct, 0)
if s <> "" then
s = s.Trim + " " + Hex(desc.VendorID) + ":" + Hex(desc.ProductID)
USBMenu.AddRow(s)
else
s = device.GetStringDescriptorAscii(desc.IndexProduct)
s = s.Trim + " " + Hex(desc.ProductID) + "/" + Hex(desc.VendorID)
USBMenu.AddRow(s)
end if
USBMenu.RowTagAt(c) = device
c = c + 1
device.Close
end if
Nope…not the Hex string…but the string returned from the MBS USB plugin…
This works now:
dim s as string = device.GetStringDescriptor(desc.IndexProduct, 0)
if s <> "" then
s = s.ReplaceAll(chr(0), "") + " " + Hex(desc.VendorID) + ":" + Hex(desc.ProductID)
USBMenu.AddRow(s)
else
s = device.GetStringDescriptorAscii(desc.IndexProduct)
s = s.ReplaceAll(chr(0), "") + " " + Hex(desc.VendorID) + ":" + Hex(desc.ProductID)
USBMenu.AddRow(s)
end if
So I need to remove chr(0) from the MBS USB method returning the device name.