2 EIBD eib bus access and management daemon
3 Copyright (C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 /** enumartion of Layer 2 frame types*/
33 /** L_Data incomplete */
41 /** busmonitor or vBusmonitor frame */
46 /** represents a Layer 2 frame */
54 virtual bool init (const CArray
& c
) = 0;
55 /** convert to a character array */
56 virtual CArray
ToPacket () = 0;
57 /** decode content as string */
58 virtual String
Decode () = 0;
60 virtual LPDU_Type
getType () const = 0;
61 /** converts a character array to a Layer 2 frame */
62 static LPDU
*fromPacket (const CArray
& c
);
67 class L_Unknown_PDU
:public LPDU
75 bool init (const CArray
& c
);
78 LPDU_Type
getType () const
86 class L_Data_PDU
:public LPDU
97 /** to group/individual address*/
98 EIB_AddrType AddrType
;
99 eibaddr_t source
, dest
;
101 /** payload of Layer 4 */
106 bool init (const CArray
& c
);
109 LPDU_Type
getType () const
111 return (valid_length
? L_Data
: L_Data_Part
);
117 class L_Busmonitor_PDU
:public LPDU
120 /** content of the TP1 frame */
125 bool init (const CArray
& c
);
128 LPDU_Type
getType () const
136 class L_Data_Ind_PDU
:public L_Data_PDU
142 L_Data_Ind_PDU (const L_Data_PDU
& c
):L_Data_PDU (c
)
146 LPDU_Type
getType () const
152 class L_ACK_PDU
:public LPDU
158 bool init (const CArray
& c
);
161 LPDU_Type
getType () const
167 class L_NACK_PDU
:public LPDU
173 bool init (const CArray
& c
);
176 LPDU_Type
getType () const
182 class L_BUSY_PDU
:public LPDU
188 bool init (const CArray
& c
);
191 LPDU_Type
getType () const