1//
2//  GetEntry.h
3//  IrDA Status
4//
5//  Created by jwilcox on Mon Apr 23 2001.
6//  Copyright (c) 2001 Apple Computer, Inc. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#include <mach/mach.h>
12#include <mach/mach_interface.h>
13
14#include <IOKit/IOTypes.h>
15#if MAC_OS_X_VERSION_10_5
16#include <IOKit/iokitmig.h>
17#else
18#include <IOKit/iokitmig_c.h>
19#endif
20#include <IOKit/IOKitLib.h>
21
22#include "IrDAUserClient.h"
23
24typedef struct IrDAEventDesc				// Each entry in the saved log looks like this
25{
26	UInt16				data1;				// two 16 bit numbers for the log
27	UInt16				data2;
28	UInt32				timeStamp;			// timestamp of the log entry - in microseconds
29	char				*msg;				// pointer to copy of event msg
30} IrDAEventDesc, *IrDAEventDescPtr;
31
32typedef struct IrDALogHdr					// The one global log header to keep track of the log buffer
33{
34	IrDAEventDescPtr	fEventBuffer;		// pointer to base of the event log
35	UInt32				fEventIndex;		// index of next available log entry
36	UInt32				fPrintIndex;		// set by dcmd to keep track of what's pretty printed already
37	UInt32				fNumEntries;		// kEntryCount -- let dcmd know when to wrap
38	Boolean				fTracingOn;			// true if allowing adds
39	Boolean				fWrapped;			// true if adding log entries wrapped past the printing ptr
40} IrDALogHdr, *IrDAEventLogPtr;
41
42typedef struct IrDALogInfo					// The pointers and buffers passed by to the dumplog application
43{
44	IrDALogHdr		*hdr;						// the global log header (points to event array)
45	UInt32			hdrSize;					// size of the log hdr
46	IrDAEventDesc	*eventLog;					// the event buffer
47	UInt32			eventLogSize;				// size of the event log array
48	char			*msgBuffer;					// pointer buffer of messages
49	UInt32			msgBufferSize;				// size of above
50} IrDALogInfo;
51
52@interface GetEntry : NSObject {
53
54}
55
56kern_return_t doCommand(io_connect_t con, unsigned char commandID, void *inputData, unsigned long inputDataSize, void *outputData, size_t *outputDataSize);
57
58+ (NSString *) GetCurrentDriverName;
59+ (void) getEntry: (NSMutableArray *)logItems;
60
61@end
62