Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
using Ryujinx.Common.Logging;
|
|
|
|
|
using Ryujinx.HLE.HOS.Ipc;
|
|
|
|
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
2023-01-04 23:15:45 +01:00
|
|
|
|
using Ryujinx.Horizon.Common;
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
2019-11-03 18:26:29 +01:00
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmUser
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
{
|
|
|
|
|
class IBtmUserCore : IpcService
|
|
|
|
|
{
|
|
|
|
|
public KEvent _bleScanEvent;
|
|
|
|
|
public int _bleScanEventHandle;
|
|
|
|
|
|
|
|
|
|
public KEvent _bleConnectionEvent;
|
|
|
|
|
public int _bleConnectionEventHandle;
|
|
|
|
|
|
|
|
|
|
public KEvent _bleServiceDiscoveryEvent;
|
|
|
|
|
public int _bleServiceDiscoveryEventHandle;
|
|
|
|
|
|
|
|
|
|
public KEvent _bleMtuConfigEvent;
|
|
|
|
|
public int _bleMtuConfigEventHandle;
|
|
|
|
|
|
|
|
|
|
public IBtmUserCore() { }
|
|
|
|
|
|
2021-04-14 00:01:24 +02:00
|
|
|
|
[CommandHipc(0)] // 5.0.0+
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
// AcquireBleScanEvent() -> (byte<1>, handle<copy>)
|
|
|
|
|
public ResultCode AcquireBleScanEvent(ServiceCtx context)
|
|
|
|
|
{
|
2023-01-04 23:15:45 +01:00
|
|
|
|
Result result = Result.Success;
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
if (_bleScanEventHandle == 0)
|
|
|
|
|
{
|
2020-05-04 05:41:29 +02:00
|
|
|
|
_bleScanEvent = new KEvent(context.Device.System.KernelContext);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
result = context.Process.HandleTable.GenerateHandle(_bleScanEvent.ReadableEvent, out _bleScanEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
if (result != Result.Success)
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
{
|
|
|
|
|
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
|
2020-08-04 01:32:53 +02:00
|
|
|
|
Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_bleScanEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
context.ResponseData.Write(result == Result.Success ? 1 : 0);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-14 00:01:24 +02:00
|
|
|
|
[CommandHipc(17)] // 5.0.0+
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
// AcquireBleConnectionEvent() -> (byte<1>, handle<copy>)
|
|
|
|
|
public ResultCode AcquireBleConnectionEvent(ServiceCtx context)
|
|
|
|
|
{
|
2023-01-04 23:15:45 +01:00
|
|
|
|
Result result = Result.Success;
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
if (_bleConnectionEventHandle == 0)
|
|
|
|
|
{
|
2020-05-04 05:41:29 +02:00
|
|
|
|
_bleConnectionEvent = new KEvent(context.Device.System.KernelContext);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
result = context.Process.HandleTable.GenerateHandle(_bleConnectionEvent.ReadableEvent, out _bleConnectionEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
if (result != Result.Success)
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
{
|
|
|
|
|
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
|
2020-08-04 01:32:53 +02:00
|
|
|
|
Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_bleConnectionEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
context.ResponseData.Write(result == Result.Success ? 1 : 0);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-14 00:01:24 +02:00
|
|
|
|
[CommandHipc(26)] // 5.0.0+
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
// AcquireBleServiceDiscoveryEvent() -> (byte<1>, handle<copy>)
|
|
|
|
|
public ResultCode AcquireBleServiceDiscoveryEvent(ServiceCtx context)
|
|
|
|
|
{
|
2023-01-04 23:15:45 +01:00
|
|
|
|
Result result = Result.Success;
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
if (_bleServiceDiscoveryEventHandle == 0)
|
|
|
|
|
{
|
2020-05-04 05:41:29 +02:00
|
|
|
|
_bleServiceDiscoveryEvent = new KEvent(context.Device.System.KernelContext);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
result = context.Process.HandleTable.GenerateHandle(_bleServiceDiscoveryEvent.ReadableEvent, out _bleServiceDiscoveryEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
if (result != Result.Success)
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
{
|
|
|
|
|
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
|
2020-08-04 01:32:53 +02:00
|
|
|
|
Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_bleServiceDiscoveryEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
context.ResponseData.Write(result == Result.Success ? 1 : 0);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-14 00:01:24 +02:00
|
|
|
|
[CommandHipc(33)] // 5.0.0+
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
// AcquireBleMtuConfigEvent() -> (byte<1>, handle<copy>)
|
|
|
|
|
public ResultCode AcquireBleMtuConfigEvent(ServiceCtx context)
|
|
|
|
|
{
|
2023-01-04 23:15:45 +01:00
|
|
|
|
Result result = Result.Success;
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
if (_bleMtuConfigEventHandle == 0)
|
|
|
|
|
{
|
2020-05-04 05:41:29 +02:00
|
|
|
|
_bleMtuConfigEvent = new KEvent(context.Device.System.KernelContext);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
result = context.Process.HandleTable.GenerateHandle(_bleMtuConfigEvent.ReadableEvent, out _bleMtuConfigEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
if (result != Result.Success)
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
{
|
|
|
|
|
// NOTE: We use a Logging instead of an exception because the call return a boolean if succeed or not.
|
2020-08-04 01:32:53 +02:00
|
|
|
|
Logger.Error?.Print(LogClass.ServiceBsd, "Out of handles!");
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_bleMtuConfigEventHandle);
|
|
|
|
|
|
2023-01-04 23:15:45 +01:00
|
|
|
|
context.ResponseData.Write(result == Result.Success ? 1 : 0);
|
Implement Bluetooth, Btm, Hid and Nsd services and calls. (#761)
- Implement `btdrv` service (IBluetoothDriver).
Implement call `InitializeBluetoothLe` for initialize events of `bt` service according to RE.
- Implement `bt` service (IBluetoothUser).
Implement call `RegisterBleEvent` according to RE.
- Add a placeholder for the `btm` service (close #750).
- Implement `btm:u` service (IBtmUser) (close #751).
Implement call `GetCore` according to RE (close #752).
- Implement `IBtmUserCore` and calls `AcquireBleScanEvent`, `AcquireBleConnectionEvent`, `AcquireBleServiceDiscoveryEvent` and `AcquireBleMtuConfigEvent` according to RE.
- Implement `SetPalmaBoostMode` in `IHidServer` according to RE.
- Add stub for `SetIsPalmaAllConnectable` in `IHidServer` because we will not support Palma devices soon.
- Implement `nsd:a` and `nsd:u` service (IManager) (close #755).
Implement call `ResolveEx` according to RE (close #756).
Implement calls `GetSettingName`, `GetEnvironmentIdentifier`, `GetDeviceId`, `DeleteSettings`, `Resolve`, `ReadSaveDataFromFsForTest`, `WriteSaveDataToFsForTest` and `DeleteSaveDataOfFsForTest` according to RE.
2019-09-06 16:58:50 +02:00
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|