| 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
5 namespace WCommunication {
6 public ref class WEthernetCommunication : public WBaseCommunication
7 {
8 public:
9 WEthernetCommunication() : WBaseCommunication() {
10 _communication = new EthernetCommunication(AUTO_RECONNECT);
11 }
12
13 ~WEthernetCommunication() {
14 delete(_communication);
15 }
16
17 WEthernetCommunication(WEthernetSettings^ pEthernetSettings) : WBaseCommunication() {
18 Settings = pEthernetSettings;
19 _communication = new EthernetCommunication((EthernetSettings*)pEthernetSettings->__nativeSettings, AUTO_RECONNECT);
20 }
21
22 WCommunicationStatus^ Connect() override {
23 CommunicationStatus status = _communication->Connect();
24
25 WCommunicationStatus^ toReturn = gcnew WCommunicationStatus();
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}
WCommunication
Definition WEthernetCommunication.h:5
CommErrorCode::ErrorMeaning
std::string ErrorMeaning
Definition CommunicationStructures.h:16
CommErrorCode::ErrorCode
int ErrorCode
Definition CommunicationStructures.h:15
CommunicationStatus
Definition CommunicationStructures.h:24
CommunicationStatus::Status
ConnectionState Status
Definition CommunicationStructures.h:26
CommunicationStatus::Channels
vector< Channel > Channels
Definition CommunicationStructures.h:25
CommunicationStatus::ErrorCode
CommErrorCode ErrorCode
Definition CommunicationStructures.h:27
EthernetCommunication
An ETHERNET oriented communication class. It inherits from BaseCommunication. It ensures the ETHERNET...
Definition EthernetCommunication.h:50
EthernetSettings
The ETHERNET settings encapsulation for ETHERNET communication.
Definition EthernetSettings.h:21
WUtils::WChannel
Definition WChannel.h:12
WUtils::WChannel::Type
property ChannelTypeEnum Type
Definition WChannel.h:22
WUtils::WCommunicationErrorCode
Definition WCommunicationErrorCode.h:6
WUtils::WCommunicationStatus
Definition WCommunicationStatus.h:16
WUtils::WCommunicationStatus::Channels
property List< WChannel^> Channels
Definition WCommunicationStatus.h:24
WCommunication::WEthernetCommunication
Definition WEthernetCommunication.h:7
WCommunication::WEthernetCommunication::WEthernetCommunication
WEthernetCommunication(WEthernetSettings^ pEthernetSettings)
Definition WEthernetCommunication.h:17
WCommunication::WEthernetCommunication::WEthernetCommunication
WEthernetCommunication()
Definition WEthernetCommunication.h:9
WCommunication::WEthernetCommunication::~WEthernetCommunication
~WEthernetCommunication()
Definition WEthernetCommunication.h:13
WCommunication::WEthernetCommunication::Connect
WCommunicationStatus Connect() override
Definition WEthernetCommunication.h:22
WCommunication::WEthernetCommunication::Disconnect
void Disconnect() override
Definition WEthernetCommunication.h:44
WCommunication::WEthernetSettings
A wrapper on the EthernetSettings.
Definition WEthernetSettings.h:16