Lines Matching refs:ctx
23 func WaitHDC(device string, ctx context.Context) bool {
24 ctx, cancelFn := context.WithTimeout(ctx, 20*time.Second)
28 case <-ctx.Done():
32 ExecContext(ctx, hdc, "kill")
34 ExecContext(ctx, hdc, "start")
36 out, err := ExecCombinedOutputContext(ctx, hdc, "list", "targets")
58 func TryRebootToLoader(device string, ctx context.Context) error {
61 if connected := WaitHDC(device, ctx); connected {
63 return ExecContext(ctx, hdc, "shell", "reboot", "loader")
65 return ExecContext(ctx, hdc, "-t", device, "shell", "reboot", "loader")
68 if err := ctx.Err(); err != nil {
75 func HdcShell(cmd, device string, ctx context.Context) error {
77 return ExecContext(ctx, hdc, "shell", cmd)
79 return ExecContext(ctx, hdc, "-t", device, "shell", cmd)