SEDbgMuxApp: add a command to show connection info

This commit is contained in:
Vadim Yanitskiy 2022-01-18 00:54:35 +06:00 committed by Vadim Yanitskiy
parent e09c227661
commit ee4731aad7
1 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,16 @@ class SEDbgMuxApp(cmd2.Cmd):
self.peer = None
self.connected = False
def do_status(self, opts) -> None:
''' Print connection info and statistics '''
if not self.connected:
self.poutput('Not connected')
return
self.poutput('Connected to \'%s\'' % self.argv.serial_port)
self.poutput('Baudrate: %d' % self.argv.serial_baudrate)
self.poutput('TxCount (Ns): %d' % self.peer.tx_count)
self.poutput('RxCount (Nr): %d' % self.peer.rx_count)
def do_enquiry(self, opts) -> None:
''' Enquiry target identifier and available Data Providers '''
self.peer.send(DbgMuxFrame.MsgType.Enquiry)