Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions SysBot.Base/Connection/Console/IConsoleConnectionAsync.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -8,8 +9,8 @@ namespace SysBot.Base;
/// </summary>
public interface IConsoleConnectionAsync : IConsoleConnection
{
ValueTask<int> SendAsync(byte[] buffer, CancellationToken token);
ValueTask<int> SendAsync(ReadOnlyMemory<byte> buffer, CancellationToken token = default);

Task<byte[]> ReadBytesAsync(uint offset, int length, CancellationToken token);
Task WriteBytesAsync(byte[] data, uint offset, CancellationToken token);
Task<byte[]> ReadBytesAsync(uint offset, int length, CancellationToken token = default);
Task WriteBytesAsync(ReadOnlyMemory<byte> data, uint offset, CancellationToken token = default);
}
4 changes: 2 additions & 2 deletions SysBot.Base/Connection/Console/IConsoleConnectionSync.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace SysBot.Base;

Expand All @@ -7,7 +7,7 @@ namespace SysBot.Base;
/// </summary>
public interface IConsoleConnectionSync : IConsoleConnection
{
int Send(byte[] buffer);
int Send(ReadOnlySpan<byte> buffer);

byte[] ReadBytes(uint offset, int length);
void WriteBytes(ReadOnlySpan<byte> data, uint offset);
Expand Down
42 changes: 21 additions & 21 deletions SysBot.Base/Connection/Switch/ISwitchConnectionAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ namespace SysBot.Base;
/// </summary>
public interface ISwitchConnectionAsync : IConsoleConnectionAsync
{
Task<ulong> GetMainNsoBaseAsync(CancellationToken token);
Task<ulong> GetHeapBaseAsync(CancellationToken token);
Task<string> GetTitleID(CancellationToken token);
Task<string> GetBotbaseVersion(CancellationToken token);
Task<string> GetGameInfo(string info, CancellationToken token);
Task<bool> IsProgramRunning(ulong pid, CancellationToken token);
Task<ulong> GetMainNsoBaseAsync(CancellationToken token = default);
Task<ulong> GetHeapBaseAsync(CancellationToken token = default);
Task<string> GetTitleID(CancellationToken token = default);
Task<string> GetBotbaseVersion(CancellationToken token = default);
Task<string> GetGameInfo(string info, CancellationToken token = default);
Task<bool> IsProgramRunning(ulong pid, CancellationToken token = default);

Task<byte[]> ReadBytesMainAsync(ulong offset, int length, CancellationToken token);
Task<byte[]> ReadBytesAbsoluteAsync(ulong offset, int length, CancellationToken token);
Task<byte[]> ReadBytesMainAsync(ulong offset, int length, CancellationToken token = default);
Task<byte[]> ReadBytesAbsoluteAsync(ulong offset, int length, CancellationToken token = default);

Task<byte[]> ReadBytesMultiAsync(IReadOnlyDictionary<ulong, int> offsetSize, CancellationToken token);
Task<byte[]> ReadBytesAbsoluteMultiAsync(IReadOnlyDictionary<ulong, int> offsetSize, CancellationToken token);
Task<byte[]> ReadBytesMainMultiAsync(IReadOnlyDictionary<ulong, int> offsetSize, CancellationToken token);
Task<byte[]> ReadBytesMultiAsync(IReadOnlyDictionary<ulong, int> offsetSize, CancellationToken token = default);
Task<byte[]> ReadBytesAbsoluteMultiAsync(IReadOnlyDictionary<ulong, int> offsetSize, CancellationToken token = default);
Task<byte[]> ReadBytesMainMultiAsync(IReadOnlyDictionary<ulong, int> offsetSize, CancellationToken token = default);

Task WriteBytesMainAsync(Span<byte> data, ulong offset, CancellationToken token);
Task WriteBytesAbsoluteAsync(Span<byte> data, ulong offset, CancellationToken token);
Task WriteBytesMainAsync(ReadOnlyMemory<byte> data, ulong offset, CancellationToken token = default);
Task WriteBytesAbsoluteAsync(ReadOnlyMemory<byte> data, ulong offset, CancellationToken token = default);

Task<byte[]> ReadRaw(byte[] command, int length, CancellationToken token);
Task SendRaw(byte[] command, CancellationToken token);
Task<byte[]> ReadRaw(ReadOnlyMemory<byte> command, int length, CancellationToken token = default);
Task SendRaw(ReadOnlyMemory<byte> command, CancellationToken token = default);

Task<byte[]> PointerPeek(int size, IEnumerable<long> jumps, CancellationToken token);
Task PointerPoke(byte[] data, IEnumerable<long> jumps, CancellationToken token);
Task<ulong> PointerAll(IEnumerable<long> jumps, CancellationToken token);
Task<ulong> PointerRelative(IEnumerable<long> jumps, CancellationToken token);
Task<(bool Success, T Value)> TryReadMain<T>(ulong offset, CancellationToken token) where T : unmanaged;
Task<(bool Success, T Value)> TryReadAbsolute<T>(ulong offset, CancellationToken token) where T : unmanaged;
Task<byte[]> PointerPeek(int size, IEnumerable<long> jumps, CancellationToken token = default);
Task PointerPoke(ReadOnlyMemory<byte> data, IEnumerable<long> jumps, CancellationToken token = default);
Task<ulong> PointerAll(IEnumerable<long> jumps, CancellationToken token = default);
Task<ulong> PointerRelative(IEnumerable<long> jumps, CancellationToken token = default);
Task<(bool Success, T Value)> TryReadMain<T>(ulong offset, CancellationToken token = default) where T : unmanaged;
Task<(bool Success, T Value)> TryReadAbsolute<T>(ulong offset, CancellationToken token = default) where T : unmanaged;
}
3 changes: 2 additions & 1 deletion SysBot.Base/Connection/Switch/SwitchConfigureParameter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace SysBot.Base;
// ReSharper disable InconsistentNaming - match botbase naming
namespace SysBot.Base;

/// <summary>
/// Valid configuration request types for the Nintendo Switch to be sent as a <see cref="SwitchCommand"/>.
Expand Down
Loading