1/* 2 File: IrDALog.h 3 4 Contains: Class definition for IrDA logging object 5 6 Written by: Clark Donahue, Jim Guyton 7 8 Add copyright 9 10 11*/ 12 13#ifndef __IRDALOG__ 14#define __IRDALOG__ 15 16#include <IOKit/IOTypes.h> 17 18typedef struct EventTraceCauseDesc // An array of these is supplied by each logging client 19{ 20 UInt32 cause; // really a single byte cause enumeration 21 const char *description; // descriptive text 22 char *msgcopy; // client sets to nil. Set by IrDALog to point to cached copy of msg 23} EventTraceCauseDesc; 24 25typedef struct IrDAEventDesc // Each entry in the saved log looks like this 26{ 27 UInt16 data1; // two 16 bit numbers for the log 28 UInt16 data2; 29 UInt32 timeStamp; // timestamp of the log entry - in microseconds 30 char *msg; // pointer to copy of event msg 31} IrDAEventDesc, *IrDAEventDescPtr; 32 33typedef struct IrDALogHdr // The one global log header to keep track of the log buffer 34{ 35 IrDAEventDescPtr fEventBuffer; // pointer to base of the event log 36 UInt32 fEventIndex; // index of next available log entry 37 UInt32 fPrintIndex; // set by dcmd to keep track of what's pretty printed already 38 UInt32 fNumEntries; // kEntryCount -- let dcmd know when to wrap 39 Boolean fTracingOn; // true if allowing adds 40 Boolean fWrapped; // true if adding log entries wrapped past the printing ptr 41 //Boolean fWrappingEnabled; // true if wrapping allowed 42} IrDALogHdr, *IrDAEventLogPtr; 43 44typedef struct IrDALogInfo // The pointers and buffers passed by to the dumplog application 45{ 46 IrDALogHdr *hdr; // the global log header (points to event array) 47 UInt32 hdrSize; // size of the log hdr 48 IrDAEventDesc *eventLog; // the event buffer 49 UInt32 eventLogSize; // size of the event log array 50 char *msgBuffer; // pointer buffer of messages 51 UInt32 msgBufferSize; // size of above 52} IrDALogInfo; 53 54 55#ifdef __cplusplus 56extern "C" 57{ 58#endif 59void IrDALogAdd ( UInt16 eventIndex, // index of log entry in table (1-based) 60 UInt16 data1, // arbitrary data for the log, first 16 bits 61 UInt16 data2, // arbitrary data for the log, 2nd 16 bits 62 EventTraceCauseDesc *desc, // base of event trace table 63 Boolean timeStamp); // true if want log entry timestamped 64 65void IrDALogTracingOn ( void ); // default is on 66void IrDALogTracingOff ( void ); 67//void IrDALogWrappingOff(); 68//void IrDALogWrappingOn(); 69 70void IrDALogReset ( void ); 71IrDALogInfo *IrDALogGetInfo(void); 72 73#ifdef __cplusplus 74} // extern C 75#endif 76 77 78 79#endif // __IRDALOG__