Aleksander Morgado 7a58647af7 broadband-bearer: fully reopen data port before flashing
When disconnecting the data port, first fully close and reopen the port before
flashing. This helps with some modems where the flashing mechanism doesn't
fully work, like this ZTE modem:

    Before:
    [1360325270.357678] [mm-bearer.c:690] mm_bearer_disconnect(): Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0'
    [1360325270.357796] [mm-iface-modem.c:1198] mm_iface_modem_update_state(): Modem /org/freedesktop/ModemManager1/Modem/1: state changed (connected -> disconnecting)
    [1360325270.358503] [mm-broadband-bearer.c:1539] disconnect_3gpp(): Sending PDP context deactivation in secondary port...
    [1360325270.358549] [mm-serial-port.c:927] mm_serial_port_open(): (ttyUSB4) device open count is 2 (open)
    [1360325270.358633] [mm-at-serial-port.c:392] debug_log(): (ttyUSB4): --> 'AT+CGACT=0,2<CR>'
    [1360325270.375131] [mm-at-serial-port.c:392] debug_log(): (ttyUSB4): <-- '<CR><LF>OK<CR><LF>'
    [1360325270.375251] [mm-serial-port.c:967] mm_serial_port_close(): (ttyUSB7) device open count is 1 (close)
    [1360325270.375282] [mm-serial-port.c:927] mm_serial_port_open(): (ttyUSB7) device open count is 2 (open)
    [1360325270.375300] [mm-broadband-bearer.c:1497] cgact_secondary_ready(): Flash primary port...
    [1360325270.375833] [mm-serial-port.c:967] mm_serial_port_close(): (ttyUSB4) device open count is 1 (close)
    [1360325271.377539] [mm-broadband-bearer.c:1455] primary_flash_3gpp_ready(): PDP disconnection already sent in secondary port
    [1360325271.377634] [mm-serial-port.c:967] mm_serial_port_close(): (ttyUSB7) device open count is 1 (close)
    [1360325271.377680] [mm-port.c:149] mm_port_set_connected(): (ttyUSB7): port now disconnected
    [1360325271.377721] [mm-bearer.c:623] disconnect_ready(): Disconnected bearer '/org/freedesktop/ModemManager1/Bearer/0'
    [1360325286.415396] [mm-serial-port.c:927] mm_serial_port_open(): (ttyUSB7) device open count is 2 (open)
    [1360325286.415510] [mm-at-serial-port.c:392] debug_log(): (ttyUSB7): --> 'AT+ZPAS?<CR>'
    [1360325287.400589] [mm-broadband-modem.c:1717] modem_load_signal_quality(): loading signal quality...
    [1360325287.400679] [mm-serial-port.c:927] mm_serial_port_open(): (ttyUSB7) device open count is 3 (open)
    [1360325289.401873] [mm-iface-modem.c:762] access_technologies_check_ready(): Couldn't refresh access technologies: 'Serial command timed out'
    [1360325289.401940] [mm-serial-port.c:967] mm_serial_port_close(): (ttyUSB7) device open count is 2 (close)
    [1360325289.401998] [mm-at-serial-port.c:392] debug_log(): (ttyUSB7): --> 'AT+CIND?<CR>'
    [1360325292.403162] [mm-serial-port.c:927] mm_serial_port_open(): (ttyUSB7) device open count is 3 (open)
    [1360325292.403247] [mm-serial-port.c:967] mm_serial_port_close(): (ttyUSB7) device open count is 2 (close
    ...

    After:
    [1360326617.604527] [mm-bearer.c:690] mm_bearer_disconnect(): Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0'
    [1360326617.604622] [mm-iface-modem.c:1198] mm_iface_modem_update_state(): Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connected -> disconnecting)
    [1360326617.605006] [mm-broadband-bearer.c:1535] disconnect_3gpp(): Sending PDP context deactivation in secondary port...
    [1360326617.605034] [mm-serial-port.c:929] mm_serial_port_open(): (ttyUSB4) device open count is 2 (open)
    [1360326617.605088] [mm-at-serial-port.c:392] debug_log(): (ttyUSB4): --> 'AT+CGACT=0,2<CR>'
    [1360326617.620075] [mm-at-serial-port.c:392] debug_log(): (ttyUSB4): <-- '<CR><LF>OK<CR><LF>'
    [1360326617.620206] [mm-broadband-bearer.c:1493] cgact_secondary_ready(): Flash primary port...
    [1360326617.620241] [mm-serial-port.c:1334] mm_serial_port_flash(): (ttyUSB7) reopening before flash (2)
    [1360326617.620265] [mm-serial-port.c:969] mm_serial_port_close(): (ttyUSB7) device open count is 1 (close)
    [1360326617.620286] [mm-serial-port.c:969] mm_serial_port_close(): (ttyUSB7) device open count is 0 (close)
    [1360326617.620320] [mm-serial-port.c:985] mm_serial_port_close(): (ttyUSB7) closing serial port...
    [1360326617.620356] [mm-port.c:149] mm_port_set_connected(): (ttyUSB7): port now disconnected
    [1360326617.621355] [mm-serial-port.c:1017] mm_serial_port_close(): (ttyUSB7) serial port closed
    [1360326617.621403] [mm-serial-port.c:860] mm_serial_port_open(): (ttyUSB7) opening serial port...
    [1360326617.622836] [mm-serial-port.c:417] real_config_fd(): (ttyUSB7): port attributes not fully set
2013-02-18 15:41:26 +01:00
2013-02-06 11:59:16 -06:00
2012-05-30 11:48:42 -05:00
2012-03-16 14:53:17 +01:00
2012-09-27 11:13:26 -05:00
2008-07-31 09:43:00 +03:00
2008-07-31 09:43:00 +03:00
2012-12-07 15:38:57 -06:00
2011-08-02 12:26:23 -05:00

ModemManager.
The problem ModemManager tries to solve is to provide a unified high level API
for communicating with (mobile broadband) modems. While the basic commands are
standardized, the more advanced operations (like signal quality monitoring 
while connected) varies a lot.

Using.
ModemManager is a system daemon and is not meant to be used directly from
the command line. However, since it provides DBus API, it is possible to use
'dbus-send' command to control it from the terminal. There's an example
program (tests/mm-test.py) that demonstrates the basic API usage.

Implementation.
ModemManager is a DBus system bus activated service (meaning it's started 
automatically when a request arrives). It is written in C. The devices are
queried from udev and automatically updated based on hardware events. There's
a GInterface (MMModem) that defines the modem interface and any device specific
implementation must implement it. There are two generic MMModem implementations
to support the basic operations (one for GSM, one for CDMA,) which are common
for all cards.

Plugins.
Plugins are loaded on startup, and must implement the MMPlugin interface. It
consists of a couple of methods which tell the daemon whether the plugin
supports a port and to create custom MMModem implementations. It most likely
makes sense to derive custom modem implementations from one of the generic
classes and just add (or override) operations which are not standard. There's a
fully working plugin in the plugins/ directory for Huawei cards that can be
used as an example for writing new plugins. Writing new plugins is highly
encouraged!

API.
The API is open for changes, so if you're writing a plugin and need to add or
change some public method, feel free to suggest it!
S
Description
No description provided
Readme
19 MiB
Languages
C 98.6%
Meson 0.8%
Python 0.4%
Shell 0.2%