1 |
/* debugmodule.h |
---|
2 |
* Copyright (C) 2004 by Daniel Wagner |
---|
3 |
* |
---|
4 |
* This file is part of FreeBob. |
---|
5 |
* |
---|
6 |
* FreeBob is free software; you can redistribute it and/or modify |
---|
7 |
* it under the terms of the GNU General Public License as published by |
---|
8 |
* the Free Software Foundation; either version 2 of the License, or |
---|
9 |
* (at your option) any later version. |
---|
10 |
* FreeBob 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. |
---|
14 |
* |
---|
15 |
* You should have received a copy of the GNU General Public License |
---|
16 |
* along with FreeBob; if not, write to the Free Software |
---|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
18 |
* MA 02111-1307 USA. |
---|
19 |
*/ |
---|
20 |
|
---|
21 |
#ifndef DEBUGMODULE_H |
---|
22 |
#define DEBUGMODULE_H |
---|
23 |
|
---|
24 |
#include <stdio.h> |
---|
25 |
#include "ieee1394service.h" |
---|
26 |
|
---|
27 |
#define DEBUG_LEVEL_INFO (1<<0) |
---|
28 |
#define DEBUG_LEVEL_DEVICE (1<<1) |
---|
29 |
#define DEBUG_LEVEL_SUBUNIT (1<<2) |
---|
30 |
#define DEBUG_LEVEL_DESCRIPTOR (1<<3) |
---|
31 |
#define DEBUG_LEVEL_INFOBLOCK (1<<4) |
---|
32 |
|
---|
33 |
#define DEBUG_LEVEL_TRANSFERS (1<<5) |
---|
34 |
|
---|
35 |
#define DEBUG_LEVEL_ALL (DEBUG_LEVEL_INFO | DEBUG_LEVEL_DEVICE | DEBUG_LEVEL_SUBUNIT | DEBUG_LEVEL_DESCRIPTOR | DEBUG_LEVEL_INFOBLOCK | DEBUG_LEVEL_TRANSFERS ) |
---|
36 |
|
---|
37 |
#define DEBUG_LEVEL_MODERATE (DEBUG_LEVEL_INFO | DEBUG_LEVEL_DEVICE | DEBUG_LEVEL_SUBUNIT) |
---|
38 |
|
---|
39 |
#define DEBUG_LEVEL DEBUG_LEVEL_MODERATE |
---|
40 |
|
---|
41 |
#define DEBUG |
---|
42 |
|
---|
43 |
#ifdef DEBUG |
---|
44 |
#define debugError(format, args...) fprintf( stderr, format, ##args ) |
---|
45 |
// #define debugPrint(Level, format, args...) if(DEBUG_LEVEL & Level) { int idebug=Level; while(idebug) {printf(" "); idebug=idebug>>1;} printf( format, ##args ); } |
---|
46 |
#define debugPrint(Level, format, args...) if(DEBUG_LEVEL & Level) { printf( format, ##args ); } |
---|
47 |
#else |
---|
48 |
#define debugError(format, args...) |
---|
49 |
#define debugPrint(Level, format, args...) |
---|
50 |
#endif |
---|
51 |
|
---|
52 |
unsigned char toAscii(unsigned char c); |
---|
53 |
void quadlet2char(quadlet_t quadlet,unsigned char* buff); |
---|
54 |
void hexDump(unsigned char *data_start, unsigned int length); |
---|
55 |
|
---|
56 |
|
---|
57 |
#endif |
---|