All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Add null text string case to phonesim
@ 2011-01-03  9:43 Jeevaka Badrappan
  2011-01-03  9:43 ` [PATCH 1/1] phonesim: add null text string case Jeevaka Badrappan
  0 siblings, 1 reply; 3+ messages in thread
From: Jeevaka Badrappan @ 2011-01-03  9:43 UTC (permalink / raw)
  To: ofono

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

Hi,

 Null text string object is text string with len = 0 whereas empty text
string is text string with len = 1 but no value for text string. 
Handling procedure remains the same for both cases. Following patch
adds the null text string case as well to the phonesim.

Regards,
Jeevaka
 
Jeevaka Badrappan (1):
  phonesim: add null text string case

 src/qsimcommand.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


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

* [PATCH 1/1] phonesim: add null text string case
  2011-01-03  9:43 [PATCH 0/1] Add null text string case to phonesim Jeevaka Badrappan
@ 2011-01-03  9:43 ` Jeevaka Badrappan
  2011-01-04 16:55   ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: Jeevaka Badrappan @ 2011-01-03  9:43 UTC (permalink / raw)
  To: ofono

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

---
 src/qsimcommand.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index f12b8ac..1af2b76 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -2813,12 +2813,18 @@ void _qtopiaphone_writeTextString( QByteArray& binary, const QString& str,
 void _qtopiaphone_writeTextString( QByteArray& binary, const QString& str,
                                    QSimCommand::ToPduOptions options, int tag )
 {
-    if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0 ) {
-        // Special form for zero-length strings.
+    if ( str.isNull() ) {
         binary += (char)tag;
         binary += (char)0x00;
         return;
     }
+    if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0 ) {
+        // Special form for empty strings.
+        binary += (char)tag;
+        binary += (char)0x01;
+        binary += (char)options;
+        return;
+    }
     int schemeMask = ((tag & 0xFF00) >> 8);     // For USSD string output.
     if ( ( options & QSimCommand::UCS2Strings ) == 0 ) {
         QTextCodec *gsm = QAtUtils::codec( "gsm-noloss" );
-- 
1.7.0.4


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

* Re: [PATCH 1/1] phonesim: add null text string case
  2011-01-03  9:43 ` [PATCH 1/1] phonesim: add null text string case Jeevaka Badrappan
@ 2011-01-04 16:55   ` Denis Kenzior
  0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2011-01-04 16:55 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

On 01/03/2011 03:43 AM, Jeevaka Badrappan wrote:
> ---
>  src/qsimcommand.cpp |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 

I applied this patch, however:

> +    if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0 ) {
> +        // Special form for empty strings.
> +        binary += (char)tag;
> +        binary += (char)0x01;
> +        binary += (char)options;

This part was working by accident.  options does not necessarily map to
a valid dcs used by the Text data object.  I fixed this in a follow on
commit.

> +        return;
> +    }
>      int schemeMask = ((tag & 0xFF00) >> 8);     // For USSD string output.
>      if ( ( options & QSimCommand::UCS2Strings ) == 0 ) {
>          QTextCodec *gsm = QAtUtils::codec( "gsm-noloss" );

Regards,
-Denis

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

end of thread, other threads:[~2011-01-04 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-03  9:43 [PATCH 0/1] Add null text string case to phonesim Jeevaka Badrappan
2011-01-03  9:43 ` [PATCH 1/1] phonesim: add null text string case Jeevaka Badrappan
2011-01-04 16:55   ` 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.