From 7490b6c61bfa0b581ff7a15f6482787973cf7e3f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 21 Dec 2002 15:40:33 +0000 Subject: Add Headset Test utility --- test/hstest.c | 333 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 test/hstest.c (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c new file mode 100644 index 00000000..867eb20b --- /dev/null +++ b/test/hstest.c @@ -0,0 +1,333 @@ +/* + * + * Bluetooth Headset Test utility + * + * Copyright (C) 2002 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +#ifndef OCF_READ_VOICE_SETTING +#define OCF_READ_VOICE_SETTING 0x0025 +typedef struct { + uint8_t status; + uint16_t voice_setting; +} __attribute__ ((packed)) read_voice_setting_rp; +#define READ_VOICE_SETTING_RP_SIZE 3 + +static int hci_read_voice_setting(int dd, uint16_t *vs, int to) +{ + read_voice_setting_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_VOICE_SETTING; + rq.rparam = &rp; + rq.rlen = READ_VOICE_SETTING_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *vs = rp.voice_setting; + return 0; +} +#endif + + +static volatile int terminate = 0; + + +static void sig_term(int sig) { + terminate = 1; +} + + +static int rfcomm_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t channel) +{ + struct sockaddr_rc addr; + int s; + + if ((s = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) { + return -1; + } + + memset(&addr, 0, sizeof(addr)); + addr.rc_family = AF_BLUETOOTH; + bacpy(&addr.rc_bdaddr, src); + addr.rc_channel = 0; + if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + close(s); + return -1; + } + + memset(&addr, 0, sizeof(addr)); + addr.rc_family = AF_BLUETOOTH; + bacpy(&addr.rc_bdaddr, dst); + addr.rc_channel = channel; + if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){ + close(s); + return -1; + } + + return s; +} + + +static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t *mtu) +{ + struct sockaddr_sco addr; + struct sco_conninfo conn; + struct sco_options opts; + int s, size; + + if ((s = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_SCO)) < 0) { + return -1; + } + + memset(&addr, 0, sizeof(addr)); + addr.sco_family = AF_BLUETOOTH; + bacpy(&addr.sco_bdaddr, src); + if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + close(s); + return -1; + } + + memset(&addr, 0, sizeof(addr)); + addr.sco_family = AF_BLUETOOTH; + bacpy(&addr.sco_bdaddr, dst); + if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){ + close(s); + return -1; + } + + size = sizeof(conn); + if (getsockopt(s, SOL_SCO, SCO_CONNINFO, &conn, &size) < 0) { + close(s); + return -1; + } + + size = sizeof(opts); + if (getsockopt(s, SOL_SCO, SCO_OPTIONS, &opts, &size) < 0) { + close(s); + return -1; + } + + if (handle) + *handle = conn.hci_handle; + + if (mtu) + *mtu = opts.mtu; + + return s; +} + + +static void usage(void) +{ + printf("Usage:\n" + "\thstest play [channel]\n" + "\thstest record [channel]\n"); +} + + +#define PLAY 1 +#define RECORD 2 + +int main(int argc, char *argv[]) +{ + struct sigaction sa; + + fd_set rfds; + struct timeval timeout; + unsigned char buf[2048]; + int maxfd, sel, rlen, wlen; + + bdaddr_t local; + bdaddr_t bdaddr; + uint8_t channel; + + char *filename; + mode_t filemode; + int mode = 0; + int dd, rd, sd, fd; + uint16_t sco_handle, sco_mtu, vs; + + + switch (argc) { + case 4: + str2ba(argv[3], &bdaddr); + channel = 6; + break; + case 5: + str2ba(argv[3], &bdaddr); + channel = atoi(argv[4]); + break; + default: + usage(); + exit(-1); + } + + if (strncmp(argv[1], "play", 4) == 0) { + mode = PLAY; + filemode = O_RDONLY; + } else if (strncmp(argv[1], "rec", 3) == 0) { + mode = RECORD; + filemode = O_WRONLY | O_CREAT | O_TRUNC; + } else { + usage(); + exit(-1); + } + + filename = argv[2]; + + + hci_devba(0, &local); + dd = hci_open_dev(0); + hci_read_voice_setting(dd, &vs, 1000); + fprintf(stderr, "Voice setting: 0x%04x\n", vs); + close(dd); + if (vs != 0x0040) { + fprintf(stderr, "The voice setting must be 0x0040\n"); + return -1; + } + + + if (strcmp(filename, "-") == 0) { + switch (mode) { + case PLAY: + fd = 0; + break; + case RECORD: + fd = 1; + break; + default: + return -1; + } + } else { + if ((fd = open(filename, filemode)) < 0) { + perror("Can't open input/output file"); + return -1; + } + } + + + memset(&sa, 0, sizeof(sa)); + sa.sa_flags = SA_NOCLDSTOP; + sa.sa_handler = sig_term; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); + + sa.sa_handler = SIG_IGN; + sigaction(SIGCHLD, &sa, NULL); + sigaction(SIGPIPE, &sa, NULL); + + + if ((rd = rfcomm_connect(&local, &bdaddr, channel)) < 0) { + perror("Can't connect RFCOMM channel"); + return -1; + } + + fprintf(stderr, "RFCOMM channel connected\n"); + + + if ((sd = sco_connect(&local, &bdaddr, &sco_handle, &sco_mtu)) < 0) { + perror("Can't connect SCO audio channel"); + close(rd); + return -1; + } + + fprintf(stderr, "SCO audio channel connected (handle %d, mtu %d)\n", sco_handle, sco_mtu); + + + if (mode == RECORD) + write(rd, "RING\r\n", 6); + + maxfd = (rd > sd) ? rd : sd; + + while (!terminate) { + + FD_ZERO(&rfds); + FD_SET(rd, &rfds); + FD_SET(sd, &rfds); + + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + + if ((sel = select(maxfd + 1, &rfds, NULL, NULL, &timeout)) > 0) { + + if (FD_ISSET(rd, &rfds)) { + memset(buf, 0, sizeof(buf)); + rlen = read(rd, buf, sizeof(buf)); + if (rlen > 0) { + fprintf(stderr, "%s\n", buf); + wlen = write(rd, "OK\r\n", 4); + } + } + + if (FD_ISSET(sd, &rfds)) { + memset(buf, 0, sizeof(buf)); + rlen = read(sd, buf, sizeof(buf)); + if (rlen > 0) + switch (mode) { + case PLAY: + rlen = read(fd, buf, rlen); + wlen = write(sd, buf, rlen); + break; + case RECORD: + wlen = write(fd, buf, rlen); + break; + default: + break; + } + } + + } + + } + + close(sd); + sleep(5); + close(rd); + + close(fd); + + return 0; +} -- cgit From 499f43343f20d5a562ee041d950086df01fb4868 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Mar 2003 09:54:01 +0000 Subject: Remove the voice setting command and fix a big endian problem --- test/hstest.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index 867eb20b..8b47a10a 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -39,42 +39,8 @@ #include -#ifndef OCF_READ_VOICE_SETTING -#define OCF_READ_VOICE_SETTING 0x0025 -typedef struct { - uint8_t status; - uint16_t voice_setting; -} __attribute__ ((packed)) read_voice_setting_rp; -#define READ_VOICE_SETTING_RP_SIZE 3 - -static int hci_read_voice_setting(int dd, uint16_t *vs, int to) -{ - read_voice_setting_rp rp; - struct hci_request rq; - - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_READ_VOICE_SETTING; - rq.rparam = &rp; - rq.rlen = READ_VOICE_SETTING_RP_SIZE; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (rp.status) { - errno = EIO; - return -1; - } - - *vs = rp.voice_setting; - return 0; -} -#endif - - static volatile int terminate = 0; - static void sig_term(int sig) { terminate = 1; } @@ -110,7 +76,6 @@ static int rfcomm_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t channel) return s; } - static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t *mtu) { struct sockaddr_sco addr; @@ -167,7 +132,6 @@ static void usage(void) "\thstest record [channel]\n"); } - #define PLAY 1 #define RECORD 2 @@ -222,6 +186,7 @@ int main(int argc, char *argv[]) hci_devba(0, &local); dd = hci_open_dev(0); hci_read_voice_setting(dd, &vs, 1000); + vs = htobs(vs); fprintf(stderr, "Voice setting: 0x%04x\n", vs); close(dd); if (vs != 0x0040) { -- cgit From 693d345b0cc02c961748aad2074a2ca64934c9f5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Oct 2003 15:18:55 +0000 Subject: Let the headset test tools use 16 bit PCM for input and output --- test/hstest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index 8b47a10a..23bbf089 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -189,8 +189,8 @@ int main(int argc, char *argv[]) vs = htobs(vs); fprintf(stderr, "Voice setting: 0x%04x\n", vs); close(dd); - if (vs != 0x0040) { - fprintf(stderr, "The voice setting must be 0x0040\n"); + if (vs != 0x0060) { + fprintf(stderr, "The voice setting must be 0x0060\n"); return -1; } -- cgit From b8707600fd45e0cda31654fc7b2932f29b28d1a1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 28 Apr 2004 12:44:32 +0000 Subject: Unify copyright and license information --- test/hstest.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index 23bbf089..1272cd01 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -1,25 +1,35 @@ /* * - * Bluetooth Headset Test utility + * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002 Marcel Holtmann + * Copyright (C) 2002-2004 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. * + * + * $Id$ */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -38,14 +48,12 @@ #include #include - static volatile int terminate = 0; static void sig_term(int sig) { terminate = 1; } - static int rfcomm_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t channel) { struct sockaddr_rc addr; @@ -124,7 +132,6 @@ static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t return s; } - static void usage(void) { printf("Usage:\n" @@ -154,7 +161,6 @@ int main(int argc, char *argv[]) int dd, rd, sd, fd; uint16_t sco_handle, sco_mtu, vs; - switch (argc) { case 4: str2ba(argv[3], &bdaddr); @@ -182,7 +188,6 @@ int main(int argc, char *argv[]) filename = argv[2]; - hci_devba(0, &local); dd = hci_open_dev(0); hci_read_voice_setting(dd, &vs, 1000); @@ -194,7 +199,6 @@ int main(int argc, char *argv[]) return -1; } - if (strcmp(filename, "-") == 0) { switch (mode) { case PLAY: @@ -213,7 +217,6 @@ int main(int argc, char *argv[]) } } - memset(&sa, 0, sizeof(sa)); sa.sa_flags = SA_NOCLDSTOP; sa.sa_handler = sig_term; @@ -224,7 +227,6 @@ int main(int argc, char *argv[]) sigaction(SIGCHLD, &sa, NULL); sigaction(SIGPIPE, &sa, NULL); - if ((rd = rfcomm_connect(&local, &bdaddr, channel)) < 0) { perror("Can't connect RFCOMM channel"); return -1; @@ -232,7 +234,6 @@ int main(int argc, char *argv[]) fprintf(stderr, "RFCOMM channel connected\n"); - if ((sd = sco_connect(&local, &bdaddr, &sco_handle, &sco_mtu)) < 0) { perror("Can't connect SCO audio channel"); close(rd); @@ -240,7 +241,6 @@ int main(int argc, char *argv[]) } fprintf(stderr, "SCO audio channel connected (handle %d, mtu %d)\n", sco_handle, sco_mtu); - if (mode == RECORD) write(rd, "RING\r\n", 6); -- cgit From 67f9a013ade0649d032b9b25e694567a089237d1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 30 Aug 2004 16:04:41 +0000 Subject: Fragment SCO payload that is greater than the SCO MTU --- test/hstest.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test/hstest.c') 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); -- cgit From bbda499067067aefc8e642a2784d247ac0331eae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:43:16 +0000 Subject: Add memset() to different places to initialize the structures --- test/hstest.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index 98428b68..f269621c 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -98,6 +98,7 @@ static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t memset(&addr, 0, sizeof(addr)); addr.sco_family = AF_BLUETOOTH; bacpy(&addr.sco_bdaddr, src); + if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { close(s); return -1; @@ -106,18 +107,23 @@ static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t memset(&addr, 0, sizeof(addr)); addr.sco_family = AF_BLUETOOTH; bacpy(&addr.sco_bdaddr, dst); + if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){ close(s); return -1; } + memset(&conn, 0, sizeof(conn)); size = sizeof(conn); + if (getsockopt(s, SOL_SCO, SCO_CONNINFO, &conn, &size) < 0) { close(s); return -1; } + memset(&opts, 0, sizeof(opts)); size = sizeof(opts); + if (getsockopt(s, SOL_SCO, SCO_OPTIONS, &opts, &size) < 0) { close(s); return -1; -- cgit From 1f422e5f2b343d35a8c77ce4be16f74b2819b2bf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Jul 2005 21:15:41 +0000 Subject: Fix some GCC 4.0 warnings --- test/hstest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index f269621c..8949be4b 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -89,7 +89,8 @@ static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t struct sockaddr_sco addr; struct sco_conninfo conn; struct sco_options opts; - int s, size; + socklen_t size; + int s; if ((s = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_SCO)) < 0) { return -1; -- cgit From 632a9432774ff3a0c6e556e8f32a565b38890767 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Oct 2005 22:36:31 +0000 Subject: Big cleanup of CVS relics --- test/hstest.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index 8949be4b..bea4d3a4 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -2,28 +2,23 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * - * $Id$ */ #ifdef HAVE_CONFIG_H -- cgit From f2e48c44a7e4c9ee31b8ce2e302186f6047cfeab Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jan 2006 13:28:56 +0000 Subject: Update copyright information --- test/hstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index bea4d3a4..cda9101c 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify -- cgit From b102348e988e4abc5d579ce13c067ce2c885aaf7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 26 Jul 2006 13:32:44 +0000 Subject: Fix declared with attribute warn_unused_result errors --- test/hstest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index cda9101c..d94ade20 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) char *filename; mode_t filemode; - int mode = 0; + int err, mode = 0; int dd, rd, sd, fd; uint16_t sco_handle, sco_mtu, vs; @@ -245,7 +245,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "SCO audio channel connected (handle %d, mtu %d)\n", sco_handle, sco_mtu); if (mode == RECORD) - write(rd, "RING\r\n", 6); + err = write(rd, "RING\r\n", 6); maxfd = (rd > sd) ? rd : sd; -- cgit From 607695ed109340f4b7a5628420e0a8e8aee34f4e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Jan 2007 17:48:12 +0000 Subject: Update copyright information --- test/hstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index d94ade20..2a6ae593 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify -- cgit From e823c15e43a6f924779e466d434c51157002d9ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:37:05 +0000 Subject: Update copyright information --- test/hstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/hstest.c') diff --git a/test/hstest.c b/test/hstest.c index 2a6ae593..158bf204 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify -- cgit