wavelength 1.0.0
Loading...
Searching...
No Matches
ineteventqueue.h
Go to the documentation of this file.
1#pragma once
2
3#include <inetctl.h>
4
12public:
20
22 static constexpr int kInterfaceCount = 2;
23
25 static constexpr int kQueueSize = 16;
26
36 static int GetEvent(int *interfaceId, int *event);
37
47 static int MapEvent(int interfaceId, int event);
48
57 static void EventHandler(int interfaceId, int event);
58
61
63 static int sLockSema;
64
66 static int sCountSema;
67
69 static int sReadIndex;
70
72 static int sWriteIndex;
73
75 static unsigned int sFlags;
76
78 static sceInetCtlEventHandler sHandler;
79
80private:
82 enum Flag {
83 kFlagEventReceived = 0x01,
84 kFlagOverflow = 0x02,
85 };
86
95 static void RecordInterface(int interfaceId);
96
105 static int IsPrimaryInterface(int interfaceId);
106
108 static int sInterfaceIdQueue[kQueueSize];
109
111 static int sEventQueue[kQueueSize];
112};
Queue of the inetctl events.
Definition ineteventqueue.h:11
static sceInetCtlEventHandler sHandler
Registration of EventHandler().
Definition ineteventqueue.h:78
static int sReadIndex
Index of the oldest event.
Definition ineteventqueue.h:69
static void EventHandler(int interfaceId, int event)
Event handler.
static constexpr int kQueueSize
Capacity of the queue.
Definition ineteventqueue.h:25
static int sCountSema
Semaphore that counts the queued events.
Definition ineteventqueue.h:66
static int GetEvent(int *interfaceId, int *event)
Take the oldest event, waiting up to five times 0.3 seconds for the first one.
static unsigned int sFlags
Flag bits.
Definition ineteventqueue.h:75
static int sInterfaceIds[kInterfaceCount]
Recorded interfaces.
Definition ineteventqueue.h:60
static int sLockSema
Semaphore that guards the queue.
Definition ineteventqueue.h:63
static int sWriteIndex
Index the next event goes to.
Definition ineteventqueue.h:72
InterfaceState
Interface states MapEvent() reports.
Definition ineteventqueue.h:14
@ kInterfaceLost
Definition ineteventqueue.h:18
@ kInterfaceDown
Definition ineteventqueue.h:17
@ kInterfaceUp
Definition ineteventqueue.h:16
@ kInterfaceNone
Definition ineteventqueue.h:15
static constexpr int kInterfaceCount
Number of recorded interfaces.
Definition ineteventqueue.h:22
static int MapEvent(int interfaceId, int event)
Turn an event into an InterfaceState, recording a started interface.