Stub srv:PublishToSubscriber (#766)
Some checks are pending
Android Build / x64 (release) (push) Waiting to run
Android Build / arm64 (release) (push) Waiting to run
HTTP Server Build / build (push) Waiting to run
Hydra Core Build / Windows (push) Waiting to run
Hydra Core Build / MacOS (push) Waiting to run
Hydra Core Build / Linux (push) Waiting to run
Hydra Core Build / Android-x64 (push) Waiting to run
Hydra Core Build / ARM-Libretro (push) Waiting to run
Linux AppImage Build / build (push) Waiting to run
Linux Build / build (push) Waiting to run
MacOS Build / MacOS-arm64 (push) Waiting to run
MacOS Build / MacOS-x86_64 (push) Waiting to run
MacOS Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Windows (push) Waiting to run
Qt Build / MacOS-arm64 (push) Waiting to run
Qt Build / MacOS-x86_64 (push) Waiting to run
Qt Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Linux (push) Waiting to run
Windows Build / build (push) Waiting to run
iOS Simulator Build / build (push) Waiting to run

This commit is contained in:
wheremyfoodat 2025-06-30 19:41:42 +03:00 committed by GitHub
parent 1fdaec2b0f
commit eb4e7573da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 5 deletions

View file

@ -89,6 +89,7 @@ class ServiceManager {
// "srv:" commands // "srv:" commands
void enableNotification(u32 messagePointer); void enableNotification(u32 messagePointer);
void getServiceHandle(u32 messagePointer); void getServiceHandle(u32 messagePointer);
void publishToSubscriber(u32 messagePointer);
void receiveNotification(u32 messagePointer); void receiveNotification(u32 messagePointer);
void registerClient(u32 messagePointer); void registerClient(u32 messagePointer);
void subscribe(u32 messagePointer); void subscribe(u32 messagePointer);

View file

@ -82,7 +82,8 @@ void ServiceManager::handleSyncRequest(u32 messagePointer) {
case Commands::GetServiceHandle: getServiceHandle(messagePointer); break; case Commands::GetServiceHandle: getServiceHandle(messagePointer); break;
case Commands::Subscribe: subscribe(messagePointer); break; case Commands::Subscribe: subscribe(messagePointer); break;
case Commands::Unsubscribe: unsubscribe(messagePointer); break; case Commands::Unsubscribe: unsubscribe(messagePointer); break;
default: Helpers::panic("Unknown \"srv:\" command: %08X", header); case Commands::PublishToSubscriber: publishToSubscriber(messagePointer); break;
default: Helpers::panic("Unknown \"srv:\" command: %08X", header); break;
} }
} }
@ -173,8 +174,8 @@ void ServiceManager::enableNotification(u32 messagePointer) {
} }
mem.write32(messagePointer, IPC::responseHeader(0x2, 1, 2)); mem.write32(messagePointer, IPC::responseHeader(0x2, 1, 2));
mem.write32(messagePointer + 4, Result::Success); // Result code mem.write32(messagePointer + 4, Result::Success); // Result code
mem.write32(messagePointer + 8, 0); // Translation descriptor mem.write32(messagePointer + 8, 0); // Translation descriptor
// Handle to semaphore signaled on process notification // Handle to semaphore signaled on process notification
mem.write32(messagePointer + 12, notificationSemaphore.value()); mem.write32(messagePointer + 12, notificationSemaphore.value());
} }
@ -183,8 +184,8 @@ void ServiceManager::receiveNotification(u32 messagePointer) {
log("srv::ReceiveNotification() (STUBBED)\n"); log("srv::ReceiveNotification() (STUBBED)\n");
mem.write32(messagePointer, IPC::responseHeader(0xB, 2, 0)); mem.write32(messagePointer, IPC::responseHeader(0xB, 2, 0));
mem.write32(messagePointer + 4, Result::Success); // Result code mem.write32(messagePointer + 4, Result::Success); // Result code
mem.write32(messagePointer + 8, 0); // Notification ID mem.write32(messagePointer + 8, 0); // Notification ID
} }
void ServiceManager::subscribe(u32 messagePointer) { void ServiceManager::subscribe(u32 messagePointer) {
@ -203,6 +204,14 @@ void ServiceManager::unsubscribe(u32 messagePointer) {
mem.write32(messagePointer + 4, Result::Success); mem.write32(messagePointer + 4, Result::Success);
} }
void ServiceManager::publishToSubscriber(u32 messagePointer) {
u32 id = mem.read32(messagePointer + 4);
log("srv::PublishToSubscriber (Notification ID = %d) (stubbed)\n", id);
mem.write32(messagePointer, IPC::responseHeader(0xC, 1, 0));
mem.write32(messagePointer + 4, Result::Success);
}
void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) { void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) {
switch (handle) { switch (handle) {
// Breaking alphabetical order a bit to place the ones I think are most common at the top // Breaking alphabetical order a bit to place the ones I think are most common at the top