Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry

Can not fetch updateTimeout() signal

Hi,

 

I created a sample project to fetch GPS coordinates.

 

 

This is how I created object of QGeoPostionInfoSource:

 

positionSource = QGeoPositionInfoSource::createDefaultSource(this);
if (positionSource) {
connect(positionSource,
SIGNAL(positionUpdated(const QGeoPositionInfo &)), this,
SLOT(updateLocation(const QGeoPositionInfo &)));
connect(positionSource, SIGNAL(updateTimeout()), this, SLOT(timeout()));
}

 

I can fetch updateTimeout() signal when I request for a single location update & if location is not found.

 


if (positionSource) {

positionSource->setPreferredPositioningMethods(QGeoPositionInfoSource::smileyfrustrated:atellitePositioningMethods);
positionSource->requestUpdate(15000);

 

}

 

But I can't fetch same signal when I start regular updates for location & location is not found:

 

if (positionSource) {


positionSource->setUpdateInterval(2000);
positionSource->setPreferredPositioningMethods(QGeoPositionInfoSource::smileyfrustrated:atellitePositioningMethods);
positionSource->startUpdates();

}

 

According to documentation it should emit updateTimeout() signal. Am I making any mistake over here? Any kind of help will be highly appreciated.

 

Thanks,

Nishant Shah

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can not fetch updateTimeout() signal

Hi,

According to the API docs, 

"If requestUpdate() was called, this signal will be emitted if the current position could not be retrieved within the specified timeout.

If startUpdates() has been called, this signal will be emitted if this QGeoPositionInfoSource subclass determines that it will not be able to provide further regular updates. This signal will not be emitted again until after the regular updates resume."

 

I think what you are seeing is expected. When you call startUpdates() for continuous fixes, the updateTimeout() wont be called until the underlying location module determines that it wont be able to provide any fixes at this time. However, for single update, (requestUpdate()) the API is correctly firing updateTimeout() after the specified timeout value.

 

If you want to specify a timeout for continuous fixes, you may try:

positionSource->setProperty("responseTime", "15000");

This will force the underlying location module to return a fix within 15 seconds.

 

Shadid

Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry

Re: Can not fetch updateTimeout() signal

Thanx Shaque for replying,

 

But it still doesn't work. This is my code

 

locationEngine->startLocationUpdates(5000);

 

void LocationEngine::startLocationUpdates(int frequency) {
if (positionSource) {
positionSource->setUpdateInterval(frequency);
positionSource->setPreferredPositioningMethods(
QGeoPositionInfoSource::AllPositioningMethods);
positionSource->setProperty("responseTime", 10000);
positionSource->startUpdates();
qDebug() << "updates started";
}
}

 

Am I missing something? & also I can't find properties in the documentation. Can you tell me where I can find these?

 

Regards,

Nishant Shah

New Developer
bwalter
Posts: 25
Registered: ‎01-23-2013
My Device: BB10 Simulator

Re: Can not fetch updateTimeout() signal

[ Edited ]

I confirm the issue, even when setting the "responseTime" property. There's is definitly something wrong in the BlackBerry implementation. Actually, the "responseTime" should not be needed (see for example the Harmattan implementation...).

 

I would love to see this issue fixed. Shall I file a bug report?

Regular Contributor
lunaplena
Posts: 205
Registered: ‎06-11-2013
My Device: Blackbery z10

Re: Can not fetch updateTimeout() signal

Try a negative value in the response time and check if it works or not?

New Developer
bwalter
Posts: 25
Registered: ‎01-23-2013
My Device: BB10 Simulator

Re: Can not fetch updateTimeout() signal

It is not working, even with a negative response time.