I've got a very strange problem. I've made an usb hid device (pic18f2550 and DS1820).
I'm using Visual Studio 2010, C# , .NET 4.0 Framework, the latest version of MVVM light toolkit and an usb HID driver from Florent Leitner (facility to import functions from hid.dll [DllImport("hid.dll")],
thread for reading etc... )
First, I've made very light interface using code-behind for testing the communication between my device and my computer. All fine, my device is detected and informations are read and can be displayed without problem. I've also decided, for learning using
this toolkit, to implement the MVVM pattern.
I've made an model class for communitcation with my usb device, using same code as my first program. This class implement a default constructor who create the new UsbInterface (no souci) and enable the connection.
This constructor is tested with Visual Studio unit test, all fine, device is connected.
The interface have an button, RelayCommand and a Action who call the default constructor of my model when button is pressed. (View <-> ViewModel -> Model)
Using debug, the default constructor is called, the new UsbInterface is created, but the Connection always return false.
I really don't know what's append.
My usb device seems running well, USB HID class from Florent Leitner is ok using normal WPF application and my ModelClass.
But this very basic ModelClass(and Usb class) doesn't running on this pattern.
Does someone have any ideas ?