Cobain: doing Bluetooth the easy way on Symbian OS/Series 60
8 Dec 2003 - 11:38
Keywords :

For those impatient, check out http://irssibot.777-team.org/cobain/. There is everything you need to get to know Cobain a bit more.

The following is basically the same text I posted on the Symbian DevNet forum.

We wrote a Bluetooth framework for a master's project at our university, and after a lengthy process had it working and decided no one should be forced to go through the same process ;) The artifact of this work is a simple-to-use API for managing bluetooth connections. It features device/service discovery and connect/listen/read/write handling code.

A small example of how to fetch in-range service with, say, UUID = 0x123456

// create the API facade
CCobainLayer *cobain = CCobainLayer::NewL();

// fetch Bluetooth driver (Cobain will support other carriers too)
MNetworkDriver *driver = cobain->GetDriverL(EBluetooth);

// fetch peers synchronously - for demo purposes, normally
// we'd use asynchronous, of course
TPeerList *peerlist = driver->GetPeersL(0x123456);

// connect to the first peer found
CNetworkPeer *peer = (*peerlist)[0];
RCobainSocket *socket = peer->ConnectL();

// send some data
_LIT8(KData, "hello, world!");
socket->SendL(&KData);

// close & cleanup
socket->Close();
delete driver;
delete cobain;

That's it.

The Cobain API is in its early stages; the functionality might seem clumsy at times. Although, the core has been tested quite extensively and is already running a couple of closed source products. The work on the API will continue and Cobain will evolve beyond being just an communications API - all design work is already done for a ad-hoc routing system, only thing missing is scatternet support in the devices.

happy hacking,

Matti

Tutorial posted December 8th, 2003 by mdahlbom

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by Anonymous on Wed, 2004-01-07 13:50.

This seems just like another not very well made example/framework/etc...

Downloaded and tried the ctalk example on my and friend's 7650 - didn't work - when trying to find a peer, it stays in endless "Application busy" screen...


Submitted by Matti (not verified) on Wed, 2004-01-07 14:44.

Let me guess - there wasn't another CTalk instance listening in range?

The app shouldn't hang though - the initial CTalk version contains a bug that causes the 'Application busy' hangup if it does not find any peers. My bad.


Submitted by Nishkam (not verified) on Sun, 2004-03-14 01:34.

Is there a version of Cobain for Sony Ericsson P800/P900?

Submitted by Anonymous on Mon, 2005-04-04 02:09.

Hello mates! I've downloaded ctalk and it worked fine on my n-gage, except when one point disconnected, the other would pop a dialog to inform user that the connection has been closed. But when I closed the application, the OS showed a dialog indicating there was something wrong with the application, with this message "Application closed". How would I get arround this?

Thx.


Submitted by geek (not verified) on Fri, 2005-05-06 20:20.

Hey I download cobain cTalk and when I made my own sis file and loaded in N-gage phone and I try to open it it gives system error and it works in Noika 7610 phone. Another issue with this is that the application with my sis file is not able to talk with the other phone wven when both of them are paired. It just works with the sis file given with the application. Can anyone help me with this please.

Submitted by Shebin (not verified) on Fri, 2007-03-23 09:10.

There is no GetPeersL() Function anywhere in the Headers

Submitted by Anonymous on Mon, 2007-03-26 11:55.

Its the old version

Submitted by Skyluke (not verified) on Mon, 2004-06-28 10:12.

Does this framework connects the comm port of the 2 devices?

Submitted by flicker82 (not verified) on Wed, 2004-09-15 08:50.

hi.. i just tried ctalk on two 6600 phones. one was listening, the other was connecting. they did not see each other. the connecting phone says "no peers found". what would be the solution for this? or.. is this a bug?

Submitted by Giulio (not verified) on Fri, 2005-06-03 15:14.

Have you put one of these cells in Listen mode?

Submitted by Labyrinth (not verified) on Sat, 2004-09-18 19:12.

How do i specify service's UUID for the discovery? (Which value of UUID)

Submitted by Giulio (not verified) on Fri, 2005-06-03 15:13.

U have to specify it in this way: "const TUint KCtalkUUID = 0xabbaabba; " There is in the ctalk example

Submitted by Giulio (not verified) on Fri, 2005-06-03 15:18.

Hi, I noticed that the receiving is not so good, in fact I tried to send from a bluetooth module a string but it isn't displayed on the dialog. I'm only able to send strings from cell. What could be? And Matti how have you learned how use bluetooth? Because the only example I've found working is yours. Do your examples of SDK or BuilderX work?

Submitted by tri (not verified) on Thu, 2005-06-16 08:53.

silly question, I am completely newbie.

I have downloaded cobain 0.9.1: cobain.sis, ctalk.sis. I have installed cobain.sis then ctalk.sis onto my Nokia 6600 sucessfully.

The matter is I want to play more with cobain, so I downloaded also cobain.zip contain some cobain.h, armi libraries and wins ones --> I put it all on C:\CPP\cobain

then I also download ctalk-src.zip, contains all ctalk source code rooted on ctalk directory. I put it in c:\CPP\ctalk

is it enough to re compile ctalk with this source (binary cobain and ctalk source) ? have I put all this file in right place ?

I have tried to edit ctalk.mmp and direct second USERINCLUDE (to look for cobain.h), but still my abld can't not find cobain.h <-- I have issued bldmake bldfiles first to create abld.bat adjusted to my development environment. I use MS Visual Studio .net 2003 / Perl 5.8

need I to use cobain-src ? where I should put this source ?

thanks 4 any clue

tri I am allowed to change cobain source code, aren't I ?


Submitted by andycarr on Wed, 2008-01-09 10:36.

Hi,

do you have a simple example (like the one above) for the Cobain 2.0 update? I have tried to build an application that includes the Cobain 2.0 RC1 source and the CTalk source however many of the classes / functions have changed or are missing.

Thanks



copyright 2003-2009 NewLC SARL