code: function sendCommand(bleObj, cmd, callback)
  {
  	var bleBuffer = new ble.charArray(bufferLength);
  	bleObj.writeData(cmd, cmd.length);
  
  	// wait up to 1 second
  	if (bleObj.dataAvailable(1000))
      {
  		bleObj.readData(bleBuffer, bufferLength);
  		var bleData = "";
  		// read only the number of characters
  		// specified by myGPSSensor.readData
  		for (var x = 0; x < bufferLength; x++)
  		{
  			if (bleBuffer.getitem(x) == '\0')
  				break;
  			else
  				bleData += bleBuffer.getitem(x);
  		}
  		console.log(bleData);
      }
  	else
  		console.log("Timed out waiting for response");
  	if (callback)
  		callback();
  }
docs: simple helper function to send a command and wait for a response