summaryrefslogtreecommitdiffstats
path: root/test/hstest.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-08-30 16:04:41 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-08-30 16:04:41 +0000
commit67f9a013ade0649d032b9b25e694567a089237d1 (patch)
tree62a3f170a343d17845a0baa9d70ffcc193e5f43d /test/hstest.c
parent2525689e0e1de1da8fff4cd4b0ea5aadc0fca630 (diff)
Fragment SCO payload that is greater than the SCO MTU
Diffstat (limited to 'test/hstest.c')
-rw-r--r--test/hstest.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/hstest.c b/test/hstest.c
index 1272cd01..98428b68 100644
--- a/test/hstest.c
+++ b/test/hstest.c
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
fd_set rfds;
struct timeval timeout;
- unsigned char buf[2048];
+ unsigned char buf[2048], *p;
int maxfd, sel, rlen, wlen;
bdaddr_t local;
@@ -274,7 +274,15 @@ int main(int argc, char *argv[])
switch (mode) {
case PLAY:
rlen = read(fd, buf, rlen);
- wlen = write(sd, buf, rlen);
+
+ wlen = 0;
+ p = buf;
+ while (rlen > sco_mtu) {
+ wlen += write(sd, p, sco_mtu);
+ rlen -= sco_mtu;
+ p += sco_mtu;
+ }
+ wlen += write(sd, p, rlen);
break;
case RECORD:
wlen = write(fd, buf, rlen);