LowLevelDriverInterface: don't use exceptions
[bcusdk.git] / eibd / libserver / lowlevel.h
blob69182917bddc47c862b6d798f13bd4964c903e9f
1 /*
2 EIBD eib bus access and management daemon
3 Copyright (C) 2005-2008 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef LOWLEVEL_H
21 #define LOWLEVEL_H
23 #include "common.h"
25 /** implements interface for a Driver to send packets for the EMI1/2 driver */
26 class LowLevelDriverInterface
28 public:
29 typedef enum
30 { vEMI1, vEMI2, vCEMI, vRaw } EMIVer;
32 virtual ~ LowLevelDriverInterface ()
35 virtual bool init () = 0;
37 /** sends a EMI frame asynchronous */
38 virtual void Send_Packet (CArray l) = 0;
39 /** all frames sent ? */
40 virtual bool Send_Queue_Empty () = 0;
41 /** returns semaphore, which becomes 1, if all frames are sent */
42 virtual pth_sem_t *Send_Queue_Empty_Cond () = 0;
43 /** waits for the next EMI frame
44 * @param stop return NULL, if stop occurs
45 * @return returns EMI frame or NULL
47 virtual CArray *Get_Packet (pth_event_t stop) = 0;
49 /** resets the connection */
50 virtual void SendReset () = 0;
51 /** indicate, if connections works */
52 virtual bool Connection_Lost () = 0;
54 virtual EMIVer getEMIVer () = 0;
57 /** pointer to a functions, which creates a Low Level interface
58 * @exception Exception in the case of an error
59 * @param conf string, which contain configuration
60 * @param t trace output
61 * @return new LowLevel interface
63 typedef LowLevelDriverInterface *(*LowLevel_Create_Func) (const char *conf,
64 Trace * t);
66 #endif