Commit Graph

9 Commits

Author SHA1 Message Date
7f52f0ff68 feat: make --device flag optional with 'any' default
When --device is omitted or set to 0, the bridge listens to all
broadcasting ANT+ trainers instead of filtering by a specific device.
The actual transmitting device ID is shown in data logs, allowing
users to discover and then filter specific trainers.

Also fix vendorID/productID not being assigned to config struct
which caused ListenForTrainer to receive 0 for both values.
2026-05-26 23:06:05 +00:00
19e4e78c75 feat: add protocol prefixes to log messages
Prefix log output with 'ant:', 'bt:', or 'usb:' to distinguish
between ANT+, Bluetooth LE, and USB device messages.
2026-05-26 22:45:43 +00:00
6bb59b845c removed obsolete setup.md 2026-05-27 00:38:24 +02:00
72987c5935 refactor: replace magic hex constants with named constants
- Add BLE spec constants for service/characteristic UUIDs and signal flag
- Add ANT+ spec constants for data page mask and cycling power page
- Add descriptive comments explaining each constant's origin and purpose
2026-05-27 00:36:06 +02:00
4949beae3e fix: synchronize logs, buffer events channel, exit on goroutine failure
- Add mutex to prevent interleaved log output from concurrent goroutines
- Make logMsg delegate to logPrintf for consistent synchronization
- Buffer events channel to size 1 with select/drop when full
- Close events channel on ListenForTrainer exit so process terminates
2026-05-27 00:36:06 +02:00
b24513fcc3 feat: add CLI with Cobra and timestamped logging
Introduce structured CLI argument parsing using Cobra with three
configurable flags:
  --vendor: USB vendor ID (default: 0x0fcf)
  --product: USB product ID (default: 0x1008)
  --device: ANT+ device number (default: 3001)

Add timestamped logging for all log statements with format
YYYY-MM-DD HH:MM:SS. Log vendor, product, and device values at
startup in both hex and decimal.

Remove hardcoded USB identifiers from main.go and consolidate all
startup logic into cli.go with a dedicated Config struct.

Update ant.go ListenForTrainer signature to accept uint16 for
vendor and product IDs.
2026-05-27 00:36:06 +02:00
39b5a95eb4 logging with date time format. 2026-05-27 00:36:06 +02:00
29d7dc1632 Fully functional ant+ to bluetooth bridge. 2026-05-27 00:36:06 +02:00
0a48932baa seprating the ant+ code out. 2026-05-27 00:36:06 +02:00