MCPcopy Create free account
hub / github.com/360Controller/360Controller / Xbox360Peripheral

Class Xbox360Peripheral

360Controller/_60Controller.h:34–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32class ChatPadKeyboardClass;
33
34class Xbox360Peripheral : public IOService
35{
36 OSDeclareDefaultStructors(Xbox360Peripheral)
37
38private:
39 void ReleaseAll(void);
40 bool QueueRead(void);
41 bool QueueSerialRead(void);
42
43 static void SerialReadCompleteInternal(void *target,void *parameter,IOReturn status,UInt32 bufferSizeRemaining);
44 static void ReadCompleteInternal(void *target,void *parameter,IOReturn status,UInt32 bufferSizeRemaining);
45 static void WriteCompleteInternal(void *target,void *parameter,IOReturn status,UInt32 bufferSizeRemaining);
46
47 void SerialReadComplete(void *parameter, IOReturn status, UInt32 bufferSizeRemaining);
48
49 void readSettings(void);
50
51 static void ChatPadTimerActionWrapper(OSObject *owner, IOTimerEventSource *sender);
52 void ChatPadTimerAction(IOTimerEventSource *sender);
53 void SendToggle(void);
54 void SendSpecial(UInt16 value);
55 void SendInit(UInt16 value, UInt16 index);
56 bool SendSwitch(bool sendOut);
57
58 void PadConnect(void);
59 void PadDisconnect(void);
60
61 void SerialConnect(void);
62 void SerialDisconnect(void);
63 void SerialMessage(IOBufferMemoryDescriptor *data, size_t length);
64
65 void MakeSettingsChanges(void);
66
67protected:
68 typedef enum TIMER_STATE {
69 tsToggle,
70 tsReset1,
71 tsReset2,
72 tsMiniToggle,
73 tsSet1,
74 tsSet2,
75 tsSet3,
76 } TIMER_STATE;
77
78 typedef enum CONTROLLER_TYPE {
79 Xbox360 = 0,
80 XboxOriginal = 1,
81 XboxOne = 2,
82 XboxOnePretend360 = 3,
83 Xbox360Pretend360 = 4,
84 } CONTROLLER_TYPE;
85
86 IOUSBDevice *device;
87 IOLock *mainLock;
88
89 // Joypad
90 IOUSBInterface *interface;
91 IOUSBPipe *inPipe,*outPipe;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected