Visioscan Set SDK Libraries 1.0.28
Visioscan Set SDK Help documentation file for C++ and C++/CLI
 
Loading...
Searching...
No Matches
WEthernetCommunication.h
1#pragma once
2//#include "WBaseCommunication.h"
3#include "WEthernetSettings.h"
4
5namespace WCommunication {
6 public ref class WEthernetCommunication : public WBaseCommunication
7 {
8 public:
9 WEthernetCommunication() : WBaseCommunication() {
10 _communication = new EthernetCommunication(AUTO_RECONNECT);
11 }
12
14 delete(_communication);
15 }
16
17 WEthernetCommunication(WEthernetSettings^ pEthernetSettings) : WBaseCommunication() {
18 Settings = pEthernetSettings;
19 _communication = new EthernetCommunication((EthernetSettings*)pEthernetSettings->__nativeSettings, AUTO_RECONNECT);
20 }
21
23 CommunicationStatus status = _communication->Connect();
24
26 for (int i = 0; i < status.Channels.size(); i++) {
27 WChannel^ toAdd = gcnew WChannel();
28 toAdd->RawDataAvailability = static_cast<DataAvailabilityEnum>(status.Channels[i].RawDataAvailability);
29 toAdd->Type = static_cast<ChannelTypeEnum>(status.Channels[i].Type);
30
31 toReturn->Channels->Add(toAdd);
32 }
33
34 toReturn->ErrorCode = gcnew WCommunicationErrorCode();
35 toReturn->ErrorCode->ErrorCode = status.ErrorCode.ErrorCode;
36 toReturn->ErrorCode->ErrorMeaning = gcnew String(status.ErrorCode.ErrorMeaning.c_str());
37
38 toReturn->Status = static_cast<ConnectionStatusEnum>(status.Status);
39
40 return toReturn;
41
42 }
43
44 void Disconnect() override {
45 _communication->Disconnect();
46 }
47
48 private:
49 };
50}
Definition WEthernetCommunication.h:5
std::string ErrorMeaning
Definition CommunicationStructures.h:16
int ErrorCode
Definition CommunicationStructures.h:15
Definition CommunicationStructures.h:24
ConnectionState Status
Definition CommunicationStructures.h:26
vector< Channel > Channels
Definition CommunicationStructures.h:25
CommErrorCode ErrorCode
Definition CommunicationStructures.h:27
An ETHERNET oriented communication class. It inherits from BaseCommunication. It ensures the ETHERNET...
Definition EthernetCommunication.h:50
The ETHERNET settings encapsulation for ETHERNET communication.
Definition EthernetSettings.h:21
Definition WChannel.h:12
property ChannelTypeEnum Type
Definition WChannel.h:22
Definition WCommunicationErrorCode.h:6
Definition WCommunicationStatus.h:16
property List< WChannel^> Channels
Definition WCommunicationStatus.h:24
Definition WEthernetCommunication.h:7
WEthernetCommunication(WEthernetSettings^ pEthernetSettings)
Definition WEthernetCommunication.h:17
WEthernetCommunication()
Definition WEthernetCommunication.h:9
~WEthernetCommunication()
Definition WEthernetCommunication.h:13
WCommunicationStatus Connect() override
Definition WEthernetCommunication.h:22
void Disconnect() override
Definition WEthernetCommunication.h:44
A wrapper on the EthernetSettings.
Definition WEthernetSettings.h:16