Some serious work on the bluetooth emulator