Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gta04 - Don't wait for response to AT+VTS command (for DTMF tones)

Currently, within a given call, only the first DTMF tone goes out,
I believe because the GTA04 modem doesn't send any response to AT+VTS,
and so the AT chat gets stuck.  The patch below fixes that by adding a
parameter to QAtChat::chat that tells it not to wait for a response.

Without this change, it's only possible to send one DTMF tone in a
call - because after that the AtChat is stuck waiting for a response
to the AT+VTS command for that first one.  With this change, I've
tested that it's possible to send multiple tones within the same call,
and that they have the expected effect (as determined by the remote).
  • Loading branch information...
commit b98287747b785bb72954edc76105592d6c9404d4 1 parent 66fb2b2
@neiljerram neiljerram authored committed
View
4 devices/gta04/src/server/core_server/etc/default/Trolltech/qpe.conf
@@ -15,7 +15,7 @@ Button_alpha=176
ButtonText=#FFFFFF
ButtonText_disabled=#FFFFFF
ButtonText_disabled_alpha=128
-DecorationTheme=finxi/decorationrc
+DecorationTheme=mokofaen/decorationrc
Foreground=#FFFFFF
Foreground_disabled=#FFFFFF
Foreground_disabled_alpha=128
@@ -30,7 +30,7 @@ Style=QThumbStyle
Text=#FFFFFF
Text_disabled=#FFFFFF
Text_disabled_alpha=128
-Theme=finxi.conf
+Theme=mokofaen.conf
[Style]
View
4 devices/neo/src/server/core_server/etc/default/Trolltech/qpe.conf
@@ -15,7 +15,7 @@ Button_alpha=176
ButtonText=#FFFFFF
ButtonText_disabled=#FFFFFF
ButtonText_disabled_alpha=128
-DecorationTheme=finxi/decorationrc
+DecorationTheme=mokofaen/decorationrc
Foreground=#FFFFFF
Foreground_disabled=#FFFFFF
Foreground_disabled_alpha=128
@@ -30,7 +30,7 @@ Style=QThumbStyle
Text=#FFFFFF
Text_disabled=#FFFFFF
Text_disabled_alpha=128
-Theme=finxi.conf
+Theme=mokofaen.conf
[Style]
View
16 src/libraries/qtopiacomm/serial/qatchat.cpp
@@ -92,6 +92,7 @@ class QAtChatCommandPrivate
bool primed;
bool forcedAbort;
QAtChatCommand *next;
+ bool noResponse;
};
class QAtChatPrivate
@@ -205,9 +206,11 @@ static QByteArray fromHex( const QString& hex )
return bytes;
}
-QAtChatCommand::QAtChatCommand( const QString& command, QAtResult::UserData *data )
+QAtChatCommand::QAtChatCommand( const QString& command, QAtResult::UserData *data,
+ bool noResponse )
{
d = new QAtChatCommandPrivate( command, data );
+ d->noResponse = noResponse;
}
QAtChatCommand::QAtChatCommand( const QString& command, const QByteArray& pdu,
@@ -318,9 +321,9 @@ void QAtChat::chat( const QString& command )
\sa QAtResult, QAtResultParser
*/
void QAtChat::chat( const QString& command, QObject *target, const char *slot,
- QAtResult::UserData *data )
+ QAtResult::UserData *data, bool noResponse )
{
- QAtChatCommand *cmd = new QAtChatCommand( command, data );
+ QAtChatCommand *cmd = new QAtChatCommand( command, data, noResponse );
if ( target && slot )
connect( cmd, SIGNAL(done(bool,QAtResult)), target, slot );
queue( cmd );
@@ -982,6 +985,13 @@ void QAtChat::prime()
if ( d->retryOnNonEcho != -1 ) {
d->retryTimer->start( d->retryOnNonEcho );
}
+
+ // If we shouldn't expect any response to this command, call
+ // done() immediately with an "OK" result.
+ if (cmd->d->noResponse) {
+ cmd->d->result.setResult( "OK" );
+ done();
+ }
}
void QAtChat::primeIfNecessary()
View
2  src/libraries/qtopiacomm/serial/qatchat.h
@@ -40,7 +40,7 @@ class QTOPIACOMM_EXPORT QAtChat : public QObject
public:
void chat( const QString& command );
void chat( const QString& command, QObject *target, const char *slot,
- QAtResult::UserData *data = 0 );
+ QAtResult::UserData *data = 0, bool noResponse = false );
void chatPDU( const QString& command, const QByteArray& pdu,
QObject *target, const char *slot,
QAtResult::UserData *data = 0 );
View
3  src/libraries/qtopiacomm/serial/qatchat_p.h
@@ -44,7 +44,8 @@ class QAtChatCommand : public QObject
friend class QAtChat;
friend class QAtChatPrivate;
public:
- QAtChatCommand( const QString& command, QAtResult::UserData *data );
+ QAtChatCommand( const QString& command, QAtResult::UserData *data,
+ bool noResponse = false );
QAtChatCommand( const QString& command, const QByteArray& pdu,
QAtResult::UserData *data );
~QAtChatCommand();
View
26 src/libraries/qtopiacomm/serial/qserialport.cpp
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
+#include <time.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
@@ -58,6 +59,7 @@ class QSerialPortPrivate
this->keepOpen = true;
this->notifier = 0;
this->timer = 0;
+ this->zeroReadSecs = 0;
}
~QSerialPortPrivate()
{
@@ -80,6 +82,7 @@ class QSerialPortPrivate
bool keepOpen;
QSocketNotifier *notifier;
QTimer *timer;
+ time_t zeroReadSecs;
};
/*!
@@ -450,6 +453,29 @@ qint64 QSerialPort::readData( char *data, qint64 maxlen )
qLog(Modem) << "QSerialPort::readData: other end closed the connection" ;
close();
}
+ if(result == 0) {
+ if(d->device != "/dev/ttyHS_Application") {
+ return 0;
+ }
+ struct timespec tp;
+ if (!clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ return 0;
+
+ if(d->zeroReadSecs == 0) {
+ d->zeroReadSecs = tp.tv_sec;
+ return 0;
+ }
+ if(tp.tv_sec - d->zeroReadSecs < 30) {
+ return 0;
+ }
+ qWarning() << "QSerialPort::readData: received 0 bytes in last 30 secs, restarting qtmoko";
+ QProcess *p = new QProcess();
+ p->start("qterminal", QStringList() << "-c" << "fix-modem-reenumerate.sh");
+ d->zeroReadSecs = 0;
+ return 0;
+ } else {
+ d->zeroReadSecs = 0;
+ }
return result;
#else
return -1;
View
8 src/libraries/qtopiaphonemodem/qmodemcall.cpp
@@ -497,7 +497,13 @@ void QModemCall::tone( const QString& tones )
if ( state() == QPhoneCall::Connected && tones.length() > 0 ) {
provider()->atchat()->chat( formatTones( tones, provider()->vtsType() ),
this, SLOT(vtsRequestDone(bool,QAtResult)),
- new QToneUserData( tones ) );
+ new QToneUserData( tones )
+#ifdef QT_QWS_GTA04
+ // The GTA04 modem doesn't provide any response to AT+VTS, so
+ // don't wait for a response.
+ , true
+#endif
+ );
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.