IBluetoothUser.cs 940 B

123456789101112131415161718192021222324252627282930
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using Ryujinx.HLE.HOS.Services.Bluetooth.BluetoothDriver;
  3. using Ryujinx.HLE.HOS.Services.Settings;
  4. namespace Ryujinx.HLE.HOS.Services.Bluetooth
  5. {
  6. [Service("bt")]
  7. class IBluetoothUser : IpcService
  8. {
  9. public IBluetoothUser(ServiceCtx context) { }
  10. [CommandHipc(9)]
  11. // RegisterBleEvent(pid) -> handle<copy>
  12. public ResultCode RegisterBleEvent(ServiceCtx context)
  13. {
  14. NxSettings.Settings.TryGetValue("bluetooth_debug!skip_boot", out object debugMode);
  15. if ((bool)debugMode)
  16. {
  17. context.Response.HandleDesc = IpcHandleDesc.MakeCopy(BluetoothEventManager.RegisterBleDebugEventHandle);
  18. }
  19. else
  20. {
  21. context.Response.HandleDesc = IpcHandleDesc.MakeCopy(BluetoothEventManager.RegisterBleEventHandle);
  22. }
  23. return ResultCode.Success;
  24. }
  25. }
  26. }