From c608311e7472325514f0578a20d59efc86792e39 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 11 Feb 2005 04:17:16 +0000 Subject: Add function for getting the remote name with a clock offset --- include/hci_lib.h | 1 + src/hci.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 1e5ecc96..e2f06fda 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,6 +69,7 @@ int hci_devid(const char *str); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, 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_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); diff --git a/src/hci.c b/src/hci.c index 088574f1..37715613 100644 --- a/src/hci.c +++ b/src/hci.c @@ -898,7 +898,7 @@ int hci_write_local_name(int dd, const char *name, int to) return 0; } -int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; @@ -907,6 +907,7 @@ int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, in memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, bdaddr); cp.pscan_rep_mode = 0x02; + cp.clock_offset = clkoffset; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; @@ -930,6 +931,11 @@ int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, in return 0; } +int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) +{ + return hci_read_remote_name_with_clock_offset(dd, bdaddr, 0x0000, len, name, to); +} + int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) { evt_read_remote_features_complete rp; -- cgit