* [Bluez-users] Where does the Bluez stores registered services?
@ 2007-04-16 8:59 Tushar Paturde
2007-04-16 12:41 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Tushar Paturde @ 2007-04-16 8:59 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1.1: Type: text/plain, Size: 326 bytes --]
Hi,
I had registered one btl2cap service using Bluez api's . Even after
stopping the service it is still returned by service discovery done from
another device. I would like to know where is the registry of these services
maintained by bluez library. Also how can I modify this services registry ?
Regards,
Tushar Paturde
[-- Attachment #1.2: Type: text/html, Size: 362 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-users] Where does the Bluez stores registered services?
2007-04-16 8:59 [Bluez-users] Where does the Bluez stores registered services? Tushar Paturde
@ 2007-04-16 12:41 ` Marcel Holtmann
2007-04-17 4:02 ` Tushar Paturde
0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2007-04-16 12:41 UTC (permalink / raw)
To: BlueZ users
Hi Tushar,
> I had registered one btl2cap service using Bluez api's . Even after
> stopping the service it is still returned by service discovery done
> from another device. I would like to know where is the registry of
> these services maintained by bluez library. Also how can I modify
> this services registry ?
if the service record doesn't disappear, then your code is wrong. You
have used persistent SDP records. Don't do that. And it is even better
to register the service records over D-Bus.
Regards
Marcel
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-users] Where does the Bluez stores registered services?
2007-04-16 12:41 ` Marcel Holtmann
@ 2007-04-17 4:02 ` Tushar Paturde
2007-04-18 23:45 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Tushar Paturde @ 2007-04-17 4:02 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1.1: Type: text/plain, Size: 2693 bytes --]
Hi Marcel,
The code snippet that I'm using for registering new service record is as
below .
#define BT_INVALID_SDDB_HANDLE 0
....
bt_result_t bt_sddb_update_record(bt_record_t *record)
{
int scanned;
sdp_record_t *rec = sdp_extract_pdu((uint8_t *)record->data, &scanned);
if (rec == NULL) {
return BT_RESULT_FAILURE;
}
if (record->id == BT_INVALID_SDDB_HANDLE) {
if (sdp_record_register(g_sess, rec, 0) < 0) {
sdp_record_free(rec);
return BT_RESULT_FAILURE;
}
record->id = (bt_sddbid_t)rec->handle;
return BT_RESULT_SUCCESS;
} else {
int retval;
rec->handle = record->id;
retval = sdp_record_update(g_sess, rec);
sdp_record_free(rec);
if (retval < 0) {
return BT_RESULT_FAILURE;
}
record->id = (bt_sddbid_t)rec->handle;
return BT_RESULT_SUCCESS;
}
}
In this code sdp_record_register return with success but the value of
"rec->handle " is set to zero (0). This is problem for me. I think the
value should be greater than zero or ideally 1. Because the "record" that is
passed with service information has set it's handle to zero i.e it point to
the default service record.
This is causes problem in the upper layer of java implementation . So I need
to kill the app manually at present. But it seems "sdp_record_register"
operation is success because the registered service can be browsed by
external device.
Regards,
Tushar
NB: This code snippet is part of phonme project jsr82 implementation
btSDDB.c .
On 4/16/07, Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Tushar,
>
> > I had registered one btl2cap service using Bluez api's . Even after
> > stopping the service it is still returned by service discovery done
> > from another device. I would like to know where is the registry of
> > these services maintained by bluez library. Also how can I modify
> > this services registry ?
>
> if the service record doesn't disappear, then your code is wrong. You
> have used persistent SDP records. Don't do that. And it is even better
> to register the service records over D-Bus.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
--
Tushar Paturde
[-- Attachment #1.2: Type: text/html, Size: 4374 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Bluez-users] Where does the Bluez stores registered services?
2007-04-17 4:02 ` Tushar Paturde
@ 2007-04-18 23:45 ` Marcel Holtmann
0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2007-04-18 23:45 UTC (permalink / raw)
To: BlueZ users
Hi Tushar,
> The code snippet that I'm using for registering new service record
> is as below .
>
> #define BT_INVALID_SDDB_HANDLE 0
> ....
> bt_result_t bt_sddb_update_record(bt_record_t *record)
> {
> int scanned;
> sdp_record_t *rec = sdp_extract_pdu((uint8_t *)record->data,
> &scanned);
> if (rec == NULL) {
> return BT_RESULT_FAILURE;
> }
>
> if (record->id == BT_INVALID_SDDB_HANDLE) {
> if (sdp_record_register(g_sess, rec, 0) < 0) {
> sdp_record_free(rec);
> return BT_RESULT_FAILURE;
> }
> record->id = (bt_sddbid_t)rec->handle;
> return BT_RESULT_SUCCESS;
> } else {
> int retval;
> rec->handle = record->id;
> retval = sdp_record_update(g_sess, rec);
> sdp_record_free(rec);
> if (retval < 0) {
> return BT_RESULT_FAILURE;
> }
> record->id = (bt_sddbid_t)rec->handle;
> return BT_RESULT_SUCCESS;
> }
> }
>
>
>
> In this code sdp_record_register return with success but the value
> of "rec->handle " is set to zero (0). This is problem for me. I think
> the value should be greater than zero or ideally 1. Because the "
> record" that is passed with service information has set it's handle to
> zero i.e it point to the default service record.
>
> This is causes problem in the upper layer of java implementation . So
> I need to kill the app manually at present. But it seems
> "sdp_record_register" operation is success because the registered
> service can be browsed by external device.
I don't see your problem, but you might really consider to use the D-Bus
based service record registration. You can even use XML based service
record description.
Regards
Marcel
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-04-18 23:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-16 8:59 [Bluez-users] Where does the Bluez stores registered services? Tushar Paturde
2007-04-16 12:41 ` Marcel Holtmann
2007-04-17 4:02 ` Tushar Paturde
2007-04-18 23:45 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox