| 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 <string> |
| 24 |
|
| 25 |
#include "Hardware/HardwareParams.h" |
| 26 |
#include "Hardware/Protocols/DccPpEx.h" |
| 27 |
#include "Logger/Logger.h" |
| 28 |
#include "Network/TcpClient.h" |
| 29 |
|
| 30 |
namespace Hardware |
| 31 |
{ |
| 32 |
class DccPpExTcp : protected Protocols::DccPpEx |
| 33 |
{ |
| 34 |
public: |
| 35 |
DccPpExTcp() = delete; |
| 36 |
DccPpExTcp(const DccPpExTcp&) = delete; |
| 37 |
DccPpExTcp& operator=(const DccPpExTcp&) = delete; |
| 38 |
|
| 39 |
DccPpExTcp(const HardwareParams* params); |
| 40 |
|
| 41 |
static void GetArgumentTypesAndHint(std::map<unsigned char,ArgumentType>& argumentTypes, std::string& hint) |
| 42 |
{ |
| 43 |
argumentTypes[1] = ArgumentTypeIpAddress; |
| 44 |
hint = Languages::GetText(Languages::TextHintDccPpExTcp); |
| 45 |
} |
| 46 |
|
| 47 |
private: |
| 48 |
Network::TcpConnection connection; |
| 49 |
|
| 50 |
bool Send(const std::string& buffer) override; |
| 51 |
|
| 52 |
bool Receive(std::string& buffer) override; |
| 53 |
|
| 54 |
static const unsigned short Port = 2560; |
| 55 |
}; |
| 56 |
} |
| 57 |
|