Ported over some Bluetooth functionality