Write a ofono plugin
by Shaheer Ahmed
Hi,
Kindly, please guide me on the steps of writing a ofono plugin.
Please let me know about any references or so.
Regards,
Shaheer Ahmed Shaikh
SSE - A&E Infotainment
"Without a sense of urgency, desire loses its value."
8 years, 6 months
[PATCH 1/2] test-ussd becomes send-ussd
by Philippe Nunes
---
test/send-ussd | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
test/test-ussd | 75 --------------------------------------------------------
2 files changed, 75 insertions(+), 75 deletions(-)
create mode 100755 test/send-ussd
delete mode 100755 test/test-ussd
diff --git a/test/send-ussd b/test/send-ussd
new file mode 100755
index 0000000..c21f5e3
--- /dev/null
+++ b/test/send-ussd
@@ -0,0 +1,75 @@
+#!/usr/bin/python
+
+import sys
+import gobject
+import os
+
+import dbus
+import dbus.mainloop.glib
+
+state = None
+
+def ussd_notification_received(content):
+ print("Network sent a Notification: " + content)
+
+def ussd_request_received(content):
+ print("Network sent a Request: " + content)
+ ss.Cancel()
+
+def ussd_property_changed(name, value):
+ global state
+ if name != "State":
+ return
+ print("USSD session state is " + value)
+ state = str(value)
+
+def stdin_handler(fd, condition):
+ s = os.read(fd.fileno(), 160).rstrip()
+ if not s:
+ ss.Cancel()
+ elif state == "user-response":
+ print ss.Respond(s, timeout = 100)
+ elif state == "idle":
+ print ss.Initiate(s, timeout = 100)
+ else:
+ print "Invalid state", state
+ return True
+
+if __name__ == "__main__":
+ if (len(sys.argv) < 2):
+ print "Usage: %s [modem] <ussd-string>" % (sys.argv[0])
+ sys.exit(1)
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+ modems = manager.GetModems()
+ modem = modems[0][0]
+
+ if (len(sys.argv) == 2):
+ ussd = sys.argv[1]
+ else:
+ modem = sys.argv[1]
+ ussd = sys.argv[2]
+
+ ss = dbus.Interface(bus.get_object('org.ofono', modem),
+ 'org.ofono.SupplementaryServices')
+
+ props = ss.GetProperties()
+ for p in props:
+ ussd_property_changed(p, props[p])
+
+ ss.connect_to_signal("NotificationReceived", ussd_notification_received)
+ ss.connect_to_signal("RequestReceived", ussd_request_received)
+ ss.connect_to_signal("PropertyChanged", ussd_property_changed)
+
+ print ss.Initiate(ussd, timeout=100)
+
+ gobject.io_add_watch(sys.stdin, gobject.IO_IN, stdin_handler)
+
+ mainloop = gobject.MainLoop()
+ mainloop.run()
diff --git a/test/test-ussd b/test/test-ussd
deleted file mode 100755
index c21f5e3..0000000
--- a/test/test-ussd
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import gobject
-import os
-
-import dbus
-import dbus.mainloop.glib
-
-state = None
-
-def ussd_notification_received(content):
- print("Network sent a Notification: " + content)
-
-def ussd_request_received(content):
- print("Network sent a Request: " + content)
- ss.Cancel()
-
-def ussd_property_changed(name, value):
- global state
- if name != "State":
- return
- print("USSD session state is " + value)
- state = str(value)
-
-def stdin_handler(fd, condition):
- s = os.read(fd.fileno(), 160).rstrip()
- if not s:
- ss.Cancel()
- elif state == "user-response":
- print ss.Respond(s, timeout = 100)
- elif state == "idle":
- print ss.Initiate(s, timeout = 100)
- else:
- print "Invalid state", state
- return True
-
-if __name__ == "__main__":
- if (len(sys.argv) < 2):
- print "Usage: %s [modem] <ussd-string>" % (sys.argv[0])
- sys.exit(1)
-
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
- bus = dbus.SystemBus()
-
- manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
-
- modems = manager.GetModems()
- modem = modems[0][0]
-
- if (len(sys.argv) == 2):
- ussd = sys.argv[1]
- else:
- modem = sys.argv[1]
- ussd = sys.argv[2]
-
- ss = dbus.Interface(bus.get_object('org.ofono', modem),
- 'org.ofono.SupplementaryServices')
-
- props = ss.GetProperties()
- for p in props:
- ussd_property_changed(p, props[p])
-
- ss.connect_to_signal("NotificationReceived", ussd_notification_received)
- ss.connect_to_signal("RequestReceived", ussd_request_received)
- ss.connect_to_signal("PropertyChanged", ussd_property_changed)
-
- print ss.Initiate(ussd, timeout=100)
-
- gobject.io_add_watch(sys.stdin, gobject.IO_IN, stdin_handler)
-
- mainloop = gobject.MainLoop()
- mainloop.run()
--
1.7.9.5
8 years, 6 months
[PATCH v2 0/4] phonesim: CBS/USSD improvments
by Philippe Nunes
-mDataCodingScheme is set when we need to apply the same scheme in case of
multi-page CBS message.
-The method 'shouldsplit' is removed since we are using directly the method
compute size in order to check the number of pages.
-When the text is too long, the text truncation is done directly by the method
'split'.
Philippe Nunes (4):
controbase: Remove entries in CBM UI
qcbsmessage: apply the same coding scheme for all the pages
hardwaremanipulator: Use the best scheme for CBS message
hardwaremanipulator: Add multi-page support for CBS message
src/control.cpp | 9 +--
src/controlbase.ui | 184 ++++++++++++++++---------------------------
src/hardwaremanipulator.cpp | 59 +++++++-------
src/hardwaremanipulator.h | 6 +-
src/qcbsmessage.cpp | 38 ++++-----
src/qcbsmessage.h | 1 -
6 files changed, 117 insertions(+), 180 deletions(-)
--
1.7.9.5
8 years, 6 months
PPP connection is not established between DUN server(linux + ofono) and DUN client(Win7)
by Zheng, Wu
Hi,
I am trying the DUN feature of ofono.
DUN server: Linux kernel 3.0 and ofono-1.7
DUN client:win7
However, PPP connection is not established between DUN server(linux + ofono) and DUN client(Win7).
DUN client(win7) keep at the status of "verifying user and password".
The attachment is the log of ofono(DUN server).
After checking the log,
DUN server(ofono) got the event 7 (RCR-) firstly at ppp_enter_phase() 1.
After DUN server(ofono) got the event 8 (RCA), DUN server(ofono) always non-stop to get the event 7 (RCR-).
What is wrong in the process? Some suggestions? Thank you.
Best regards
Zheng wu
8 years, 6 months
[PATCH 0/4] Add bus name to signal watches
by Lucas De Marchi
First patch is just one that was still pending locally. The other ones fix the
calls to g_dbus_add_signal_watch() to actually watch only the desired bus. It
depends on previous patch for gdbus to be applied first, otherwise libdbus may
call abort() when we exit.
Lucas De Marchi (4):
README: add information about mailing list and site
bluetooth: watch for signals only on BLUEZ_SERVICE
stemgr: watch for signals only on MGR_SERVICE
tools: watch for signals only on OFONO_SERVICE
README | 9 +++++++++
plugins/bluetooth.c | 13 ++++++++-----
plugins/stemgr.c | 4 ++--
tools/auto-enable.c | 20 ++++++++++----------
tools/huawei-audio.c | 17 +++++++++--------
5 files changed, 38 insertions(+), 25 deletions(-)
--
1.7.11.1
8 years, 6 months