core: refcount serial port open/close
This specifically fixes a regression with Novatel GSM secondary AT port enablement, where the inital pin check closed the port before the Novatel plugin could send the command to flip secondary ports to AT mode. But it's useful elsewhere too, and simplifies a bunch of the PIN checking code which had to use various ugly methods to track whether to close the port or not after checking the PIN.
This commit is contained in:
@@ -67,8 +67,9 @@ dmat_callback (MMAtSerialPort *port,
|
||||
/* Try it again */
|
||||
if (mm_serial_port_open (MM_SERIAL_PORT (port), NULL))
|
||||
mm_at_serial_port_queue_command (port, "$NWDMAT=1", 2, dmat_callback2, NULL);
|
||||
} else
|
||||
mm_serial_port_close (MM_SERIAL_PORT (port));
|
||||
}
|
||||
|
||||
mm_serial_port_close (MM_SERIAL_PORT (port));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
Reference in New Issue
Block a user