Hi,
i use msp430f5525 to implement a virtual COM port and use C# to do an application on PC.
here is my C# code:
protected override void WndProc(ref Message m)
{
try
{
if (m.Msg == WM_DEVICECHANGE)
{
switch (m.WParam.ToInt32())
{
case DBT_DEVICEARRIVAL:
// my code.
break;
case DBT_DEVICEREMOVECOMPLETE: //
// my code.
break;
case DBT_DEVNODES_CHANGED :
break;
default:
break;
}
}
i use mdmcpq.inf and usbser.sys as my usb driver.
i expect that when i plug in the device . i receive DBT_DEVNODES_CHANGED for one time and followed DBT_DEVICEARRIVAL for one time.
this C# app works well when i use other devices such as USB flash drive or HL-340 usb-232 convertor.
but when use MSP430, i can only receive DBT_DEVNODES_CHANGED for two times and no more DBT_DEVICEARRIVAL.
as i know , port devices can broadcast DBT_DEVICEARRIVAL automatically and do not need to do RegisterDeviceNotification() method.
I am confused about it.
which part i should check, MSP430 code? usb driver? or C# app?
Thank you!