Even though changing transport is impossible, reselecting it should be
harmless.
Change-Id: I6c1c2786134e826f47f848b590e6d712b6fd2206
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2251
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
break;
case 2: /* assign */
if (session) {
- /* can't change session's transport after-the-fact */
- LOG_ERROR("session's transport is already selected.");
- return JIM_ERR;
+ if (!strcmp(session->name, argv[1]->bytes)) {
+ LOG_WARNING("Transport \"%s\" was already selected", session->name);
+ return JIM_OK;
+ } else {
+ LOG_ERROR("Can't change session's transport after the initial selection was made");
+ return JIM_ERR;
+ }
}
/* Is this transport supported by our debug adapter?