You Are Here:

Community: Developer Discussion Boards

#1 Old problem with asyncrone commands - 2008-11-27, 06:59

Join Date: Aug 2008
Posts: 171
Location: Zanjan
masoud_bayat's Avatar
masoud_bayat
Offline
Regular Contributor
Hi all
We work on bluetooth service code.
In our application we need to section of our codes wait to ended asyncronous commands(find service & find attribute) and them results be returned.But we can't do it and before complete results returned from find attribute, our codes continued and dont wait to result.
this is our codes:
Quote:
for ( TInt idx=0; idx<(iGrpDataList.Count()); idx++ )
{
TGroupData* dev = &iGrpDataList[idx];
switch(iState)
{
(1)case EWaitingToDiscover:
iconnector->discoverService(dev);
idx--;
iState=EWaitingToRegister;
break;

(2)case EWaitingToRegister:
dev->iDeviceServicePort=iservicediscoverer->Port();
dev->iGroupName=iservicediscoverer->Group();
iState=EWaitingToDiscover;
break;

default:
break;
}
}
Quote:
void Cdfshconnector:: discoverService(TGroupData* aDevData)
{
iDevData=aDevData;
if ( iState == EWaitingToConnect && !IsActive() )
{
iStatus = KRequestPending;
iservicediscoverer->FindServiceL(iDevData,iStatus);
iState = EWaitingToConnect;
SetActive();
}
else
{
//iLog.LogL(_L("Client busy"));
User::Leave(KErrInUse);
}
}
In fact, we need to section (1) complete then section (2) run and complete. But before completing section (1) section (2) started to run.
anyone can help us?
thanks.
Reply With Quote

#2 Old Re: problem with asyncrone commands - 2008-11-27, 08:51

Join Date: Mar 2008
Posts: 576
mahbub_s60's Avatar
mahbub_s60
Offline
Forum Nokia Expert
Hi,

You have to use Active object in your APP,
see this link has an example.


-Mahbub
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems sending SMS with AT commands bow24el General Messaging 4 2007-02-15 05:46
PROBLEM IN DISPLAYING MENU COMMANDS pistha Symbian Networking & Messaging 1 2006-09-21 16:17
problem in carbide sameerbkamble Carbide.c++ IDE and plug-ins 1 2006-07-06 17:48
About 6230 Bt Problem eerkek Bluetooth Technology 17 2005-02-08 13:33
7210 Silent Problem MarkMckim Mobile Java General 1 2003-03-18 13:36

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia