Skip to content

Commit b9224c0

Browse files
zapb-0borneoa
authored andcommitted
transport: Remove echo in transport selection
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 <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8217 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
1 parent d5adab6 commit b9224c0

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

doc/openocd.texi

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3693,20 +3693,18 @@ displays the names of the transports supported by this
36933693
version of OpenOCD.
36943694
@end deffn
36953695

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

36993699
When invoked with @option{transport_name}, attempts to select the named
3700-
transport. The transport must be supported by the debug adapter
3700+
transport. The transport must be supported by the debug adapter
37013701
hardware and by the version of OpenOCD you are using (including the
37023702
adapter's driver).
3703-
3704-
If no transport has been selected and no @option{transport_name} is
3705-
provided, @command{transport select} auto-selects the first transport
3706-
supported by the debug adapter.
3707-
3708-
@command{transport select} always returns the name of the session's selected
3709-
transport, if any.
3703+
When invoked with no transport name:
3704+
@itemize @minus
3705+
@item if no transport has been selected yet, it auto-selects the first transport supported by the debug adapter
3706+
@item it returns the name of the session's selected transport
3707+
@end itemize
37103708
@end deffn
37113709

37123710
@subsection JTAG Transport

src/transport/transport.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ COMMAND_HANDLER(handle_transport_select)
278278
if (session) {
279279
if (!strcmp(session->name, CMD_ARGV[0])) {
280280
LOG_WARNING("Transport \"%s\" was already selected", session->name);
281-
command_print(CMD, "%s", session->name);
282281
return ERROR_OK;
283282
}
284283
command_print(CMD, "Can't change session's transport after the initial selection was made");
@@ -301,7 +300,6 @@ COMMAND_HANDLER(handle_transport_select)
301300
int retval = transport_select(CMD_CTX, CMD_ARGV[0]);
302301
if (retval != ERROR_OK)
303302
return retval;
304-
command_print(CMD, "%s", session->name);
305303
return ERROR_OK;
306304
}
307305
}

0 commit comments

Comments
 (0)