Visioscan Set SDK Libraries 1.0.14
Visioscan Set SDK Help documentation file for C++ and C++/CLI
 
Loading...
Searching...
No Matches
WUsbCommunication.h
1#pragma once
2#include "WUsbSettings.h"
3#include "UsbCommunication.h"
4#include "WUsbInformation.h"
5using namespace System::Collections::Generic;
6namespace WCommunication {
10 public ref class WUsbCommunication : public WBaseCommunication
11 {
12 public:
17 _communication = new UsbCommunication();
18 }
19
24 delete(_communication);
25 }
26
30 WUsbCommunication(WUsbSettings^ pUsbSettings) : WBaseCommunication() {
31 Settings = pUsbSettings;
32 _communication = new UsbCommunication((UsbSettings*)pUsbSettings->__nativeSettings);
33 }
37 void Connect() override {
38 _communication->Connect();
39 }
43 void Disconnect() override {
44 _communication->Disconnect();
45 }
46
52 static List<WUsbInformation^>^ GetDeviceList() {
53 List<WUsbInformation^>^ toReturn = gcnew List<WUsbInformation^>();
54 WUsbInformation^ toAdd;
55
56 vector<UsbInformation> infos = UsbCommunication::GetDeviceList();
57 for (int i = 0; i < infos.size(); i++) {
58 toAdd = gcnew WUsbInformation();
59 toAdd->BusNumber = infos[i].GetBusNumber();
60 toAdd->DeviceAddress = infos[i].GetDeviceAddress();
61 toAdd->Manufacturer = gcnew String(infos[i].GetManufacturer().c_str());
62 toAdd->ProductDescription = gcnew String(infos[i].GetProductDescription().c_str());
63 toAdd->ProductId = infos[i].GetProductId();
64 toAdd->SerialNumber = gcnew String(infos[i].GetSerialNumber().c_str());
65 toAdd->Speed = gcnew String(infos[i].GetSpeed().c_str());
66 toAdd->VendorId = infos[i].GetVendorId();
67
68 toReturn->Add(toAdd);
69 }
70
71 return toReturn;
72 }
73 protected:
74 };
75}
76
Definition WEthernetCommunication.h:5
This class handles the USB communication.
Definition UsbCommunication.h:41
static vector< UsbInformation > GetDeviceList()
A static method that retrieve the devices wired to the computer throug USB.
Definition UsbCommunication.cpp:220
The USB settings encapsulation for USB communication.
Definition UsbSettings.h:18
A wrapper on the UsbCommunication.
Definition WUsbCommunication.h:11
WUsbCommunication()
Base constructor.
Definition WUsbCommunication.h:16
WUsbCommunication(WUsbSettings^ pUsbSettings)
Copy constructor.
Definition WUsbCommunication.h:30
~WUsbCommunication()
Destructor.
Definition WUsbCommunication.h:23
void Disconnect() override
Disconnect from the USB device.
Definition WUsbCommunication.h:43
static List< WUsbInformation^> GetDeviceList()
A static method that retrieve the devices wired to the computer throug USB.
Definition WUsbCommunication.h:52
void Connect() override
Connects to the USB Device.
Definition WUsbCommunication.h:37
A wrapper on the USB Information.
Definition WUsbInformation.h:13
property unsigned int BusNumber
Definition WUsbInformation.h:29
A wrapper on the UsbSettings.
Definition WUsbSettings.h:16