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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Regular Contributor
_NishantShah
Posts: 75
Registered: ‎07-31-2012
My Carrier: Vodafone

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

Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 75
Registered: ‎07-14-2008

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

Please use plain text.
Regular Contributor
_NishantShah
Posts: 75
Registered: ‎07-31-2012
My Carrier: Vodafone

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

Please use plain text.