Commit Graph

25 Commits

Author SHA1 Message Date
Vadim Yanitskiy 569e5d3e9c SEDbgMuxApp: use cmd2.Fg instead of deprecated cmd2.fg
In v2.3.0 both cmd2.{fg,bg} have been deprecated in favour of cmd2.{Fg,Bg}.
In v2.4.0 both cmd2.{fg,bg} have been removed.

See https://github.com/python-cmd2/cmd2/blob/master/CHANGELOG.md
2022-07-14 18:25:45 +07:00
Vadim Yanitskiy 530975eff2 SEDbgMuxApp: properly handle peer.recv() returning None
In 2990cc14b8 I introduced a regression,
which affects the 'establish' command: if no data is received from a
Data Provider during 500 ms, the application crashes:

    File "sedbgmux.py", line 151, in do_establish
      if f['MsgType'] != DbgMuxFrame.MsgType.ConnData:
  TypeError: 'NoneType' object is not subscriptable

This is happening because peer.recv() is returning None.
2022-07-14 17:55:29 +07:00
Vadim Yanitskiy 2990cc14b8 SEDbgMuxApp: use non-zero default serial port read timeout
This is required for a follow-up change moving DebugMux I/O handling
into separate threads.  We need to be able to stop a thread, which
is executing blocking self.io.read() call.
2022-06-20 22:36:17 +07:00
Vadim Yanitskiy f9759d1024 Transport: mark abstract methods with @abc.abstractmethod 2022-06-20 18:48:17 +07:00
Vadim Yanitskiy 138af0da7a DbgMuxPeer: calculate and check the FCS of Rx frames 2022-03-29 00:24:17 +03:00
Vadim Yanitskiy e71875aa12 DbgMuxPeer: get away from using construct's parse_stream() 2022-03-29 00:24:02 +03:00
Vadim Yanitskiy 45548e0a3e TransportModem: raise TransportIOError exception on I/O error 2022-03-28 04:44:31 +03:00
Vadim Yanitskiy ea6018b822 TransportModem: properly ignore the modem events like '*EMRDY'
Ericsson's mini-PCIe modems are known to send such events.
2022-03-28 02:26:50 +03:00
Vadim Yanitskiy 9034073630 SEDbgMuxApp: separate modem transport into its own module 2022-03-28 01:19:58 +03:00
Vadim Yanitskiy 37426267f4 SEDbgMuxApp: fix do_ping(): ACKnowledge Pong message 2022-03-28 01:03:37 +03:00
Vadim Yanitskiy 88553524a3 DbgMuxFrame: add tentative FlowControl message definition 2022-03-27 22:54:47 +03:00
Vadim Yanitskiy 7c2094dc44 DbgMuxPeer: use %03u for logging Rx/Tx counter values
This makes the header length consistent in logging messages.
2022-03-27 22:51:52 +03:00
Vadim Yanitskiy 45788b2783 cosmetic: switch to consistent four-spaces indent (using autopep8) 2022-03-27 22:50:30 +03:00
Vadim Yanitskiy 79c2124e0c Add requirements.txt listing all dependencies 2022-01-21 02:08:58 +06:00
Vadim Yanitskiy d1310b4628 Mark sedbgmux.py as executable 2022-01-21 01:48:30 +06:00
Vadim Yanitskiy 1f57d3dd4a SEDbgMuxApp: fix C0325: unnecessary parens after 'assert' keyword 2022-01-19 00:38:28 +06:00
Vadim Yanitskiy 712c2b79e5 DbgMuxPeer: encode/decode inner messages in send()/recv() 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy ba66506052 DbgMuxFrame: add complete inner message definition 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy 0f7605b189 SEDbgMuxApp: disable DebugMux commands while not connected 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy 1c9a74c1e0 SEDbgMuxApp: group commands into cmd2 categories 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy ee4731aad7 SEDbgMuxApp: add a command to show connection info 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy e09c227661 SEDbgMuxApp: handle ConnEstablished with DPRef=0xffff
This format string found in firmware image of a modem:

  DebugMux[DL,HandleConnectReq] Could not find DPRef 0x%04X;
                                sending Connect Response with ConnRef=0xFFFF

gives us a hint on what happens when ConnEstablish message contains
an unknown DPRef that was not announced or has became inactive.
2022-01-18 16:22:54 +06:00
Vadim Yanitskiy 4d19f594c3 Initial DebugMux client application 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy 97cd6fb4d3 Initial DebugMux protocol definition 2022-01-18 16:22:54 +06:00
Vadim Yanitskiy 3d37f3e261 Initial commit 2022-01-18 16:22:54 +06:00