bluetooth-mitm: add function to signal a fake hid event

This commit is contained in:
ndeadly 2021-02-09 21:53:32 +01:00
parent bb9ab12889
commit 2254589865
2 changed files with 9 additions and 0 deletions

View file

@ -84,6 +84,13 @@ namespace ams::bluetooth::hid {
return ams::ResultSuccess();
}
void SignalFakeEvent(HidEventType type, const void *data, size_t size) {
g_current_event_type = type;
std::memcpy(g_event_info_buffer, data, size);
os::SignalSystemEvent(&g_system_event_fwd);
}
void handleConnectionStateEvent(bluetooth::HidEventInfo *event_info) {
switch (event_info->connection_state.state) {
case BtdrvHidConnectionState_Connected:

View file

@ -32,4 +32,6 @@ namespace ams::bluetooth::hid {
Result GetEventInfo(ncm::ProgramId program_id, HidEventType *type, uint8_t* buffer, size_t size);
void HandleEvent(void);
void SignalFakeEvent(HidEventType type, const void *data, size_t size);
}