You Are Here:

Community: Developer Discussion Boards

#1 Old question about bluetooth app development - 2003-08-26, 13:49

Join Date: Jul 2003
Posts: 27
Location: macau
windalfred
Offline
Registered User
hi all....
i would like to delvelop a multi-players game....well....and i think the example of the SDK BTPTP is so good so i have used them in my coded....but u know....those CONNECT and RECEIVE functions are asynchronous....problems appear....

now there is server, and a client will connect to it and then receive data from it, and by calling the ConnectL function, which calls SetActive(), connection will be established as soon as it has detected the server....then when should I call the RequestData() function to get data??? I want to connect my Engine and BT Module via AppUi, for example:

BTClient *iClient;
void CMyApp_AppUi::HandleCommandL()
{
......//some condition to invoke ConnectL
iClient->ConnectL();
// some code
iClient->RequestData();
......//use the received data to do sth
}

i want to know those "some code", which allows the RequestData() to be called after conection between server and client has established....

In other words, what should be the better architecture of code which involves communication between ENGINE and ASYNCHRONOUS Bluetooth Module???
Reply With Quote

#2 Old 2003-08-29, 04:27

Join Date: Aug 2003
Posts: 1
bab1550
Offline
Registered User
hi! i'm a newbie in multiplayer development. what does SDK BTPTP means? where can i get it?

i really need that sample code for me to start on.

thanks
Reply With Quote

#3 Old 2003-08-29, 10:11

Join Date: Aug 2003
Posts: 41
vasilak
Offline
Registered User
The most straightforward way is to call RequestData() from inside RunL(). When ConnectL() is executed the last thing it does is to invoke SetActive(). This means that when a connection is established the RunL() will be called right after that. So you should check inside RunL if an error occured and if not you should call RequestData().
Another way would be to call User::WaitForRequest(R) right after calling ConnectL(). The request 'R' would be the TRequestStatus variable that you used when trying to connect inside ConnectL().

BTPT is the BTPointToPoint example included in the Series 60 SDK which you can download from the Nokia website.
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

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