mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-27 06:04:32 +08:00
btdev: Add support for setting bdaddr
This adds btdev_set_bdaddr so it is possible to set an arbritrary address.
This commit is contained in:
parent
3da439ae3c
commit
c94cdbc6d7
@ -6960,6 +6960,16 @@ const uint8_t *btdev_get_bdaddr(struct btdev *btdev)
|
||||
return btdev->bdaddr;
|
||||
}
|
||||
|
||||
bool btdev_set_bdaddr(struct btdev *btdev, const uint8_t *bdaddr)
|
||||
{
|
||||
if (!btdev || !bdaddr)
|
||||
return false;
|
||||
|
||||
memcpy(btdev->bdaddr, bdaddr, sizeof(btdev->bdaddr));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t *btdev_get_features(struct btdev *btdev)
|
||||
{
|
||||
return btdev->features;
|
||||
|
@ -72,6 +72,8 @@ bool btdev_set_debug(struct btdev *btdev, btdev_debug_func_t callback,
|
||||
void *user_data, btdev_destroy_func_t destroy);
|
||||
|
||||
const uint8_t *btdev_get_bdaddr(struct btdev *btdev);
|
||||
bool btdev_set_bdaddr(struct btdev *btdev, const uint8_t *bdaddr);
|
||||
|
||||
uint8_t *btdev_get_features(struct btdev *btdev);
|
||||
|
||||
uint8_t btdev_get_scan_enable(struct btdev *btdev);
|
||||
|
Loading…
Reference in New Issue
Block a user