diff --git a/bridge b/bridge new file mode 100755 index 0000000..cd569c5 Binary files /dev/null and b/bridge differ diff --git a/cmd/bridge/ant.go b/cmd/bridge/ant.go index 888a688..b1b5065 100644 --- a/cmd/bridge/ant.go +++ b/cmd/bridge/ant.go @@ -41,7 +41,7 @@ func ListenForTrainer(vendorId uint16, productId uint16, deviceNumber uint32, } defer drv.Close() - logMsg("device opened") + logMsg("ant: device opened") if err := resetAndWait(drv); err != nil { panic(err) @@ -49,12 +49,12 @@ func ListenForTrainer(vendorId uint16, productId uint16, deviceNumber uint32, if err := device.StartRxScanModeWait(drv); err != nil { panic(err) } - logMsg("scan mode started") + logMsg("ant: scan mode started") msgs := make(chan ant.BroadcastMessage, 100) go device.DumpBroadcastMessages(context.Background(), drv, msgs) - logMsg("listening...") + logMsg("ant: listening...") for msg := range msgs { if msg.DeviceNumber() != deviceNumber { logPrintf("Received msg from ignored ant+ device %v\n", msg.DeviceNumber()) diff --git a/cmd/bridge/bluetooth.go b/cmd/bridge/bluetooth.go index b00788d..3b9bb42 100644 --- a/cmd/bridge/bluetooth.go +++ b/cmd/bridge/bluetooth.go @@ -49,7 +49,7 @@ func ExposeBluetooth(events <-chan Event) { ServiceUUIDs: []bluetooth.UUID{bluetooth.New16BitUUID(bleCyclingPowerServiceUUID)}, })) must(adapter.DefaultAdvertisement().Start()) - logMsg("BLE advertising...") + logMsg("bt: BLE advertising...") var totalRevs float64 var lastCompletedRev float64 // time in 1/1024s of last completed revolution @@ -85,5 +85,5 @@ func ExposeBluetooth(events <-chan Event) { logPrintf("bt: watts: %d rpm: %.0f completedRevs: %.0f lastRevTime: %.0f processingTime: %v\n", watts, rpm, completedRevs, lastCompletedRev, time.Now().Sub(now)) } - logMsg("BLE advertising stopped") + logMsg("bt: BLE advertising stopped") } diff --git a/cmd/bridge/cli.go b/cmd/bridge/cli.go index eb0cee8..e544106 100644 --- a/cmd/bridge/cli.go +++ b/cmd/bridge/cli.go @@ -62,15 +62,15 @@ This allows these trainers to be used with modern devices that don't support ANT c.deviceNumber = uint32(deviceNumber) logMsgf("ANT Bridge %s built %s", Version, BuildTime) - logMsgf("vendor: 0x%04x/%d", vendorID, vendorID) - logMsgf("product: 0x%04x/%d", productID, productID) - logMsgf("device: 0x%03x/%d", deviceNumber, deviceNumber) + logMsgf("usb: vendor: 0x%04x/%d", vendorID, vendorID) + logMsgf("usb: product: 0x%04x/%d", productID, productID) + logMsgf("ant: device: 0x%03x/%d", deviceNumber, deviceNumber) if err := exec.Command("hciconfig", "hci0", "down").Run(); err != nil { - logPrintf("hciconfig down failed: %v\n", err) + logPrintf("bt: hciconfig down failed: %v\n", err) } if err := exec.Command("hciconfig", "hci0", "up").Run(); err != nil { - logPrintf("hciconfig up failed: %v\n", err) + logPrintf("bt: hciconfig up failed: %v\n", err) } events := make(chan Event, 1)