2 EIB Demo program - common functions
3 Copyright (C) 2005-2007 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
23 #include "eibclient.h"
26 typedef unsigned char uchar
;
28 /** print hex dump of a buffer
29 * \param len Length of the buffer
32 void printHex (int len
, uchar
* data
);
33 /** aborts the program and prints message
34 * \param msg Message (printf like)
36 void die (const char *msg
, ...);
37 /** parses a EIB address
38 * \param addr string with the EIB address
41 eibaddr_t
readaddr (const char *addr
);
42 /** parses a EIB group address
43 * \param addr string with the EIB address
46 eibaddr_t
readgaddr (const char *addr
);
47 /** parses a hex number
49 * \return parsed hex number
51 unsigned readHex (const char *addr
);
52 /** parse hex numbers (byte size) out of a comand line
53 * \param buf output buffer
54 * \param size buffer size
55 * \param ac argument count
56 * \param ag argument array
57 * \return parsed bytes
59 int readBlock (uchar
* buf
, int size
, int ac
, char *ag
[]);
60 /** prints a EIB individual address
61 * \param addr EIB address
63 void printIndividual (eibaddr_t addr
);
64 void printGroup (eibaddr_t addr
);
66 void parseKey (int *ac
, char **ag
[]);
67 void auth (EIBConnection
*);