On 08/08/17 08:14, Aleksander Morgado wrote:
> What we usually do here is to setup a Context struct for the
> operation, and define a set of STEPs for a small state machine that
> defines the operation.
Thanks for that.
One snag I've come across is that I want to run this during the
disconnection logic, but I need to issue AT commands to verify that AT
mode has been re-entered before marking the port as disconnected.
mm_port_serial_at_command() however will not permit a command to be
issued on a port when its port has its "connected" member var set to true.
. Add a more general purpose version of mm_port_serial_at_command which
doesn't check the connected status (and change mm_port_serial_at_command
to just carry out the "connected" state check, and then call the general
purpose function if "not connected").
. Temporarily mark the port as disconnected before calling
mm_port_serial_at_command, but somehow lock it to prevent signal quality
checks etc. from running (or otherwise disable these checks when a
single-port modem is connected?).
Any other suggestions?
p.s. Incidentally, AT-command mode is independent of there being an
active connection associated with the port (i.e. from the modem's
perspective, it's possible to have the port "connected", but also in AT
command mode), so maybe "connected" isn't the best name, and
"in_at_command_mode" would be better? Probably that change isn't needed
for the disconnection robustness changes however...
ModemManager-devel mailing list