code: function writeSerial(data, callback) {
      if (!txCharacteristic) return;
  
      if (data.length>NORDIC_TX_MAX_LENGTH) {
        console.error("BT> TX length >"+NORDIC_TX_MAX_LENGTH);
        return callback();
      }
      if (txInProgress) {
        console.error("BT> already sending!");
        return callback();
      }
  
      txInProgress = true;
      txCharacteristic.writeValue(Espruino.Core.Utils.stringToArrayBuffer(data)).then(function() {
        txInProgress = false;
        callback();
      }).catch(function(error) {
       console.log('BT> SEND ERROR: ' + error);
       closeSerial();
      });
    }
docs: Throttled serial write