Skip to content

Commit

Permalink
chore: set up pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanjenkner committed Oct 3, 2024
1 parent ef52a22 commit 9e63538
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"MD033": {
"allowed_elements": [
"summary",
"details"
]
}
}
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ repos:
rev: v1.61.0
hooks:
- id: golangci-lint
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.14.0
hooks:
- id: markdownlint-cli2
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
# FDF Console monitor

Expose a First Degree Fitness water rower as BLE (Bluetooth Low Energy) peripheral providing Fitness Machine Service
(FTMS) rower data.
Expose a First Degree Fitness water rower as BLE (Bluetooth Low Energy)
peripheral providing Fitness Machine Service (FTMS) rower data.

Tested with First Degree Fitness NEON plus water rower which comes with the (basic) FDF Console and a serial interface.
Tested with First Degree Fitness NEON plus water rower which comes with the
(basic) FDF Console and a serial interface.

## Usage

Install dependencies and build:
Run:

go mod download
```bash
go run ./cmd/app --name "FDF Rower" --port /dev/ttyUSB0
```

Run:
## Advanced usage: building on Linux for running in non-root context

Build binary on Linux - e.g. for running on Raspberry Pi:

```bash
CGO_ENABLED=0 go build -a -o fdf-console-monitor ./cmd/app
```

go run ./cmd/app --name "FDF Rower" --port /dev/ttyUSB0
Grant only specific capabilities instead of full root access:

Optional: Build binary for Linux and set capability flags:
```bash
sudo setcap 'cap_net_raw,cap_net_admin+eip' ./fdf-console-monitor
```

CGO_ENABLED=0 go build -a -o fdf-console-monitor ./cmd/app
sudo setcap 'cap_net_raw,cap_net_admin+eip' fdf-console-monitor
./fdf-console-monitor --name "FDF Rower" --port /dev/ttyUSB0
Run as non-root:

```bash
./fdf-console-monitor --name "FDF Rower" --port /dev/ttyUSB0
```

## Contribution

Expand All @@ -31,6 +44,7 @@ Prerequisites for development:
```bash
brew install pre-commit commitizen golangci-lint
```

</details>

Set up pre-commit hooks:
Expand Down

0 comments on commit 9e63538

Please sign in to comment.