* [Bluez-users] adding a sdp service with a 128bit uuid
@ 2005-03-05 1:50 Marco Trudel
2005-03-05 11:21 ` Marcel Holtmann
0 siblings, 1 reply; 9+ messages in thread
From: Marco Trudel @ 2005-03-05 1:50 UTC (permalink / raw)
To: bluez-users
Hello everybody
by reading sdptool.c, I was able to write a little program that promotes my
service. Realising this, 3 questions arised:
1. general:
how to browse the local sdp services?
[sdptool browse dev] seems to be only for remote devices. I now always did
it from another device to see the local seervices. how to [sdptool browse
localhost]?
2. from add_sp(...) in sdptool.c, changing:
# sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
into:
# sdp_uuid128_create(&sp_uuid, a128bitUUID);
gives me (if I do [sdptool browse from the other device]):
# Service Class ID List:
# "Error: This is uuid128" (0x0a333444-5556-6677-7888-9aa99000a1a1)
Actually it works well. But why is it saying "Error: ..."? I noticed that
using the avetana jsr82 implementation (that uses bluez), and creating a
sdp entry with a 128bit uuid, it shows the same error.
3. actually this is more a c then a bluez question, but i'd appreciate if
someone could tell it nevertheless:
# sdp_uuid32_create(uuid_t *uuid, uint32_t data);
# sdp_uuid128_create(uuid_t *uuid, const void *data);
the second function takes the uuid as "const void *data". What is the
appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
that function?
I asked google and he (she?) told me this:
http://www.xgarreau.org/aide/devel/bluetooth/timeserver.c
but it seems a little big for me...
regards
Marco
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-05 1:50 [Bluez-users] adding a sdp service with a 128bit uuid Marco Trudel
@ 2005-03-05 11:21 ` Marcel Holtmann
2005-03-05 13:24 ` Marco Trudel
0 siblings, 1 reply; 9+ messages in thread
From: Marcel Holtmann @ 2005-03-05 11:21 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Marco,
> by reading sdptool.c, I was able to write a little program that promotes my
> service. Realising this, 3 questions arised:
>
> 1. general:
> how to browse the local sdp services?
> [sdptool browse dev] seems to be only for remote devices. I now always did
> it from another device to see the local seervices. how to [sdptool browse
> localhost]?
sdptool browse local
> 2. from add_sp(...) in sdptool.c, changing:
> # sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
> into:
> # sdp_uuid128_create(&sp_uuid, a128bitUUID);
> gives me (if I do [sdptool browse from the other device]):
> # Service Class ID List:
> # "Error: This is uuid128" (0x0a333444-5556-6677-7888-9aa99000a1a1)
> Actually it works well. But why is it saying "Error: ..."? I noticed that
> using the avetana jsr82 implementation (that uses bluez), and creating a
> sdp entry with a 128bit uuid, it shows the same error.
This is because the friend display (without --tree) don't understand
UUID 128 and don't knows how to translate it into a service.
> 3. actually this is more a c then a bluez question, but i'd appreciate if
> someone could tell it nevertheless:
> # sdp_uuid32_create(uuid_t *uuid, uint32_t data);
> # sdp_uuid128_create(uuid_t *uuid, const void *data);
> the second function takes the uuid as "const void *data". What is the
> appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
> that function?
Using "unsigned char uuid[16]" and then casting with "(void *)" worked
for me.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-05 11:21 ` Marcel Holtmann
@ 2005-03-05 13:24 ` Marco Trudel
2005-03-05 13:38 ` Marcel Holtmann
0 siblings, 1 reply; 9+ messages in thread
From: Marco Trudel @ 2005-03-05 13:24 UTC (permalink / raw)
To: bluez-users
Marcel Holtmann wrote:
> Hi Marco,
>
>
>>by reading sdptool.c, I was able to write a little program that promotes my
>>service. Realising this, 3 questions arised:
>>
>>1. general:
>>how to browse the local sdp services?
>>[sdptool browse dev] seems to be only for remote devices. I now always did
>>it from another device to see the local seervices. how to [sdptool browse
>>localhost]?
>
>
> sdptool browse local
nice :-)
maybe something that should/could be mentioned in the manpage or in --help
>>2. from add_sp(...) in sdptool.c, changing:
>> # sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
>>into:
>> # sdp_uuid128_create(&sp_uuid, a128bitUUID);
>>gives me (if I do [sdptool browse from the other device]):
>> # Service Class ID List:
>> # "Error: This is uuid128" (0x0a333444-5556-6677-7888-9aa99000a1a1)
>>Actually it works well. But why is it saying "Error: ..."? I noticed that
>>using the avetana jsr82 implementation (that uses bluez), and creating a
>>sdp entry with a 128bit uuid, it shows the same error.
>
>
> This is because the friend display (without --tree) don't understand
> UUID 128 and don't knows how to translate it into a service.
nice again. this solves my proglem that never existed :-)
maybee another thing to mention in the manpage...
>>3. actually this is more a c then a bluez question, but i'd appreciate if
>>someone could tell it nevertheless:
>> # sdp_uuid32_create(uuid_t *uuid, uint32_t data);
>> # sdp_uuid128_create(uuid_t *uuid, const void *data);
>>the second function takes the uuid as "const void *data". What is the
>>appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
>>that function?
>
>
> Using "unsigned char uuid[16]" and then casting with "(void *)" worked
> for me.
actually, i've a long representation of my uuid. but i'm willing to try!
using 0x233438787A233438787A233438787A23 as long uuid and an ascii table
gives me: "#48xz#48xz#48xz#" for a char representation of the uuid and it
works! :-)
but unfortunately that's an invented uuid to avoid control-chars. my uuid
has values as 0x0F -> that's a SI (left shift) in the ascii table.
so i did:
unsigned char uuid[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 };
and it works as too. is this what you meant?
thanks a lot for the short and precise answers! it's always a pleasure!
regards
Marco
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-05 13:24 ` Marco Trudel
@ 2005-03-05 13:38 ` Marcel Holtmann
2005-03-06 8:11 ` Taneli Vähäkangas
0 siblings, 1 reply; 9+ messages in thread
From: Marcel Holtmann @ 2005-03-05 13:38 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Marco,
> >>how to browse the local sdp services?
> >>[sdptool browse dev] seems to be only for remote devices. I now always did
> >>it from another device to see the local seervices. how to [sdptool browse
> >>localhost]?
> >
> >
> > sdptool browse local
>
> nice :-)
> maybe something that should/could be mentioned in the manpage or in --help
feel free to send in a patch.
> >>from add_sp(...) in sdptool.c, changing:
> >> # sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
> >>into:
> >> # sdp_uuid128_create(&sp_uuid, a128bitUUID);
> >>gives me (if I do [sdptool browse from the other device]):
> >> # Service Class ID List:
> >> # "Error: This is uuid128" (0x0a333444-5556-6677-7888-9aa99000a1a1)
> >>Actually it works well. But why is it saying "Error: ..."? I noticed that
> >>using the avetana jsr82 implementation (that uses bluez), and creating a
> >>sdp entry with a 128bit uuid, it shows the same error.
> >
> >
> > This is because the friend display (without --tree) don't understand
> > UUID 128 and don't knows how to translate it into a service.
>
> nice again. this solves my proglem that never existed :-)
> maybee another thing to mention in the manpage...
Again, any updates of the manual pages are always welcome.
> >>actually this is more a c then a bluez question, but i'd appreciate if
> >>someone could tell it nevertheless:
> >> # sdp_uuid32_create(uuid_t *uuid, uint32_t data);
> >> # sdp_uuid128_create(uuid_t *uuid, const void *data);
> >>the second function takes the uuid as "const void *data". What is the
> >>appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
> >>that function?
> >
> >
> > Using "unsigned char uuid[16]" and then casting with "(void *)" worked
> > for me.
>
> actually, i've a long representation of my uuid. but i'm willing to try!
> using 0x233438787A233438787A233438787A23 as long uuid and an ascii table
> gives me: "#48xz#48xz#48xz#" for a char representation of the uuid and it
> works! :-)
>
> but unfortunately that's an invented uuid to avoid control-chars. my uuid
> has values as 0x0F -> that's a SI (left shift) in the ascii table.
> so i did:
>
> unsigned char uuid[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
> 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 };
>
> and it works as too. is this what you meant?
It is exactly how I create UUID 128 if needed. If you play with long
types then you may ran into compiler or platform problems. The unsigned
character array is supposed to work everywhere.
> thanks a lot for the short and precise answers! it's always a pleasure!
You are welcome.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-05 13:38 ` Marcel Holtmann
@ 2005-03-06 8:11 ` Taneli Vähäkangas
2005-03-06 11:19 ` Marcel Holtmann
0 siblings, 1 reply; 9+ messages in thread
From: Taneli Vähäkangas @ 2005-03-06 8:11 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1: Type: text/plain, Size: 564 bytes --]
On Sat, 2005-03-05 at 14:38 +0100, Marcel Holtmann wrote:
> Hi Marco,
>
> > >>how to browse the local sdp services?
> > >>[sdptool browse dev] seems to be only for remote devices. I now always did
> > >>it from another device to see the local seervices. how to [sdptool browse
> > >>localhost]?
> > >
> > >
> > > sdptool browse local
> >
> > nice :-)
> > maybe something that should/could be mentioned in the manpage or in --help
>
> feel free to send in a patch.
What do you think about this? It adds the "sdptool browse local" to the
examples.
Taneli
[-- Attachment #2: sdptool.1-patch --]
[-- Type: text/x-patch, Size: 396 bytes --]
diff -Nabpur bluez-utils-2.15/tools/sdptool.1 bluez-utils-2.15b/tools/sdptool.1
--- bluez-utils-2.15/tools/sdptool.1 2004-03-31 23:14:52.000000000 +0300
+++ bluez-utils-2.15b/tools/sdptool.1 2005-03-06 10:04:44.000000000 +0200
@@ -99,6 +99,8 @@ Displays help on using sdptool.
.PP
sdptool browse 00:80:98:24:15:6D
.PP
+sdptool browse local
+.PP
sdptool add DUN
.PP
sdptool del LAN
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-06 8:11 ` Taneli Vähäkangas
@ 2005-03-06 11:19 ` Marcel Holtmann
0 siblings, 0 replies; 9+ messages in thread
From: Marcel Holtmann @ 2005-03-06 11:19 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Taneli,
> > > >>how to browse the local sdp services?
> > > >>[sdptool browse dev] seems to be only for remote devices. I now always did
> > > >>it from another device to see the local seervices. how to [sdptool browse
> > > >>localhost]?
> > > >
> > > >
> > > > sdptool browse local
> > >
> > > nice :-)
> > > maybe something that should/could be mentioned in the manpage or in --help
> >
> > feel free to send in a patch.
>
> What do you think about this? It adds the "sdptool browse local" to the
> examples.
applied. Thanks.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-users] adding a sdp service with a 128bit uuid
@ 2005-03-08 12:35 Ka Kin Cheung
2005-03-08 13:03 ` Marco Trudel
2005-03-08 13:39 ` Xavier Garreau
0 siblings, 2 replies; 9+ messages in thread
From: Ka Kin Cheung @ 2005-03-08 12:35 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]
Hi Marco!
Can you send the program you wrote to me for reference? Or can you tell briefly the algorithm about the program you wrote about adding a service profile, especially for which functions in sdptool.c are nneded? Thank you very much.
Michael
Marco Trudel <mtrudel@gmx.ch> wrote:
Hello everybody
by reading sdptool.c, I was able to write a little program that promotes my
service. Realising this, 3 questions arised:
1. general:
how to browse the local sdp services?
[sdptool browse dev] seems to be only for remote devices. I now always did
it from another device to see the local seervices. how to [sdptool browse
localhost]?
2. from add_sp(...) in sdptool.c, changing:
# sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
into:
# sdp_uuid128_create(&sp_uuid, a128bitUUID);
gives me (if I do [sdptool browse from the other device]):
# Service Class ID List:
# "Error: This is uuid128" (0x0a333444-5556-6677-7888-9aa99000a1a1)
Actually it works well. But why is it saying "Error: ..."? I noticed that
using the avetana jsr82 implementation (that uses bluez), and creating a
sdp entry with a 128bit uuid, it shows the same error.
3. actually this is more a c then a bluez question, but i'd appreciate if
someone could tell it nevertheless:
# sdp_uuid32_create(uuid_t *uuid, uint32_t data);
# sdp_uuid128_create(uuid_t *uuid, const void *data);
the second function takes the uuid as "const void *data". What is the
appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
that function?
I asked google and he (she?) told me this:
http://www.xgarreau.org/aide/devel/bluetooth/timeserver.c
but it seems a little big for me...
regards
Marco
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
Yahoo! 工具列 - 內置防止彈出視窗工能!
[-- Attachment #2: Type: text/html, Size: 2601 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-08 12:35 Ka Kin Cheung
@ 2005-03-08 13:03 ` Marco Trudel
2005-03-08 13:39 ` Xavier Garreau
1 sibling, 0 replies; 9+ messages in thread
From: Marco Trudel @ 2005-03-08 13:03 UTC (permalink / raw)
To: bluez-users
Hallo Michael
just read the sdptool.c... it's all there. basically you need
add_sp(sdp_session_t *session, svc_info_t *si)
respectively you told once something about headset, i think... there is a
method like add_headset()...
regards
Marco
Ka Kin Cheung wrote:
> Hi Marco!
> Can you send the program you wrote to me for reference? Or can you
> tell briefly the algorithm about the program you wrote about adding a
> service profile, especially for which functions in sdptool.c are nneded?
> Thank you very much.
> Michael
>
> */Marco Trudel <mtrudel@gmx.ch>/* wrote:
>
> Hello everybody
>
> by reading sdptool.c, I was able to write a little program that
> promotes my
> service. Realising this, 3 questions arised:
>
> 1. general:
> how to browse the local sdp services?
> [sdptool browse dev] seems to be only for remote devices. I now
> always did
> it from another device to see the local seervices. how to [sdptool
> browse
> localhost]?
>
> 2. from add_sp(...) in sdptool.c, changing:
> # sdp_uuid16_create(&sp_uuid, SERIAL_PORT_SVCLASS_ID);
> into:
> # sdp_uuid128_create(&sp_uuid, a128bitUUID);
> gives me (if I do [sdptool browse from the other device]):
> # Service Class ID List:
> # "Error: This is uuid128" (0x0a333444-5556-6677-7888-9aa99000a1a1)
> Actually it works well. But why is it saying "Error: ..."? I noticed
> that
> using the avetana jsr82 implementation (that uses bluez), and
> creating a
> sdp entry with a 128bit uuid, it shows the same error.
>
> 3. actually this is more a c then a bluez question, but i'd
> appreciate if
> someone could tell it nevertheless:
> # sdp_uuid32_create(uuid_t *uuid, uint32_t data);
> # sdp_uuid128_create(uuid_t *uuid, const void *data);
> the second function takes the uuid as "const void *data". What is the
> appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
> that function?
> I asked google and he (she?) told me this:
> http://www.xgarreau.org/aide/devel/bluetooth/timeserver.c
> but it seems a little big for me...
>
>
> regards
> Marco
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
>
> ------------------------------------------------------------------------
> Yahoo! 工具列 - 內置防止彈出視窗工能 <http://hk.toolbar.yahoo.com>!
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bluez-users] adding a sdp service with a 128bit uuid
2005-03-08 12:35 Ka Kin Cheung
2005-03-08 13:03 ` Marco Trudel
@ 2005-03-08 13:39 ` Xavier Garreau
1 sibling, 0 replies; 9+ messages in thread
From: Xavier Garreau @ 2005-03-08 13:39 UTC (permalink / raw)
To: bluez-users
> 3. actually this is more a c then a bluez question, but i'd
> appreciate if
> someone could tell it nevertheless:
> # sdp_uuid32_create(uuid_t *uuid, uint32_t data);
> # sdp_uuid128_create(uuid_t *uuid, const void *data);
> the second function takes the uuid as "const void *data". What is the
> appropriate way to give a uuid like 2c3ef0c843674369b1dfb7315e76332a to
> that function?
> I asked google and he (she?) told me this:
> http://www.xgarreau.org/aide/devel/bluetooth/timeserver.c
> but it seems a little big for me...
Whaou, nice, i love google :)
Actually i wrote this sample for a presentation in a university. It's
not production quality code.
But to give data as void* you can do something like this:
unsigned char uuid_data[16] = {0x2c, 0x3e, 0xf0, 0xc8, 0x43, 0x67, 0x43,
0x69, 0xb1, 0xdf, 0xb7, 0x31, 0x5e, 0x76, 0x33, 0x2a};
...
sdp_uuid128_create (&uuid, (void*)uuid_data);
Actually, in the code you mentionned i used the create_base_uuid
function from a bluez source ... But i don't remember from what file it
was ...
Regards,
Xavier
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-03-08 13:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-05 1:50 [Bluez-users] adding a sdp service with a 128bit uuid Marco Trudel
2005-03-05 11:21 ` Marcel Holtmann
2005-03-05 13:24 ` Marco Trudel
2005-03-05 13:38 ` Marcel Holtmann
2005-03-06 8:11 ` Taneli Vähäkangas
2005-03-06 11:19 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2005-03-08 12:35 Ka Kin Cheung
2005-03-08 13:03 ` Marco Trudel
2005-03-08 13:39 ` Xavier Garreau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.