Bluetooth: mgmt: Add support for setting the local name
This patch adds a new set_local_name management command as well as a local_name_changed management event. With these user space can both change the local name as well as monitor changes to it by others. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
committed by
Gustavo F. Padovan
parent
dc4fe30b86
commit
b312b161ec
@@ -193,13 +193,16 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
|
||||
BT_DBG("%s status 0x%x", hdev->name, status);
|
||||
|
||||
if (status)
|
||||
return;
|
||||
|
||||
sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LOCAL_NAME);
|
||||
if (!sent)
|
||||
return;
|
||||
|
||||
if (test_bit(HCI_MGMT, &hdev->flags))
|
||||
mgmt_set_local_name_complete(hdev->id, sent, status);
|
||||
|
||||
if (status)
|
||||
return;
|
||||
|
||||
memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user