Disconnect vs Delete bearer

Dan Williams dcbw at redhat.com
Wed Nov 12 13:06:26 PST 2014


On Wed, 2014-11-12 at 15:34 +0100, Aleksander Morgado wrote:
> On Wed, Nov 12, 2014 at 3:13 PM, Highland, Glenn
> <Glenn.Highland at etherios.com> wrote:
> > Is there any functional difference between the Modem.Simple interface’s
> > Disconnect() method and the Modem interface’s DeleteBearer()
> >
> > method?   I know Disconnect() allows you to pass a “/” argument to specify
> > all bearers, but if you’re passing a specific bearer object’s path,
> >
> > is there any difference between the two operations?
> >
> >
> >
> > I’m not encountering any problems/issues – just for my own better
> > understanding.  The DeleteBearer() method’s description on the web
> > documentation only mentions a disconnect action.
> 
> So... You can setup connections in 2 different ways with ModemManager:
> 
>  * The Simple interface has Connect() and Disconnect(). Easy, you just
> forget about the fact that there are bearer objects created until you
> need to read the IP config setup they expose. Apart from that, bearers
> are nothing else that some connection info holders for you. The Simple
> interface is what e.g. NetworkManager uses.
> 
>  * You can also CreateBearer() and DeleteBearer(), and
> Bearer.Connect() or Bearer.Disconnect() them independently. Why would
> you need this? Well, if your modem supports more than one data
> interface and you want to connect each data interface to a different
> APN, you'll need to create 2 bearers and connect them manually
> independently.
> 
> Disconnect() will also allow to disconnect all available bearers, but
> won't remove any (i.e. bearer objects are kept exposed in DBus), while
> DeleteBearer() should remove them also from DBus. Bearer objects are
> anyway non-persistent; you won't get the same back if you re-plug the
> modem.

Perhaps a clearer explanation would be:

You create a bearer with specific attributes (APN, QoS, etc).  You can
then connect/disconnect that bearer at will.  But if you delete the
bearer, you must re-create it with those attributes, and that is more
work in the client.  So if your client might ever want to stop a data
session and reconnect it later, it will be less code to simply
Disconnect() instead of Delete().

Dan



More information about the ModemManager-devel mailing list