| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include "Hardware/HardwareParams.h" |
| 24 |
#include "Hardware/Protocols/MaerklinCAN.h" |
| 25 |
#include "Logger/Logger.h" |
| 26 |
#include "Network/UdpConnection.h" |
| 27 |
|
| 28 |
namespace Hardware |
| 29 |
{ |
| 30 |
class CS2Udp : protected Protocols::MaerklinCAN |
| 31 |
{ |
| 32 |
public: |
| 33 |
CS2Udp() = delete; |
| 34 |
CS2Udp(const CS2Udp&) = delete; |
| 35 |
CS2Udp& operator=(const CS2Udp&) = delete; |
| 36 |
|
| 37 |
CS2Udp(const HardwareParams* params); |
| 38 |
|
| 39 |
~CS2Udp(); |
| 40 |
|
| 41 |
static void GetArgumentTypesAndHint(std::map<unsigned char,ArgumentType>& argumentTypes, std::string& hint) |
| 42 |
{ |
| 43 |
argumentTypes[1] = ArgumentTypeIpAddress; |
| 44 |
argumentTypes[2] = ArgumentTypeMainSecundary; |
| 45 |
hint = Languages::GetText(Languages::TextHintCs2Udp); |
| 46 |
} |
| 47 |
|
| 48 |
private: |
| 49 |
Network::UdpConnection senderConnection; |
| 50 |
Network::UdpConnection receiverConnection; |
| 51 |
|
| 52 |
void Send(const unsigned char* buffer) override; |
| 53 |
void Receiver() override; |
| 54 |
|
| 55 |
static const unsigned short CS2SenderPort = 15731; |
| 56 |
static const unsigned short CS2ReceiverPort = 15730; |
| 57 |
}; |
| 58 |
|
| 59 |
} |
| 60 |
|