forked from JanekOstendorf/THOMAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRelayProtocol.h
More file actions
45 lines (33 loc) · 753 Bytes
/
RelayProtocol.h
File metadata and controls
45 lines (33 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
/*
-- RelayProtocol-Klasse :: HEADER --
Definiert die RelayProtocol-Klasse
Diese Klasse übernimmt die direkte Steuerung des Relays
*/
/* INCLUDES */
/* KONSTANTEN */
// BYTE-Typ.
#define BYTE char
#define UBYTE unsigned char
/* KLASSE */
namespace THOMAS
{
class RelayProtocol
{
private:
// USB-Handle
int _handle;
// Sendet die Bytes an das Relay
void SendCommand(UBYTE command, UBYTE address, UBYTE data);
// Relay Status
bool ReceiveStatus();
public:
// Konstruktor
// Stellt die Verbindung zum Relay her und initialisiert diese
RelayProtocol();
// Setzt den Status eines Ports
void SetRelay(int port, bool status);
// Setzt alle Ports auf den jeweiligen Status
void SetAll(bool status);
};
}