the device model should have a way easily identify if the device is connected, and if not, some kind of emitting limitation or ... something. something easy and obvious, like:
function isEnabled(device) { return device.enabled } // true/false
function msgSend(msg, device) { (isEnabled(device)) { return device.conn.send(msg)} }