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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// ------------------------------------------------------------------------------
// Copyright 2018 Uwe Arzt, mail@uwe-arzt.de
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------------

#[derive(Primitive, Debug)]
#[repr(u8)]
pub enum IMIMessageCode {
    LBusmonInd = 0x2B,
    LRawDataReq = 0x10,
    // LRawDataCon
    // LRawDataInd
    LDataReq = 0x11,
    LDataCon = 0x2E,
    LDataInd = 0x29,
    LPollDataReq = 0x13,
    LPollDataCon = 0x25,
    // NDataIndividualReq      = 0x13,
    NDataIndividualCon = 0x4E,
    NDataIndividualInd = 0x49,
    NDataGroupReq = 0x22,
    NDataGroupCon = 0x3E,
    NDataGroupInd = 0x3A,
    NDataBroadcastReq = 0x2C,
    NDataBroadcastCon = 0x4F,
    NDataBroadcastInd = 0x4D,
    NPollDataReq = 0x23,
    NPollDataCon = 0x35,
    TConnectReq = 0x43,
    TConnectCon = 0x86,
    TConnectInd = 0x85,
    TDisconnectReq = 0x44,
    TDisconnectCon = 0x88,
    TDisconnectInd = 0x87,
    TDataConnectedReq = 0x41,
    TDataConnectedCon = 0x8E,
    TDataConnectedInd = 0x89,
    TDataGroupReq = 0x32,
    TDataGroupCon = 0x7E,
    TDataGroupInd = 0x7A,
    TDataBroadcastReq = 0x4C,
    TDataBroadcastCon = 0x8F,
    TDataBroadcastInd = 0x8D,
    TDataIndividualReq = 0x4A,
    TDataIndividualCon = 0x9C,
    TDataIndividualInd = 0x94,
    TPollDataReq = 0x33,
    TPollDataCon = 0x75,
    // MConnectReq
    // MConnectCon
    MConnectInd = 0xD5,
    // MDisconnectReq
    // MDisconnectCon
    MDisconnectInd = 0xD7,
    MUserDataConnectedReq = 0x82,
    MUserDataConnectedCon = 0xD1,
    MUserDataConnectedInd = 0xD2,
    ADataGroupReq = 0x72,
    ADataGroupCon = 0xEE,
    ADataGroupInd = 0xEA,
    MUserDataIndividualReq = 0x81,
    MUserDataIndividualCon = 0xDE,
    MUserDataIndividualInd = 0xD9,
    APollDataReq = 0x73,
    APollDataCon = 0xE5,
    MInterfaceObjDataReq = 0x9A,
    MInterfaceObjDataCon = 0xDC,
    MInterfaceObjDataInd = 0xD4,
    UValueReadReq = 0x74,
    UValueReadCon = 0xE4,
    UFlagsReadReq = 0x7C,
    UFlagsReadCon = 0xEC,
    UEventInd = 0xE7,
    UValueWriteReq = 0x71,
    UUserData = 0xD0,
    PcSetValueReq = 0xA6,
    PcGetValueReq = 0xAC,
    PcGetValueCon = 0xAB,
    PeiIdentifyReq = 0xA7,
    PeiIdentifyCon = 0xA8,
    PeiSwitchReq = 0xA9,
    TmTimerInd = 0xC1,
}

/// IMI, entire packet send over KNX TP
pub struct IMI {}

enum FrameType {
    ExtendedFrame = 0x0,
    StandardFrame = 0x1,
}
enum RepeatFlag {
    Repeat = 0x0,
    DoNotRepeat = 0x1,
}

enum SystemBroadcast {
    SystemBroadcast = 0x0,
    Broadcast = 0x1,
}

enum Priority {
    System = 0x0,
    Normal = 0x1,
    Urgent = 0x2,
    Low = 0x3,
}

enum AcknowledgeRequest {
    NoACKRequested = 0x0,
    ACKRequested = 0x1,
}

enum Confirm {
    NoError = 0x0,
    Error = 0x1,
}

enum ExtendedFrameFormat {
    StandardFrame = 0x0,
}