Add Default File for Capture Replay

This commit is contained in:
Justin Hammond 2022-01-14 14:14:34 +08:00
parent 2909a70459
commit cfe9aa0ae4
4 changed files with 3 additions and 2 deletions

View file

@ -49,8 +49,8 @@ func main() {
dc := dcdcusb.DcDcUSB{} dc := dcdcusb.DcDcUSB{}
if *simulation { if *simulation {
if err := sim.SetCaptureFile("dcdcusb.txt"); err != nil { if err := sim.SetCaptureFile("dcdcusb.cap"); err != nil {
fmt.Printf("Can't open Capture File dcdcusb.txt: %s\n", err) fmt.Printf("Can't open Capture File dcdcusb.cap: %s\n", err)
os.Exit(-1) os.Exit(-1)
} }
} }

View file

@ -133,6 +133,7 @@ func (dc *DcDcUSB) Init(log logadapter.Logger, simulation bool) {
if !simulation { if !simulation {
dc.usbif = realusb.Init(dc.log) dc.usbif = realusb.Init(dc.log)
} else { } else {
sim.SetCaptureFile("dcdcusb.cap")
dc.usbif = sim.Init(dc.log) dc.usbif = sim.Init(dc.log)
} }
} }