BTAdvertiser example of Series60 SDK not working
| Tue, 2004-01-06 18:15 | |
|
Hi!
I'm trying to add an entry to the SDP database of my 3650. I started by trying the BTAdvertiser example of the S60 SDK, but no entry seems to appear. I verified that using a linux based laptop running bluez. I also modified the example a bit, but still no result. I logged the error-codes which are returned when creating a SDP-Server session and subsession, but both are KErrNone (0). Then i saved the TSDPServRecordHandle which is returned when calling RSdpDatabase->CreateServiceRecordL to a log-file and its value was "65551". Now i'm stuck and don't know where the problem is - no error returned - no strange behaviour - except that it doesn't do what is expected: create a SDP-database entry. Any comment is welcome! Kindest regards, Hendrik Bock (bock@bluemate.de) |
|






Have you tried the cobain libraries? They're available for series 60 (Although I can't see any difference between the Nokia examples & Cobain). I've also tried those on UIQ but same result. YMMV.
If I was more paranoid I'd think that SE had disabled the sdp database from RW access by users code to ensure that only they could provide BT services...
Forum posts: 29
The problem is: The SDP entry gets created, its just not visible for other devices! SDP entries are only visible, if they are part of the root browse group (and my SDP entry wasn't, and yours isn't either, i guess)
So just modify your SDP-entry so that its part of the root browse group, then other devices will also see the entry. You can achieve this by just adding the following lines to the end of your StartAdvertiserL-method:
-------------------------------------------------------------------------
TUUID rootTUUID(0x1002) // ID of root browse group
CSdpAttrValueUUID* rootBrowseGroupAttr = CSdpAttrValueUUID::NewUUIDL(rootTUUID);
iSdpDatabase.UpdateAttributeL(iRecord, KSdpAttrIdBrowseGroupList, *rootBrowseGroupAttr);
-------------------------------------------------------------------------
Thats all, just these three lines.
If you still don't get it running: verify the value of the created service record handle. If its increased by one, each time you call your StartAdvertiserL-method, then its a good hint, that something got created in the SDP-database, you only don't see it.
Kindest regards,
Hendrik Bock
Forum posts: 5
Hot damn! It works!
Where did you find this little titbit?
I found some more docs in the UIQ 2.1 on the SDP. No mention of this. There's no mention in the SYmbian OS Comms book (It's pretty useless for SDP server side stuff), and the Nokia examples don't do this (Is 6.0 different somewhere? Or are the nokia examples just broken?)
regards
Hamish.
The neccessity of doing this is mentioned in the bluetooth core specification - part e.
The examples of the nokia sdk are not broken. Because the example programs know exactly what they have to look for, they can find the sdp entry, although its not part of the root browse group. I have not verified the code of the examples to check how this works, but i'm sure you'll find the answer there if you are interested.
Kindest regards,
Hendrik Bock
Forum posts: 83
-------------------------------------------------------------------------
TUUID rootTUUID(0x1002) // ID of root browse group
CSdpAttrValueUUID* rootBrowseGroupAttr = CSdpAttrValueUUID::NewUUIDL(rootTUUID);
iSdpDatabase.UpdateAttributeL(iRecord, KSdpAttrIdBrowseGroupList, *rootBrowseGroupAttr);
-------------------------------------------------------------------------
This approach DOES NOT work with Microsoft Bluetooth stack in Windows XP SP#2. SPP is created Ok, WIDCOMM stack in Windows and Bluez in Linux browse SDP database and find new service entry, but this entry can not be found if either Microsoft stack or BlueSoleil is used. I could only see new service added if I use
CleanupStack::PushL(protocolDescriptor);
protocolDescriptor
->StartListL()
->BuildUUIDL(KPublicBrowseGroupUUID)
->EndListL();
iSdpDatabase.UpdateAttributeL(iRecord,
KSdpAttrIdBrowseGroupList,
*protocolDescriptor);
CleanupStack::PopAndDestroy(protocolDescriptor);
instead of just CSdpAttrValueUUID::NewUUIDL.
Who is wrong? Dunno.
c0deab1e