Skip to contentSkip to conversation

Add/Remove phonesim on the fly

PATCH Xavier Claessens 1 participant 3 messages Dec 17, 2015

lore
Share & tools
lore
#0 lore raw

Ubuntu's ofono has a useful DBus interface to add/remove modems. Would make sense to upstream that patch.

Regards,
Xavier Claessens.

From 5e5ec71a3780d4ad5b4be26e647d410c4949345d Mon Sep 17 00:00:00 2001
From: Jussi Pakkanen <[email protected]>
Date: Tue, 8 Apr 2014 10:57:41 +0300
Subject: [PATCH] Added dbus control channel to phonesim plugin.

---
 doc/phonesim-control-api.txt |  34 ++++++++++++
 plugins/phonesim.c           | 129 ++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 156 insertions(+), 7 deletions(-)
 create mode 100644 doc/phonesim-control-api.txt
doc/phonesim-control-api.txt new file +34 -0
new file mode 100644
index 0000000..39d7036
@@ -0,0 +1,34 @@
+Phonesim control hierarchy
+
+==========================
+
+Service		org.ofono
+Interface	org.ofono.phonesim.Manager
+Object path	/
+
+Methods		Add(string name, string address, string port)
+
+			Instantiates a new modem in phonesim with the given
+			specifications.
+
+			RemoveAll()
+
+			Removes all modems from phonesim.
+
+			Reset()
+			
+			Removes all modems and instantiates all those modems listed
+			in the configuration file. Equivalent to stopping and
+			restarting the daemon.
+
+Examples
+
+To add a new phonesim modem on the fly do the following:
+
+- Start new phonesim instance
+  * ./phonesim -p 12346 your_very_own.xml
+- Call the [interface].Add("myname", "127.0.0.1", "12346")
+  * dbus-send --system --print-reply --dest=org.ofono / \
+    org.ofono.phonesim.Manager.Add string:myname string:127.0.0.1 string:12346
+  * dbus-send --system --print-reply --dest=org.ofono \
+    /myname org.ofono.Modem.SetProperty string:Powered variant:boolean:true
plugins/phonesim.c +122 -7

160 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw

Sorry, made a mistake while fixing merge conflict in the patch. Here is a better patch.

Quoted 6 lines · Xavier Claessens

Ubuntu's ofono has a useful DBus interface to add/remove modems. Would
make sense to upstream that patch.

Regards,
Xavier Claessens.

From 924a3d383f2e6a03ddf34c44ebc7847535fbf0fb Mon Sep 17 00:00:00 2001
From: Jussi Pakkanen <[email protected]>
Date: Tue, 8 Apr 2014 10:57:41 +0300
Subject: [PATCH] Added dbus control channel to phonesim plugin.

---
 doc/phonesim-control-api.txt |  34 ++++++++++
 plugins/phonesim.c           | 144 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 165 insertions(+), 13 deletions(-)
 create mode 100644 doc/phonesim-control-api.txt
doc/phonesim-control-api.txt new file +34 -0
new file mode 100644
index 0000000..39d7036
@@ -0,0 +1,34 @@
+Phonesim control hierarchy
+
+==========================
+
+Service		org.ofono
+Interface	org.ofono.phonesim.Manager
+Object path	/
+
+Methods		Add(string name, string address, string port)
+
+			Instantiates a new modem in phonesim with the given
+			specifications.
+
+			RemoveAll()
+
+			Removes all modems from phonesim.
+
+			Reset()
+			
+			Removes all modems and instantiates all those modems listed
+			in the configuration file. Equivalent to stopping and
+			restarting the daemon.
+
+Examples
+
+To add a new phonesim modem on the fly do the following:
+
+- Start new phonesim instance
+  * ./phonesim -p 12346 your_very_own.xml
+- Call the [interface].Add("myname", "127.0.0.1", "12346")
+  * dbus-send --system --print-reply --dest=org.ofono / \
+    org.ofono.phonesim.Manager.Add string:myname string:127.0.0.1 string:12346
+  * dbus-send --system --print-reply --dest=org.ofono \
+    /myname org.ofono.Modem.SetProperty string:Powered variant:boolean:true
plugins/phonesim.c +131 -13

190 lines not on this page · raw message

Signature · 1 line
2.5.0
#2 lore raw
In reply to Xavier Claessens

Sorry, I didn't properly fixed merge conflict. Here is updated patch.

Quoted 6 lines · Xavier Claessens

Ubuntu's ofono has a useful DBus interface to add/remove modems. Would
make sense to upstream that patch.

Regards,
Xavier Claessens.

From 924a3d383f2e6a03ddf34c44ebc7847535fbf0fb Mon Sep 17 00:00:00 2001
From: Jussi Pakkanen <[email protected]>
Date: Tue, 8 Apr 2014 10:57:41 +0300
Subject: [PATCH] Added dbus control channel to phonesim plugin.

---
 doc/phonesim-control-api.txt |  34 ++++++++++
 plugins/phonesim.c           | 144 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 165 insertions(+), 13 deletions(-)
 create mode 100644 doc/phonesim-control-api.txt
doc/phonesim-control-api.txt new file +34 -0
new file mode 100644
index 0000000..39d7036
@@ -0,0 +1,34 @@
+Phonesim control hierarchy
+
+==========================
+
+Service		org.ofono
+Interface	org.ofono.phonesim.Manager
+Object path	/
+
+Methods		Add(string name, string address, string port)
+
+			Instantiates a new modem in phonesim with the given
+			specifications.
+
+			RemoveAll()
+
+			Removes all modems from phonesim.
+
+			Reset()
+			
+			Removes all modems and instantiates all those modems listed
+			in the configuration file. Equivalent to stopping and
+			restarting the daemon.
+
+Examples
+
+To add a new phonesim modem on the fly do the following:
+
+- Start new phonesim instance
+  * ./phonesim -p 12346 your_very_own.xml
+- Call the [interface].Add("myname", "127.0.0.1", "12346")
+  * dbus-send --system --print-reply --dest=org.ofono / \
+    org.ofono.phonesim.Manager.Add string:myname string:127.0.0.1 string:12346
+  * dbus-send --system --print-reply --dest=org.ofono \
+    /myname org.ofono.Modem.SetProperty string:Powered variant:boolean:true
plugins/phonesim.c +131 -13

190 lines not on this page · raw message

Signature · 1 line
2.5.0