2008-08-15 13:42:23

by Jui-Hao Chiang

[permalink] [raw]
Subject: [Bluez-devel] How to know the packet loss ratio of SCO socket

Hi, all:
as the title said, I am writing a simple server-client socket program for SCO
connection. While client is sending the SCO packet to server, it attaches a
sequence number to it. Then I want server to estimate the packet loss.
[Client program is as the following]
for (i = 0; i < 48, i++) buf[i] = 0x7f;
while (1) {
*(uint32_t *)buf = htobl(seq);
*(uint32_t *)(buf+4) = htobs(48);
if (send(sockfd, buf, 48, 0) < 0) break;
seq++;
usleep(1)
}

However, on the server side, the data is total different, and I am not able to
get the sequence number (the hcidump -x also shows different data content as I
expect. Also, it's weird that the content is repeated)

Is this data encoded? or is there anyway to know the packet loss ratio of the
SCO connection?

Bests,
Jui-Hao


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2008-08-15 17:26:39

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] How to know the packet loss ratio of SCO socket

Hi Jui-Hao,

> as the title said, I am writing a simple server-client socket
> program for SCO
> connection. While client is sending the SCO packet to server, it
> attaches a
> sequence number to it. Then I want server to estimate the packet loss.
> [Client program is as the following]
> for (i = 0; i < 48, i++) buf[i] = 0x7f;
> while (1) {
> *(uint32_t *)buf = htobl(seq);
> *(uint32_t *)(buf+4) = htobs(48);
> if (send(sockfd, buf, 48, 0) < 0) break;
> seq++;
> usleep(1)
> }
>
> However, on the server side, the data is total different, and I am
> not able to
> get the sequence number (the hcidump -x also shows different data
> content as I
> expect. Also, it's weird that the content is repeated)
>
> Is this data encoded? or is there anyway to know the packet loss
> ratio of the
> SCO connection?

SCO are voice connections and they are CVSD encoded. It is not a
reliable data transport. Use L2CAP or RFCOMM for that.

Regards

Marcel



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel