diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2003-03-31 09:54:01 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2003-03-31 09:54:01 +0000 |
commit | 499f43343f20d5a562ee041d950086df01fb4868 (patch) | |
tree | ad55c4dceaa29f024ca2781e6da892dd4dc4c0b9 /test/hstest.c | |
parent | 17990fc4315e60ba6a3ffd59ea8781f2c1647cfc (diff) |
Remove the voice setting command and fix a big endian problem
Diffstat (limited to 'test/hstest.c')
-rw-r--r-- | test/hstest.c | 37 |
1 files changed, 1 insertions, 36 deletions
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 <bluetooth/rfcomm.h> -#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 <file> <bdaddr> [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) { |