diff options
author | Stephen Crane <steve.crane@rococosoft.com> | 2002-08-22 09:19:29 +0000 |
---|---|---|
committer | Stephen Crane <steve.crane@rococosoft.com> | 2002-08-22 09:19:29 +0000 |
commit | 9aa01920bf2e6f3b9b23b44d7c5e48dadc2f8da8 (patch) | |
tree | 83ec99dbb9347084e58b517ea20d4415ae905cd0 /src/hci.c | |
parent | 803bf105508009f7efc87276a539dda244527690 (diff) |
implement hci_{read, write}_class_of_dev()
Diffstat (limited to 'src/hci.c')
-rw-r--r-- | src/hci.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -900,7 +900,7 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) return 0; } -int hci_class_of_dev(int dd, uint8_t *class, int to) +int hci_read_class_of_dev(int dd, uint8_t *cls, int to) { read_class_of_dev_rp rp; struct hci_request rq; @@ -919,10 +919,26 @@ int hci_class_of_dev(int dd, uint8_t *class, int to) return -1; } - memcpy(class, rp.dev_class, 3); + memcpy(cls, rp.dev_class, 3); return 0; } +int hci_write_class_of_dev(int dd, uint32_t cls, int to) +{ + write_class_of_dev_cp cp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + cp.dev_class[0] = cls & 0xff; + cp.dev_class[1] = (cls >> 8) & 0xff; + cp.dev_class[2] = (cls >> 16) & 0xff; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CLASS_OF_DEV; + rq.cparam = &cp; + rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; + return hci_send_req(dd, &rq, 1000); +} + int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) { read_current_iac_lap_rp rp; |