From: Nicolas Bertrand <nicolas.bertrand@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 2/2] phonesim: Add CSSU/CSSI notification support
Date: Tue, 29 Mar 2011 17:16:36 +0200 [thread overview]
Message-ID: <1301411796-18027-3-git-send-email-nicolas.bertrand@linux.intel.com> (raw)
In-Reply-To: <1301411796-18027-1-git-send-email-nicolas.bertrand@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2935 bytes --]
---
src/control.cpp | 30 +++++++++++++++++++++++++++++-
src/control.h | 2 ++
2 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/src/control.cpp b/src/control.cpp
index 279bade..645219c 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -87,6 +87,7 @@ ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
connect(ui->pbReset, SIGNAL(clicked()), this, SLOT(modemSilentReset()));
connect(ui->pbSendGNSSData, SIGNAL(clicked()), this, SLOT(sendGNSSData()));
connect(ui->pbGNSSDefault, SIGNAL(clicked()), this, SLOT(setDefaultGNSSData()));
+ connect(ui->pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN()));
QStringList headers;
headers << "Sender" << "Priority" << "Notification Status";
@@ -94,6 +95,7 @@ ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
ui->twMessageList->verticalHeader()->hide();
handleNewApp();
+ handleCSSNNotif();
show();
}
@@ -142,13 +144,39 @@ void Control::warning( const QString &title, const QString &message )
QMessageBox::warning(widget, title, message, "OK");
}
+void ControlWidget::handleCSSNNotif()
+{
+ ui->cbCSSU->insertItem(0, "");
+ ui->cbCSSU->insertItem(1, "0 - forwarded", 0);
+ ui->cbCSSU->insertItem(3, "2 - on hold", 2);
+ ui->cbCSSU->insertItem(4, "3 - retrieved", 3);
+ ui->cbCSSU->insertItem(5, "4 - multiparty", 4);
+
+ ui->cbCSSI->insertItem(0, "");
+ ui->cbCSSI->insertItem(3, "2 - forwarded", 2);
+ ui->cbCSSI->insertItem(6, "5 - outgoing barred", 5);
+ ui->cbCSSI->insertItem(7, "6 - incomming barred", 6);
+}
+
+void ControlWidget::sendCSSN()
+{
+ QVariant v = ui->cbCSSU->itemData(ui->cbCSSU->currentIndex());
+
+ if (v.canConvert<int>())
+ emit unsolicitedCommand("+CSSU: "+QString::number(v.toInt()));
+
+ v = ui->cbCSSI->itemData(ui->cbCSSI->currentIndex());
+
+ if (v.canConvert<int>())
+ emit unsolicitedCommand("+CSSI: "+QString::number(v.toInt()));
+}
+
void ControlWidget::sendSQ()
{
emit variableChanged("SQ",QString::number(ui->hsSignalQuality->value())+",99");
emit unsolicitedCommand("+CSQ: "+QString::number(ui->hsSignalQuality->value())+",99");
}
-
void ControlWidget::sendBC()
{
bool charging = ui->hsBatteryCharging->checkState() == Qt::Checked;
diff --git a/src/control.h b/src/control.h
index eac4288..c17146a 100644
--- a/src/control.h
+++ b/src/control.h
@@ -70,6 +70,7 @@ public:
void handleFromData( const QString& );
void handleToData( const QString& );
void handleNewApp();
+ void handleCSSNNotif();
private slots:
void sendSQ();
@@ -97,6 +98,7 @@ private slots:
void modemSilentReset();
void sendGNSSData();
void setDefaultGNSSData();
+ void sendCSSN();
signals:
void unsolicitedCommand(const QString &);
--
1.7.1
next prev parent reply other threads:[~2011-03-29 15:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 15:16 [PATCH 0/2] Phonesim: add support for CSSU/CSSI notification Nicolas Bertrand
2011-03-29 15:16 ` [PATCH 1/2] phonesim: add CSSU/CSSI UI Nicolas Bertrand
2011-03-29 15:16 ` Nicolas Bertrand [this message]
2011-03-30 3:41 ` [PATCH 0/2] Phonesim: add support for CSSU/CSSI notification Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301411796-18027-3-git-send-email-nicolas.bertrand@linux.intel.com \
--to=nicolas.bertrand@linux.intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox