The createCode function is also useless when the device can't send.