Return-Path: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: bdaddr From: Marcel Holtmann In-Reply-To: Date: Sat, 8 Jul 2017 09:54:14 +0200 Cc: linux-bluetooth@vger.kernel.org Message-Id: <16D39FFA-DA31-4996-B848-FF7B1A9356DB@holtmann.org> References: To: Ian Molton Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Ian, > When changing the BDADDR why must I down/up the device after doing so? > is it not possible/sensible to change it whilst remaining up? > > Could it be possible to allow the BDADDR to be written whilst the device > is down, and inject it when it comes up? Would a patch to do this be > acceptable? > > Otherwise, the sequence for programming the BDADDR looks a bit naff; > > hciconfig hci0 up > bdaddr -i hci0 > hciconfig hci0 down > hciconfig hci0 up > > To me, it would make more sense if I could do: > > hciconfig hci0 down > bdaddr -i hci0 > hciconfig hci0 up there is a btmgmt public-addr command that does this correctly if the hdev->set_bdaddr is supported by the hardware. Using the bdaddr tool is a hack. Regards Marcel