am: Implement PopInteractiveOutData and PushInteractiveInData

Used by software keyboard applet for data transfer.
This commit is contained in:
Zach Hilman 2018-11-09 20:07:42 -05:00
parent 5ce6b8fea7
commit ba03bfa430
1 changed files with 24 additions and 14 deletions

View File

@ -548,6 +548,9 @@ public:
auto& kernel = Core::System::GetInstance().Kernel(); auto& kernel = Core::System::GetInstance().Kernel();
state_changed_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, state_changed_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
"ILibraryAppletAccessor:StateChangedEvent"); "ILibraryAppletAccessor:StateChangedEvent");
pop_interactive_out_data_event =
Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
"ILibraryAppletAccessor:PopInteractiveDataOutEvent");
} }
private: private:
@ -596,27 +599,34 @@ private:
LOG_DEBUG(Service_AM, "called"); LOG_DEBUG(Service_AM, "called");
} }
ctx.WriteBuffer(buffer.data() + offset, size); void PushInteractiveInData(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
interactive_storage_stack.push_back(rp.PopIpcInterface<IStorage>());
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_AM, "called, offset={}", offset); LOG_DEBUG(Service_AM, "called");
} }
};
class IStorage final : public ServiceFramework<IStorage> { void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
public: IPC::ResponseBuilder rb{ctx, 2, 0, 1};
explicit IStorage(std::vector<u8> buffer) rb.Push(RESULT_SUCCESS);
: ServiceFramework("IStorage"), buffer(std::move(buffer)) { rb.PushIpcInterface<IStorage>(std::move(interactive_storage_stack.back()));
// clang-format off
static const FunctionInfo functions[] = {
{0, &IStorage::Open, "Open"},
{1, nullptr, "OpenTransferStorage"},
};
// clang-format on
RegisterHandlers(functions); interactive_storage_stack.pop_back();
LOG_DEBUG(Service_AM, "called");
}
void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
pop_interactive_out_data_event->Signal();
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(pop_interactive_out_data_event);
LOG_WARNING(Service_AM, "(STUBBED) called");
} }
std::shared_ptr<Applets::Applet> applet; std::shared_ptr<Applets::Applet> applet;