This page was last modified 07:35, 25 March 2008.
KIS000850 - RPositioner::NotifyPositionUpdate return KErrInUse after few minutes
From Forum Nokia Wiki
This known issue was originally created by Alammi and has been verified by Forum Nokia.
| ID | KIS000850 | Creation Date | March 25, 2008 |
| Platform | S60 3rd Edition, Feature Pack 1 | Devices | Nokia N95, Nokia E90 Communicator, Nokia 6110 Navigator |
| Category | Symbian C++ | Subcategory | Location-based Services |
Overview
Trying to use RPositioner::NotifyPositionUpdate() to receive GPS position fails after a certain number of updates have been made, if update options have been omitted.
Detailed description
Approximately after 4-5 minutes (255 update cycles), RPositioner::NotifyPositionUpdate() completes with error KErrInUse (-14). This happens when the client has not set valid update options with RPositioner::SetUpdateOptions().
This is not the defined return value for this API. After returning KErrInUse the RPositioner has "died" and always returns KErrInUse.
Note that the problem does not appear when using a Bluetooth GPS through the Location Acquisition API, or on the emulator.
How to reproduce
Header file:
class CMyPositioner : public CActive
{
...
RPositionServer iPositionServer;
RPositioner iPositioner;
TPositionSatelliteInfo iSatelliteInfo;
};
Implementation:
_LIT(KRequestor, "MyPositioner");
void CMyPositioner::ConstructL()
{
...
User::LeaveIfError( iPositionServer.Connect() );
User::LeaveIfError( iPositioner.Open(iPositionServer) );
User::LeaveIfError( iPositioner.SetRequestor( CRequestor::ERequestorService,
CRequestor::EFormatApplication,
KRequestor) );
CActiveScheduler::Add( this );
}
void CMyPositioner::StartL()
{
...
iPositioner.NotifyPositionUpdate( iSatelliteInfo, iStatus );
SetActive();
}
void CMyPositioner::RunL()
{
if (iStatus == KErrNone)
{
// Got iSatelliteInfo successfully, handle it
HandleSatelliteInfo();
// Request next update
iPositioner.NotifyPositionUpdate(iSatelliteInfo, iStatus);
SetActive();
}
else
{
// Fails with KErrInUse (-14) after 255 cycles
_LIT( KDebugMessage, "NotifyPositionUpdate() failed: %d" );
RDebug::Print( KDebugMessage, iStatus.Int() );
}
}
Solution
Set valid update options with RPositioner::SetUpdateOptions() prior to calling RPositioner::NotifyPositionUpdate():
iPositioner.SetUpdateOptions(
TPositionUpdateOptions( aInterval,
TTimeIntervalMicroSeconds(0), /* timeout */
TTimeIntervalMicroSeconds(0), /* max age */
aAcceptPartialUpdates));
iPositioner.NotifyPositionUpdate( iSatelliteInfo, iStatus );
SetActive();
...
Note that the update interval (aInterval) value must be non-zero.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 一个函数返回字符串一般怎么写啊? | alanlus | Symbian | 4 | 2008-04-14 12:30 |
| 请帮看看这个SETTINGLIST错在哪??谢谢:) | storm_ecman | Symbian | 39 | 2005-11-08 03:41 |
| 请问“文件已损坏”是怎么回事? | hanzhida | Symbian | 8 | 2006-11-01 02:15 |
| Sim Card Not Valid! 7610 | REY619 | General Discussion | 4 | 2007-05-23 11:46 |
| ListBox.. App. Closed.. | ashish_apj | Symbian User Interface | 14 | 2007-05-09 10:25 |

