SEDbgMuxApp: add a command for terminating connections
This commit is contained in:
parent
c81e0e2ad8
commit
dbb66828ef
12
sedbgmux.py
12
sedbgmux.py
|
@ -192,6 +192,18 @@ class SEDbgMuxApp(cmd2.Cmd):
|
|||
self.peer.disp.register(ch)
|
||||
ch.establish(opts.DPRef)
|
||||
|
||||
terminate_parser = cmd2.Cmd2ArgumentParser()
|
||||
terminate_parser.add_argument('ConnRef',
|
||||
type=lambda v: int(v, 16),
|
||||
help='ConnRef in hex')
|
||||
|
||||
@cmd2.with_argparser(terminate_parser)
|
||||
@cmd2.with_category(CATEGORY_DBGMUX)
|
||||
def do_terminate(self, opts) -> None:
|
||||
''' Terminate connection with a Data Provider '''
|
||||
msg = dict(ConnRef=opts.ConnRef)
|
||||
self.peer.send(DbgMuxFrame.MsgType.ConnTerminate, msg)
|
||||
|
||||
|
||||
ap = argparse.ArgumentParser(prog='sedbgmux', description=SEDbgMuxApp.DESC,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
|
|
Loading…
Reference in New Issue