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
|