Add a connection status callback to notify when the connection becomes lossy

This commit is contained in:
Cameron Gutman
2019-03-17 01:37:09 -07:00
parent 4a7d28038d
commit 71a69204e9
3 changed files with 47 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ static void fakeClConnectionStarted(void) {}
static void fakeClConnectionTerminated(long errorCode) {}
static void fakeClLogMessage(const char* format, ...) {}
static void fakeClRumble(unsigned short controllerNumber, unsigned short lowFreqMotor, unsigned short highFreqMotor) {}
static void fakeClConnectionStatusUpdate(int connectionStatus) {}
static CONNECTION_LISTENER_CALLBACKS fakeClCallbacks = {
.stageStarting = fakeClStageStarting,
@@ -44,6 +45,7 @@ static CONNECTION_LISTENER_CALLBACKS fakeClCallbacks = {
.connectionTerminated = fakeClConnectionTerminated,
.logMessage = fakeClLogMessage,
.rumble = fakeClRumble,
.connectionStatusUpdate = fakeClConnectionStatusUpdate
};
void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS* drCallbacks, PAUDIO_RENDERER_CALLBACKS* arCallbacks,
@@ -116,5 +118,8 @@ void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS* drCallbacks, PAUDIO_REND
if ((*clCallbacks)->rumble == NULL) {
(*clCallbacks)->rumble = fakeClRumble;
}
if ((*clCallbacks)->connectionStatusUpdate == NULL) {
(*clCallbacks)->connectionStatusUpdate = fakeClConnectionStatusUpdate;
}
}
}