| Reply | « Previous Thread | Next Thread » |
|
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??? |
| windalfred |
| View Public Profile |
| Find all posts by windalfred |
|
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 ![]() |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|