* [PATCH 0/1] Patch Description
@ 2010-09-17 8:50 Yang Gu
0 siblings, 0 replies; 7+ messages in thread
From: Yang Gu @ 2010-09-17 8:50 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 430 bytes --]
I just got a new Option modem (iCON 452), and this patch is to enable several atoms for it.
The stk support is still not avaiable, for I couldn't find any appropriate manual for this part. If you happen to know this, please kindly share the info.
Yang Gu (1):
Enable some atoms for hso modem
plugins/hso.c | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
--
1.7.2.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/1] Patch Description
@ 2010-09-24 15:49 Yang Gu
2010-09-24 15:49 ` [PATCH 1/1] Enable Qt Script Yang Gu
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Yang Gu @ 2010-09-24 15:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2196 bytes --]
Phonesim is most of time a convenient way to test oFono. For example, it can be used to test MO call, as well as MT call.
And talking about test area, test automation is quite important regarding to both efficiency and effectiveness. In the test of MO call, scripts can be used to interact with oFono via D-Bus to make test automation possible. However, in the test of MT call, currently we have to enter the caller number and click some button in Phonesim GUI to simulate an incoming call, which makes test automation unrealistic.
This patch is to enable Qt script (JavaScript following ECMAScript spec) in Phonesim, so that we can have some script control its GUI conveniently, and satisfy the test automation.
With this patch, Phonesim can work in the following way:
1. It observes some specific directory (/tmp/scripts) to see if there is some test scripts added.
2. Once Phonesim finds a new test script is added, it will parse and execute the script.
3. You may add more and more test scripts to the specific directory with your test goes on.
Below are two examples:
# call.js (Simulate a MT call)
tabRegistration.gbIncomingCall.leCaller.text = "12345";
tabRegistration.gbIncomingCall.pbIncomingCall.click();
This script will help you enter the caller number as "12345", and click "Call" button in Phonesim GUI. Once this script is copied to the observed directory, oFono will get an incoming call.
# sms.js (Simulate a MT sms)
tabSMS.gbMessage1.leMessageSender.text = "Yang";
tabSMS.gbMessage1.leSMSClass.text = "1";
tabSMS.gbMessage1.teSMSText.setPlainText("This message is sent automatically from Phonesim");
tabSMS.gbMessage1.pbSendSMSMessage.click();
This script will help you fill the sms sender, class, text, and then click the "Send Message" button for you. Once it's added into the specific directory, oFono will get an incoming message.
Don't know if this is the best way to make Phonesim support test automation. So comments are welcome:)
-----
Yang Gu (1):
Enable Qt Script
configure.ac | 2 +-
src/control.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] Enable Qt Script
2010-09-24 15:49 [PATCH 0/1] Patch Description Yang Gu
@ 2010-09-24 15:49 ` Yang Gu
2010-09-25 3:00 ` [PATCH 0/1] Patch Description Zhang, Zhenhua
2010-09-26 23:38 ` Denis Kenzior
2 siblings, 0 replies; 7+ messages in thread
From: Yang Gu @ 2010-09-24 15:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3731 bytes --]
From: Yang Gu <yang.gu@intel.com>
---
configure.ac | 2 +-
src/control.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4d10494..d5d674e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
fi
])
-PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork, dummy=yes,
+PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork QtScript, dummy=yes,
AC_MSG_ERROR(Qt is required))
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
diff --git a/src/control.cpp b/src/control.cpp
index 34a228f..9de4ef7 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -33,6 +33,8 @@
#include <QFile>
#include <QDir>
#include <QtGui/QHeaderView>
+#include <QtScript>
+#include <qfilesystemwatcher.h>
#include "attranslator.h"
#define TWO_BYTE_MAX 65535
@@ -74,6 +76,7 @@ private slots:
void simInsertRemove();
void simAppStart();
void simAppAbort();
+ void handleDirChanged(const QString &path);
signals:
void unsolicitedCommand(const QString &);
@@ -105,6 +108,10 @@ private:
static int nextId;
};
QList<VoicemailItem> mailbox;
+ QScriptEngine engine;
+ QString dirPath;
+ QStringList fileList;
+ QFileSystemWatcher fileSystemWatcher;
};
#include "control.moc"
@@ -149,9 +156,62 @@ ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
handleNewApp();
+ /* Export tabs to be accessed by script */
+ QScriptValue qsTab = engine.newQObject(ui->tab);
+ engine.globalObject().setProperty("tabRegistration", qsTab);
+
+ QScriptValue qsTab2 = engine.newQObject(ui->tab_2);
+ engine.globalObject().setProperty("tabCBM", qsTab2);
+
+ QScriptValue qsTab3 = engine.newQObject(ui->tab_3);
+ engine.globalObject().setProperty("tabSMS", qsTab3);
+
+ QScriptValue qsTab4 = engine.newQObject(ui->tab_4);
+ engine.globalObject().setProperty("tabVoiceMail", qsTab4);
+
+ QScriptValue qsTab5 = engine.newQObject(ui->tab_5);
+ engine.globalObject().setProperty("tabUSSD", qsTab5);
+
+ QScriptValue qsTab6 = engine.newQObject(ui->tab_6);
+ engine.globalObject().setProperty("tabSIM", qsTab6);
+
+ dirPath = "/tmp/scripts/";
+
+ QDir *dir = new QDir(dirPath);
+ dir->mkpath(dirPath);
+
+ fileList = dir->entryList(QDir::Files);
+
+ fileSystemWatcher.addPath(dirPath);
+ connect(&fileSystemWatcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(handleDirChanged(const QString &)));
+
show();
}
+void ControlWidget::handleDirChanged(const QString &path)
+{
+ QDir *dir = new QDir(dirPath);
+ QStringList newFileList = dir->entryList(QDir::Files);
+
+ for (int i = 0; i < newFileList.size(); ++i)
+ if (!fileList.contains(newFileList.at(i))) {
+ QString fileName(dirPath + newFileList.at(i));
+ qDebug() << fileName << "was added to observed directory.";
+ QFile scriptFile(fileName);
+ scriptFile.open(QIODevice::ReadOnly);
+ QTextStream stream(&scriptFile);
+ QString contents = stream.readAll();
+ scriptFile.close();
+
+ QScriptValue qsScript = engine.evaluate(contents, fileName);
+ if (qsScript.isError())
+ qDebug() << fileName << qsScript.property("lineNumber").toInt32() << qsScript.toString();
+ }
+
+ fileList.clear();
+ fileList = newFileList;
+}
+
void ControlWidget::closeEvent(QCloseEvent *event)
{
event->ignore();
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH 0/1] Patch Description
2010-09-24 15:49 [PATCH 0/1] Patch Description Yang Gu
2010-09-24 15:49 ` [PATCH 1/1] Enable Qt Script Yang Gu
@ 2010-09-25 3:00 ` Zhang, Zhenhua
2010-09-26 23:38 ` Denis Kenzior
2 siblings, 0 replies; 7+ messages in thread
From: Zhang, Zhenhua @ 2010-09-25 3:00 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2634 bytes --]
Hi,
Yang Gu wrote:
> Phonesim is most of time a convenient way to test oFono. For example,
> it can be used to test MO call, as well as MT call.
> And talking about test area, test automation is quite important
> regarding to both efficiency and effectiveness. In the test of MO
> call, scripts can be used to interact with oFono via D-Bus to make
> test automation possible. However, in the test of MT call, currently
> we have to enter the caller number and click some button in Phonesim
> GUI to simulate an incoming call, which makes test automation
> unrealistic. This patch is to enable Qt script (JavaScript following
> ECMAScript spec) in Phonesim, so that we can have some script control
> its GUI conveniently, and satisfy the test automation.
>
> With this patch, Phonesim can work in the following way:
> 1. It observes some specific directory (/tmp/scripts) to see if there
> is some test scripts added.
> 2. Once Phonesim finds a new test script is added, it will parse and
> execute the script.
> 3. You may add more and more test scripts to the specific directory
> with your test goes on.
>
> Below are two examples:
> # call.js (Simulate a MT call)
> tabRegistration.gbIncomingCall.leCaller.text = "12345";
> tabRegistration.gbIncomingCall.pbIncomingCall.click();
>
> This script will help you enter the caller number as "12345", and
> click "Call" button in Phonesim GUI. Once this script is copied to
> the observed directory, oFono will get an incoming call.
>
> # sms.js (Simulate a MT sms)
> tabSMS.gbMessage1.leMessageSender.text = "Yang";
> tabSMS.gbMessage1.leSMSClass.text = "1";
> tabSMS.gbMessage1.teSMSText.setPlainText("This message is sent
> automatically from Phonesim");
> tabSMS.gbMessage1.pbSendSMSMessage.click();
>
> This script will help you fill the sms sender, class, text, and then
> click the "Send Message" button for you. Once it's added into the
> specific directory, oFono will get an incoming message.
>
> Don't know if this is the best way to make Phonesim support test
> automation. So comments are welcome:)
It's awesome! I tried the patch and simply copy call.js to /tmp/scripts and it makes a call to oFono like a magic. ;-)
> -----
> Yang Gu (1):
> Enable Qt Script
>
> configure.ac | 2 +-
> src/control.cpp | 60
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files
> changed, 61 insertions(+), 1 deletions(-)
>
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono
Regards,
Zhenhua
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/1] Patch Description
2010-09-24 15:49 [PATCH 0/1] Patch Description Yang Gu
2010-09-24 15:49 ` [PATCH 1/1] Enable Qt Script Yang Gu
2010-09-25 3:00 ` [PATCH 0/1] Patch Description Zhang, Zhenhua
@ 2010-09-26 23:38 ` Denis Kenzior
2 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2010-09-26 23:38 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
Hi Yang,
On 09/24/2010 10:49 AM, Yang Gu wrote:
> Phonesim is most of time a convenient way to test oFono. For example, it can be used to test MO call, as well as MT call.
> And talking about test area, test automation is quite important regarding to both efficiency and effectiveness. In the test of MO call, scripts can be used to interact with oFono via D-Bus to make test automation possible. However, in the test of MT call, currently we have to enter the caller number and click some button in Phonesim GUI to simulate an incoming call, which makes test automation unrealistic.
> This patch is to enable Qt script (JavaScript following ECMAScript spec) in Phonesim, so that we can have some script control its GUI conveniently, and satisfy the test automation.
>
I like this idea
> With this patch, Phonesim can work in the following way:
> 1. It observes some specific directory (/tmp/scripts) to see if there is some test scripts added.
> 2. Once Phonesim finds a new test script is added, it will parse and execute the script.
> 3. You may add more and more test scripts to the specific directory with your test goes on.
>
However, using cp to run scripts seems a bit un-intuitive. Perhaps a
simple D-Bus interface which can run the scripts would be better?
E.g. something like
org.ofono.Phonesim:
string Run(string script)
where the script contains the script to run and the return value might
return whatever is printed from the script.
Regards,
-Denis
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/1] Patch Description
@ 2010-11-03 6:57 Yang Gu
0 siblings, 0 replies; 7+ messages in thread
From: Yang Gu @ 2010-11-03 6:57 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 480 bytes --]
Sometimes we need to know the version of phonesim via a command. This patch is to add this support.
By the way, oFono introduces a file named version.h.in for the macro OFONO_VERSION. Can we use VERSION directly so that this file can be removed?
Yang Gu (1):
Add option to support version
Makefile.am | 2 +-
bootstrap | 2 +-
configure.ac | 1 +
src/main.cpp | 11 +++++++++--
4 files changed, 12 insertions(+), 4 deletions(-)
--
1.7.2.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/1] Patch Description
@ 2010-12-28 16:14 Yang Gu
0 siblings, 0 replies; 7+ messages in thread
From: Yang Gu @ 2010-12-28 16:14 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 999 bytes --]
This patch is to cancel the pending sms via D-Bus. Till now, I'm still not sure what kind of sms should be cancelled. In theory, one message, or part of it, would be sent by oFono can be cancelled. For some examples: Any part of a message that has never been sent can be cancelled; one message was sent but failed, we can cancel before retry; One message is split into several pieces, we can cancel before all of them are sent.
In current patch, I only cancel the sms that has never been sent. I wonder if it's enough or I should handle all the situations above.
Another question here is about the existed code. There is a hashtable "messages" in struct ofono_sms. Can we store the state in the tx_queue_entry, and remove the hashtable thoroughly to make the code more simple?
Yang Gu (1):
sms: Cancel pending message
include/history.h | 1 +
src/sms.c | 132 ++++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 106 insertions(+), 27 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-12-28 16:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 15:49 [PATCH 0/1] Patch Description Yang Gu
2010-09-24 15:49 ` [PATCH 1/1] Enable Qt Script Yang Gu
2010-09-25 3:00 ` [PATCH 0/1] Patch Description Zhang, Zhenhua
2010-09-26 23:38 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2010-12-28 16:14 Yang Gu
2010-11-03 6:57 Yang Gu
2010-09-17 8:50 Yang Gu
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.