Class: NetworkManager
- Inherits:
-
Object
- Object
- NetworkManager
- Defined in:
- lib/ruby-network-manager.rb,
lib/network_manager/modem.rb
Defined Under Namespace
Classes: Modem
Constant Summary collapse
- MODEM_MANAGER_BUS_PATH =
'/org/freedesktop/ModemManager'
- DBUS_PROPERTIES =
'freedesktop.DBus.Properties'
- MM_DBUS_SERVICE =
'org.freedesktop.ModemManager'
- MM_DBUS_INTERFACE_MODEM =
'org.freedesktop.ModemManager.Modem'
- MM_DBUS_INTERFACE_MODEM_CDMA =
'org.freedesktop.ModemManager.Modem.Cdma'
- MM_DBUS_INTERFACE_MODEM_GSM_CARD =
'org.freedesktop.ModemManager.Modem.Gsm.Card'
- MM_DBUS_INTERFACE_MODEM_GSM_NETWORK =
'org.freedesktop.ModemManager.Modem.Gsm.Network'
- MM_DBUS_INTERFACE_MODEM_SIMPLE =
'org.freedesktop.ModemManager.Modem.Simple'
- MM_DBUS_INTERFACE_MODEM_GSM_USSD =
'org.freedesktop.ModemManager.Modem.Gsm.Ussd'
Instance Attribute Summary collapse
-
#modem_bus_path ⇒ Object
readonly
Returns the value of attribute modem_bus_path.
-
#modem_service ⇒ Object
readonly
Returns the value of attribute modem_service.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ NetworkManager
constructor
A new instance of NetworkManager.
-
#modems(opts = {}) ⇒ Object
Discover all enabled devices.
Constructor Details
#initialize(opts = {}) ⇒ NetworkManager
Returns a new instance of NetworkManager.
18 19 20 21 |
# File 'lib/ruby-network-manager.rb', line 18 def initialize(opts = {}) opts @bus = DBus::SystemBus.instance end |
Instance Attribute Details
#modem_bus_path ⇒ Object (readonly)
Returns the value of attribute modem_bus_path.
6 7 8 |
# File 'lib/ruby-network-manager.rb', line 6 def modem_bus_path @modem_bus_path end |
#modem_service ⇒ Object (readonly)
Returns the value of attribute modem_service.
6 7 8 |
# File 'lib/ruby-network-manager.rb', line 6 def modem_service @modem_service end |
Instance Method Details
#modems(opts = {}) ⇒ Object
Discover all enabled devices
24 25 26 27 28 29 |
# File 'lib/ruby-network-manager.rb', line 24 def modems(opts = {}) @mm_service = @bus.service(@modem_service) @mm_object = @mm_service.object(@modem_bus_path) @mm_object.introspect NetworkManager::Modem.fetch(@mm_object.EnumerateDevices()[0], service: @mm_service) end |