diff options
author | Stephen Crane <steve.crane@rococosoft.com> | 2002-08-22 10:04:18 +0000 |
---|---|---|
committer | Stephen Crane <steve.crane@rococosoft.com> | 2002-08-22 10:04:18 +0000 |
commit | e329c9ff80a76cb34ff616bce80df0d161731d0b (patch) | |
tree | f6cf186b8e90de74ca891998effad0178fe8c6c5 | |
parent | 9aa01920bf2e6f3b9b23b44d7c5e48dadc2f8da8 (diff) |
hci_write_local_name()
-rw-r--r-- | include/hci_lib.h | 5 | ||||
-rw-r--r-- | src/hci.c | 21 |
2 files changed, 22 insertions, 4 deletions
diff --git a/include/hci_lib.h b/include/hci_lib.h index ba33be73..4108dc06 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -64,8 +64,9 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(char *str); -int hci_local_name(int dd, int len, char *name, int to); -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_read_local_name(int dd, int len, char *name, int to); +int hci_write_local_name(int dd, char *name, int to); +int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); @@ -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; |