Skip to content

Commit

Permalink
transport: Remove echo in transport selection
Browse files Browse the repository at this point in the history
Do not echo the selected transport to avoid stray and confusing
messages in the output of OpenOCD. For example, the "swd" line here:

  Open On-Chip Debugger 0.12.0+dev-00559-ge02f6c1b9-dirty
  Licensed under GNU GPL v2
  For bug reports, read
  	http://openocd.org/doc/doxygen/bugs.html
  swd
  Info : Listening on port 6666 for tcl connections
  Info : Listening on port 4444 for telnet connections

While at it, fix some small documentation style issues.

Change-Id: Ie85426c441289bbaa35615dbb7b53f0b5c46cfc0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8217
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
  • Loading branch information
zapb-0 authored and borneoa committed Aug 2, 2024
1 parent d5adab6 commit b9224c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 7 additions & 9 deletions doc/openocd.texi
Original file line number Diff line number Diff line change
Expand Up @@ -3693,20 +3693,18 @@ displays the names of the transports supported by this
version of OpenOCD.
@end deffn

@deffn {Command} {transport select} @option{transport_name}
@deffn {Command} {transport select} [transport_name]
Select which of the supported transports to use in this OpenOCD session.

When invoked with @option{transport_name}, attempts to select the named
transport. The transport must be supported by the debug adapter
transport. The transport must be supported by the debug adapter
hardware and by the version of OpenOCD you are using (including the
adapter's driver).

If no transport has been selected and no @option{transport_name} is
provided, @command{transport select} auto-selects the first transport
supported by the debug adapter.

@command{transport select} always returns the name of the session's selected
transport, if any.
When invoked with no transport name:
@itemize @minus
@item if no transport has been selected yet, it auto-selects the first transport supported by the debug adapter
@item it returns the name of the session's selected transport
@end itemize
@end deffn

@subsection JTAG Transport
Expand Down
2 changes: 0 additions & 2 deletions src/transport/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ COMMAND_HANDLER(handle_transport_select)
if (session) {
if (!strcmp(session->name, CMD_ARGV[0])) {
LOG_WARNING("Transport \"%s\" was already selected", session->name);
command_print(CMD, "%s", session->name);
return ERROR_OK;
}
command_print(CMD, "Can't change session's transport after the initial selection was made");
Expand All @@ -301,7 +300,6 @@ COMMAND_HANDLER(handle_transport_select)
int retval = transport_select(CMD_CTX, CMD_ARGV[0]);
if (retval != ERROR_OK)
return retval;
command_print(CMD, "%s", session->name);
return ERROR_OK;
}
}
Expand Down

0 comments on commit b9224c0

Please sign in to comment.