All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phonesim: Fix AT+CHLD=1x
@ 2012-03-13 14:33 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2012-03-14  2:38 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2012-03-13 14:33 UTC (permalink / raw)
  To: ofono

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

AT+CHLD=1x should only hangup active call
---
 src/callmanager.cpp |   38 ++++++++++++++++++++++++--------------
 1 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index dfa2b9e..7208100 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -441,7 +441,21 @@ void CallManager::hangupConnectedAndHeld()
 
 void CallManager::hangupCall( int id )
 {
-    chld1x( id );
+    QList<CallInfo> newCallList;
+    for ( int index = 0; index < callList.size(); ++index ) {
+	if ( callList[index].id == id ) {
+	    callList[index].state = CallState_Hangup;
+	    sendState( callList[index] );
+	} else {
+	    newCallList += callList[index];
+	}
+    }
+    callList = newCallList;
+
+    if ( !hasCall( CallState_Active ) && !hasCall( CallState_Held ) )
+	waitingToIncoming();
+
+    emit callStatesChanged( &callList );
 }
 
 void CallManager::hangupRemote( int id )
@@ -491,8 +505,10 @@ bool CallManager::chld0()
 {
     // If there is an incoming call, then that is the one to hang up.
     int id = idForIncoming();
-    if ( id >= 0 )
-        return chld1x( id );
+    if ( id >= 0 ) {
+        hangupCall( id );
+        return true;
+    }
 
     // Bail out if no held calls.
     if ( !hasCall( CallState_Held ) )
@@ -540,24 +556,18 @@ bool CallManager::chld1()
 
 bool CallManager::chld1x( int x )
 {
-    QList<CallInfo> newCallList;
-    bool found = false;
     for ( int index = 0; index < callList.size(); ++index ) {
-        if ( callList[index].id == x ) {
-            callList[index].state = CallState_Hangup;
-            sendState( callList[index] );
-            found = true;
-        } else {
-            newCallList += callList[index];
+        if ( callList[index].id == x && callList[index].state == CallState_Active) {
+            hangupCall( x );
+            return true;
         }
     }
-    callList = newCallList;
 
     if ( !hasCall( CallState_Active ) && !hasCall( CallState_Held ) )
-        waitingToIncoming();
+	waitingToIncoming();
 
     emit callStatesChanged( &callList );
-    return found;
+    return false;
 }
 
 bool CallManager::chld2()
-- 
1.7.1


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

* Re: [PATCH] phonesim: Fix AT+CHLD=1x
  2012-03-13 14:33 [PATCH] phonesim: Fix AT+CHLD=1x =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-14  2:38 ` Denis Kenzior
  2012-03-14 11:39   ` Frederic Danis
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2012-03-14  2:38 UTC (permalink / raw)
  To: ofono

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

Hi Frédéric,

On 03/13/2012 09:33 AM, Frédéric Danis wrote:
> AT+CHLD=1x should only hangup active call
> ---
>  src/callmanager.cpp |   38 ++++++++++++++++++++++++--------------
>  1 files changed, 24 insertions(+), 14 deletions(-)
> 

What are you trying to fix here?  Phonesim models the behavior of an
'ideal' modem which can hangup any call using release_specific.  Plenty
of modems exhibit this behavior via vendor specific AT commands, so if
this is related to HFP emulation then we probably need to do something else.

Regards,
-Denis

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

* Re: [PATCH] phonesim: Fix AT+CHLD=1x
  2012-03-14  2:38 ` Denis Kenzior
@ 2012-03-14 11:39   ` Frederic Danis
  0 siblings, 0 replies; 3+ messages in thread
From: Frederic Danis @ 2012-03-14 11:39 UTC (permalink / raw)
  To: ofono

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

Hello Denis,

Le 14/03/2012 03:38, Denis Kenzior a écrit :
> Hi Frédéric,
>
> On 03/13/2012 09:33 AM, Frédéric Danis wrote:
>> AT+CHLD=1x should only hangup active call
>> ---
>>   src/callmanager.cpp |   38 ++++++++++++++++++++++++--------------
>>   1 files changed, 24 insertions(+), 14 deletions(-)
>>
>
> What are you trying to fix here?  Phonesim models the behavior of an
> 'ideal' modem which can hangup any call using release_specific.  Plenty
> of modems exhibit this behavior via vendor specific AT commands, so if
> this is related to HFP emulation then we probably need to do something else.
>
> Regards,
> -Denis
>

I found this during tests around AT+CHLD commands.
I just follows HFP and 3GPP specs about the AT+CHLD=1x command : 
"Releases a specific active call X.".
But if this is the attended behavior in phonesim, just forget my patch.

Regards

Fred

-- 
Frederic Danis                            Open Source Technology Center
frederic.danis(a)intel.com                              Intel Corporation


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

end of thread, other threads:[~2012-03-14 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 14:33 [PATCH] phonesim: Fix AT+CHLD=1x =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14  2:38 ` Denis Kenzior
2012-03-14 11:39   ` Frederic Danis

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.