Skip to content
Merged
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
3 changes: 2 additions & 1 deletion GpioController/Services/TerminalService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace GpioController.Services;

public class TerminalService : ITerminalService
public class TerminalService(ILogger<TerminalService> logger) : ITerminalService
{
public string RunCommand(string command)
{
var process = CreateProcess(command);
process.Start();
logger.LogWarning($"Command Run: {command}");
return ReadOutput(process);
}

Expand Down
3 changes: 2 additions & 1 deletion GpioController/Services/TokenManagementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace GpioController.Services;

public class TokenManagementService(ICommandFactory commandFactory) : ITokenManagementService
public class TokenManagementService(ICommandFactory commandFactory, ILogger<TokenManagementService> logger) : ITokenManagementService
{
private readonly List<ActiveTask> activeTokenSources = new();
private readonly Lock lockingMechanism = new();
Expand Down Expand Up @@ -36,6 +36,7 @@ public void CancelAll()
foreach (var cts in activeTokenSources.Where(cts => !cts.TokenSource.IsCancellationRequested))
{
cts.TokenSource.Cancel();
logger.LogWarning($"Cancelling actions for Chipset {cts.ActiveRequest.Chipset} - GPIO {string.Join(',',cts.ActiveRequest.Gpios)}");
RunOppositeRequestToTurnOffAnyActiveGpios(cts.ActiveRequest);
Thread.Sleep(50);
}
Expand Down
6 changes: 6 additions & 0 deletions GpioController/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@
"Filters": {
"AllowOnlyTheseChipsets": [],
"AllowOnlyTheseGpios": []
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Binary file modified Installation/linux-arm64/gpio-controller-api-1.4.deb
Binary file not shown.
Binary file modified Installation/linux-x64/gpio-controller-api-1.4.deb
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ No coding required. Just follow the <a href="#installation">installation steps</
```
2. Then add the following line to the file
```sh
@reboot cd/opt/gpio-controller-api-1.4; ./GpioController
@reboot cd/opt/gpio-controller-api-1.4; ./GpioController >> /opt/gpio-controller-api-1.4-logs
```
</details>

Expand Down
Loading