summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Crane <steve.crane@rococosoft.com>2002-08-22 10:04:18 +0000
committerStephen Crane <steve.crane@rococosoft.com>2002-08-22 10:04:18 +0000
commite329c9ff80a76cb34ff616bce80df0d161731d0b (patch)
treef6cf186b8e90de74ca891998effad0178fe8c6c5 /src
parent9aa01920bf2e6f3b9b23b44d7c5e48dadc2f8da8 (diff)
hci_write_local_name()
Diffstat (limited to 'src')
-rw-r--r--src/hci.c21
1 files changed, 19 insertions, 2 deletions
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;