diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-10-29 19:00:56 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-10-29 19:00:56 +0000 |
commit | 52bd6030faf7f3448beadab2b9388e339de08811 (patch) | |
tree | 981d1fd0af4e020669eb6c2efe0d1417ce341426 /hcid | |
parent | 973d77c73f3f110591e0dc8a57f3efe529aadebd (diff) |
Set local name for extended inquiry response
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hcid/main.c b/hcid/main.c index ca123bb0..8183f42c 100644 --- a/hcid/main.c +++ b/hcid/main.c @@ -225,11 +225,29 @@ static void configure_device(int hdev) /* Set device name */ if ((device_opts->flags & (1 << HCID_SET_NAME)) && device_opts->name) { change_local_name_cp cp; + write_ext_inquiry_response_cp ip; + uint8_t len; + memset(cp.name, 0, sizeof(cp.name)); expand_name((char *) cp.name, sizeof(cp.name), device_opts->name, hdev); + ip.fec = 0x00; + memset(ip.data, 0, sizeof(ip.data)); + len = strlen((char *) cp.name); + if (len > 48) { + len = 48; + ip.data[1] = 0x08; + } else + ip.data[1] = 0x09; + ip.data[0] = len + 1; + memcpy(ip.data + 2, cp.name, len); + hci_send_cmd(s, OGF_HOST_CTL, OCF_CHANGE_LOCAL_NAME, CHANGE_LOCAL_NAME_CP_SIZE, &cp); + + if (di.features[6] & LMP_EXT_INQ) + hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_EXT_INQUIRY_RESPONSE, + WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE, &ip); } /* Set device class */ |