quDIS-protocol
ucprotocol.h
Go to the documentation of this file.
1 /********************************************************************
2  *
3  * Project: Controller Interface
4  *
5  * Filename: ucprotocol.h
6  *
7  * Purpose: Protocol Elements
8  *
9  * Author: N-Hands GmbH & Co KG
10  */
11 /*******************************************************************/
18 /*******************************************************************/
19 /* $Id: ucprotocol.h,v 1.3 2020/12/15 18:14:53 trurl Exp $ */
20 
21 #ifndef __UCPROTOCOL_H
22 #define __UCPROTOCOL_H
23 
24 
30 #define UC_MAXSIZE 4096
31 
32 
37 #define UC_MAXDATA ((UC_MAXSIZE - sizeof(UcTelegram)) / sizeof(Int32))
38 
39 
47 #define UC_SET 0
48 #define UC_GET 1
49 #define UC_ACK 3
50 #define UC_TELL 4
62 #define UC_REASON_OK 0
63 #define UC_REASON_ADDR 1
64 #define UC_REASON_RANGE 2
65 #define UC_REASON_IGNORED 3
66 #define UC_REASON_VERIFY 4
67 #define UC_REASON_TYPE 5
68 #define UC_REASON_UNKNW 99
76 #ifdef _MSC_VER
77 typedef __int32 Int32;
78 #else
79 #include <inttypes.h>
80 typedef int32_t Int32;
81 #endif
82 
87 typedef struct {
93 } UcTelegram;
94 
100 typedef struct {
102  Int32 data[1];
103 } UcSetTelegram;
104 
109 typedef struct {
111 } UcGetTelegram;
112 
118 typedef struct {
121  Int32 data[1];
122 } UcAckTelegram;
123 
128 typedef struct {
130  Int32 data[1];
132 
133 
134 #endif
Tell telegram.
Definition: ucprotocol.h:128
UcTelegram hdr
Telegram header.
Definition: ucprotocol.h:110
Int32 opcode
Opcode, UC_SET, UC_GET etc.
Definition: ucprotocol.h:89
Get telegram.
Definition: ucprotocol.h:109
UcTelegram hdr
Telegram header.
Definition: ucprotocol.h:129
Telegram header.
Definition: ucprotocol.h:87
Ack telegram.
Definition: ucprotocol.h:118
UcTelegram hdr
Telegram header.
Definition: ucprotocol.h:119
Int32 index
Sub-identifier of the object (if applicable)
Definition: ucprotocol.h:91
UcTelegram hdr
Telegram header.
Definition: ucprotocol.h:101
Int32 correlationNumber
Identity number for matching the answer.
Definition: ucprotocol.h:92
Int32 address
Identifier (name) of the controller object.
Definition: ucprotocol.h:90
Int32 reason
Error code, UC_REASON...
Definition: ucprotocol.h:120
Int32 length
Length of the rest(!) of the telegram.
Definition: ucprotocol.h:88
__int32 Int32
Basic Type.
Definition: ucprotocol.h:77
Set telegram.
Definition: ucprotocol.h:100