From e329c9ff80a76cb34ff616bce80df0d161731d0b Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 10:04:18 +0000 Subject: hci_write_local_name() --- src/hci.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hci.c b/src/hci.c index 6b60477a..7f2c1745 100644 --- a/src/hci.c +++ b/src/hci.c @@ -755,7 +755,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) return 0; } -int hci_local_name(int dd, int len, char *name, int to) +int hci_read_local_name(int dd, int len, char *name, int to) { read_local_name_rp rp; struct hci_request rq; @@ -779,7 +779,24 @@ int hci_local_name(int dd, int len, char *name, int to) return 0; } -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) +int hci_write_local_name(int dd, char *name, int to) +{ + change_local_name_cp cp; + struct hci_request rq; + + strncpy(cp.name, name, sizeof(cp.name)); + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_CHANGE_LOCAL_NAME; + rq.cparam = &cp; + rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + return 0; +} + +int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; -- cgit