summaryrefslogtreecommitdiffstats
path: root/test/hstest.c
diff options
context:
space:
mode:
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);