Lines Matching defs:device
23 func WaitHDC(device string, ctx context.Context) bool {
50 if device == "" || dev == device {
54 logrus.Infof("%s not found", device)
58 func TryRebootToLoader(device string, ctx context.Context) error {
59 logrus.Infof("try to reboot %s to loader...", device)
61 if connected := WaitHDC(device, ctx); connected {
62 if device == "" {
65 return ExecContext(ctx, hdc, "-t", device, "shell", "reboot", "loader")
71 logrus.Warn("can not find target hdc device, assume it has been in loader mode")
75 func HdcShell(cmd, device string, ctx context.Context) error {
76 if device == "" {
79 return ExecContext(ctx, hdc, "-t", device, "shell", cmd)