Debian Codegraph @

Hardware/CS2Tcp.h

raw symbols SCIP
1 /*
2 RailControl - Model Railway Control Software
3
4 Copyright (c) 2017-2025 by Teddy / Dominik Mahrer - www.railcontrol.org
5
6 RailControl is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3, or (at your option) any
9 later version.
10
11 RailControl is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with RailControl; see the file LICENCE. If not see
18 <http://www.gnu.org/licenses/>.
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/TcpClient.h"
27
28 namespace Hardware
29 {
30 class CS2Tcp : protected Protocols::MaerklinCAN
31 {
32 public:
33 CS2Tcp() = delete;
34 CS2Tcp(const CS2Tcp&) = delete;
35 CS2Tcp& operator=(const CS2Tcp&) = delete;
36
37 CS2Tcp(const HardwareParams* params);
38
39 static void GetArgumentTypesAndHint(std::map<unsigned char,ArgumentType>& argumentTypes, std::string& hint)
40 {
41 argumentTypes[1] = ArgumentTypeIpAddress;
42 argumentTypes[2] = ArgumentTypeMainSecundary;
43 hint = Languages::GetText(Languages::TextHintCs2Tcp);
44 }
45
46 private:
47 Network::TcpConnection connection;
48
49 void Send(const unsigned char* buffer) override;
50 void Receiver() override;
51
52 static const unsigned short CS2Port = 15731;
53 };
54 } // namespace
55