* [Bluez-devel] btohs,btohl, ...
@ 2005-02-09 13:07 # Björn Specht #
2005-02-09 13:19 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: # Björn Specht # @ 2005-02-09 13:07 UTC (permalink / raw)
To: bluez-devel@lists.sourceforge.net
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
Hi all,
I implemented a client server over bluetooth and I was wondering if I need the Little Endian, Big Endien conversion functions btohs,btohl,htobs,htobl?
Do I need to convert every single byte? which is received or sent over my sock_stream socket?
If yes, should it look like this for the receiving case: btohs(buf[0]).... an so on for every byte?
Thanks in advance
Björn
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] btohs,btohl, ...
2005-02-09 13:07 [Bluez-devel] btohs,btohl, # Björn Specht #
@ 2005-02-09 13:19 ` Marcel Holtmann
2005-02-09 13:38 ` # Björn Specht #
0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2005-02-09 13:19 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Bjoern,
if you sign emails that go to a mailing list. Make sure that your key is
available on a public keyserver. Yours is not.
> I implemented a client server over bluetooth and I was wondering if I need the Little Endian, Big Endien conversion functions btohs,btohl,htobs,htobl?
if both sides are of the same endianess then not, but it is a good
programming style to always use them.
> Do I need to convert every single byte? which is received or sent over my sock_stream socket?
> If yes, should it look like this for the receiving case: btohs(buf[0]).... an so on for every byte?
For what do you wanna swap a byte and with what? There is nothing to
swap. Think about it ;)
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-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] btohs,btohl, ...
2005-02-09 13:19 ` Marcel Holtmann
@ 2005-02-09 13:38 ` # Björn Specht #
2005-02-09 13:57 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: # Björn Specht # @ 2005-02-09 13:38 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
sorry for my signing. I read that sometimes a different order is used withi=
n a byte as well and not only between bytes.=20
Okay that makes it easier.
But if this is not the case:
When I send a 32bit integer for example, do I have to worry about the order=
of the bytes when I send or receive them?=20
Bj=F6rn
On Wed, 09 Feb 2005 14:19:31 +0100
Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Bjoern,
>=20
> if you sign emails that go to a mailing list. Make sure that your key is
> available on a public keyserver. Yours is not.
>=20
> > I implemented a client server over bluetooth and I was wondering if I n=
eed the Little Endian, Big Endien conversion functions btohs,btohl,htobs,ht=
obl?
>=20
> if both sides are of the same endianess then not, but it is a good
> programming style to always use them.
>=20
> > Do I need to convert every single byte? which is received or sent over =
my sock_stream socket?
> > If yes, should it look like this for the receiving case: btohs(buf[0]).=
... an so on for every byte?
>=20
> For what do you wanna swap a byte and with what? There is nothing to
> swap. Think about it ;)
>=20
> Regards
>=20
> Marcel
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> 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=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>=20
-------------------------------------------------------
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-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] btohs,btohl, ...
2005-02-09 13:38 ` # Björn Specht #
@ 2005-02-09 13:57 ` Marcel Holtmann
2005-02-09 14:00 ` # Björn Specht #
2005-02-09 15:07 ` [Bluez-devel] omtu, imtu # Björn Specht #
0 siblings, 2 replies; 7+ messages in thread
From: Marcel Holtmann @ 2005-02-09 13:57 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Bjoern,
> sorry for my signing. I read that sometimes a different order is used within a byte as well and not only between bytes.
I don't know of any architecture that stores the bits of its bytes in a
different order and where this is visible to for the user. However such
a platform might exists.
> Okay that makes it easier.
You mean big endian communicates with little endian or vice versa?
> But if this is not the case:
> When I send a 32bit integer for example, do I have to worry about the order of the bytes when I send or receive them?
If you have a byte stream (a character array) then you don't need to
worry, because they are stored in a endianless format (bytewise). If you
use datatypes like uint16_t and uint32_t and send them to the stream or
copy them into an array then you should convert them to the same endian
encoding.
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-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] btohs,btohl, ...
2005-02-09 13:57 ` Marcel Holtmann
@ 2005-02-09 14:00 ` # Björn Specht #
2005-02-09 15:07 ` [Bluez-devel] omtu, imtu # Björn Specht #
1 sibling, 0 replies; 7+ messages in thread
From: # Björn Specht # @ 2005-02-09 14:00 UTC (permalink / raw)
To: bluez-devel
Thanks Marcel,
You're the man!
Bj=F6rn
On Wed, 09 Feb 2005 14:57:10 +0100
Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Bjoern,
>=20
> > sorry for my signing. I read that sometimes a different order is used w=
ithin a byte as well and not only between bytes.=20
>=20
> I don't know of any architecture that stores the bits of its bytes in a
> different order and where this is visible to for the user. However such
> a platform might exists.
>=20
> > Okay that makes it easier.
>=20
> You mean big endian communicates with little endian or vice versa?
>=20
> > But if this is not the case:
> > When I send a 32bit integer for example, do I have to worry about the o=
rder of the bytes when I send or receive them?=20
>=20
> If you have a byte stream (a character array) then you don't need to
> worry, because they are stored in a endianless format (bytewise). If you
> use datatypes like uint16_t and uint32_t and send them to the stream or
> copy them into an array then you should convert them to the same endian
> encoding.
>=20
> Regards
>=20
> Marcel
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> 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=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>=20
-------------------------------------------------------
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-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] omtu, imtu
2005-02-09 13:57 ` Marcel Holtmann
2005-02-09 14:00 ` # Björn Specht #
@ 2005-02-09 15:07 ` # Björn Specht #
2005-02-09 15:18 ` Marcel Holtmann
1 sibling, 1 reply; 7+ messages in thread
From: # Björn Specht # @ 2005-02-09 15:07 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
can you also tell me what omtu and imtu are for? I know the Maximum Transfe=
r Unit, but what exactly do these 2? I have set them to 672 and 0 like in t=
he rctest.c file.
Is 672 the maximum? It would just be nice to know the maximum data per fram=
e, for a good header to data proportion.
Thanks again=20
Bj=F6rn
-------------------------------------------------------
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-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-devel] omtu, imtu
2005-02-09 15:07 ` [Bluez-devel] omtu, imtu # Björn Specht #
@ 2005-02-09 15:18 ` Marcel Holtmann
0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2005-02-09 15:18 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Bjoern,
> can you also tell me what omtu and imtu are for? I know the Maximum Transfer Unit, but what exactly do these 2? I have set them to 672 and 0 like in the rctest.c file.
what about reading the L2CAP part of the Bluetooth specification. It is
all there, but in short (i)ncoming MTU and (o)utgoing MTU.
> Is 672 the maximum? It would just be nice to know the maximum data per frame, for a good header to data proportion.
The maximal value is 65535. The header/payload is not important for the
throughput. Only matching it to the baseband packet types helps.
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-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-02-09 15:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-09 13:07 [Bluez-devel] btohs,btohl, # Björn Specht #
2005-02-09 13:19 ` Marcel Holtmann
2005-02-09 13:38 ` # Björn Specht #
2005-02-09 13:57 ` Marcel Holtmann
2005-02-09 14:00 ` # Björn Specht #
2005-02-09 15:07 ` [Bluez-devel] omtu, imtu # Björn Specht #
2005-02-09 15:18 ` Marcel Holtmann
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.