All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Use org.ofono.phonesim.Script as interface name
@ 2010-10-14 12:34 Yang Gu
  2010-10-14 12:34 ` [PATCH 2/2] doc: Describe the scriptable feature Yang Gu
  2010-10-14 14:45 ` [PATCH 1/2] Use org.ofono.phonesim.Script as interface name Denis Kenzior
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Gu @ 2010-10-14 12:34 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

---
 src/control.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/control.h b/src/control.h
index e455437..3c85e22 100644
--- a/src/control.h
+++ b/src/control.h
@@ -31,9 +31,9 @@ class Control;
 class Script: public QDBusAbstractAdaptor
 {
 Q_OBJECT
-    Q_CLASSINFO("D-Bus Interface", "org.phonesim.Script")
+    Q_CLASSINFO("D-Bus Interface", "org.ofono.phonesim.Script")
     Q_CLASSINFO("D-Bus Introspection", ""
-"  <interface name=\"org.phonesim.Script\">\n"
+"  <interface name=\"org.ofono.phonesim.Script\">\n"
 "    <method name=\"SetPath\">\n"
 "      <arg direction=\"in\" type=\"s\" name=\"path\"/>\n"
 "    </method>\n"
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] doc: Describe the scriptable feature
  2010-10-14 12:34 [PATCH 1/2] Use org.ofono.phonesim.Script as interface name Yang Gu
@ 2010-10-14 12:34 ` Yang Gu
  2010-10-14 14:45 ` [PATCH 1/2] Use org.ofono.phonesim.Script as interface name Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Yang Gu @ 2010-10-14 12:34 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2672 bytes --]

---
 doc/scriptable.txt |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 doc/scriptable.txt

diff --git a/doc/scriptable.txt b/doc/scriptable.txt
new file mode 100644
index 0000000..670bd21
--- /dev/null
+++ b/doc/scriptable.txt
@@ -0,0 +1,55 @@
+With the support of QtScript, now phonesim is scriptable, which means you may
+manipulate or extend phonesim's functionality using ECMA script language
+(defined in ECMA-262). At the same time, some D-Bus interface and dedicated
+methods are also defined to facilitate this feature. As a result, full test
+automation can be achieved (Without this, if you want to initiate an incoming
+call, you have to do some operations manually within phonesim GUI).  Below are
+several examples:
+
+1. call.js (stand for incoming call and copy it to /tmp/call/)
+tabRegistration.gbIncomingCall.leCaller.text = "12345";
+tabRegistration.gbIncomingCall.pbIncomingCall.click();
+
+Then set the path of script and run the script with its name:
+
+dbus-send --session --print-reply --dest=org.ofono.phonesim /
+org.ofono.phonesim.Script.SetPath string:/tmp/call
+
+dbus-send --session --print-reply --dest=org.ofono.phonesim /
+org.ofono.phonesim.Script.Run string:call.js
+
+Now you have simulated an incoming call.
+
+PS: If you want to know the hierarchy of UI elements, check the file
+src/controlbase.ui
+
+2. sms.js (stand for incoming sms and copy it to /tmp/sms/)
+tabSMS.gbMessage1.leMessageSender.text = "Yang";
+tabSMS.gbMessage1.leSMSClass.text = "1";
+tabSMS.gbMessage1.teSMSText.setPlainText("Sent from phonesim");
+tabSMS.gbMessage1.pbSendSMSMessage.click();
+
+Then do the similar things as first example:
+
+dbus-send --session --print-reply --dest=org.ofono.phonesim /
+org.ofono.phonesim.Script.SetPath string:/tmp/sms
+
+dbus-send --session --print-reply --dest=org.ofono.phonesim /
+org.ofono.phonesim.Script.Run string:sms.js
+
+Now you have simulated an incoming sms.
+
+3. Get the current path for script
+dbus-send --session --print-reply --dest=org.ofono.phonesim /
+org.ofono.phonesim.Script.GetPath
+
+4. Make script return some string
+The string can be any string, number, bool, date, etc in JavaScript, but it
+couldn't be a object because of some side effect. Refer "QScriptValue Class
+Reference" for details.
+For example, if you want to know the current incoming number, you may write a
+script as below:
+// number.js
+tabRegistration.gbIncomingCall.leCaller.text
+
+After running the script the similar way as above, you may get the number.
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] Use org.ofono.phonesim.Script as interface name
  2010-10-14 12:34 [PATCH 1/2] Use org.ofono.phonesim.Script as interface name Yang Gu
  2010-10-14 12:34 ` [PATCH 2/2] doc: Describe the scriptable feature Yang Gu
@ 2010-10-14 14:45 ` Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2010-10-14 14:45 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

Hi Yang,

On 10/14/2010 07:34 AM, Yang Gu wrote:
> ---
>  src/control.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Both patches have been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-14 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14 12:34 [PATCH 1/2] Use org.ofono.phonesim.Script as interface name Yang Gu
2010-10-14 12:34 ` [PATCH 2/2] doc: Describe the scriptable feature Yang Gu
2010-10-14 14:45 ` [PATCH 1/2] Use org.ofono.phonesim.Script as interface name Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.