       serial.onReceived = @_receiveHandler.bind(this)
       @_serial = serial
       @_path = path
-      @onConnected.dispatchEvent(this)
+      @dispatchEvent({type: "connect"})
       return  # Last PromiseValue
     )
 

  _send: (data) ->
    return Promise.resolve(
    ).then(=>
      return str2ab(data) if typeof(data) == "string"
      return data
    ).then((ab) =>

    return SerialPort.list().then((ports) =>
      devices = []
      for port in ports
        if Preferences.os == "mac" and port.path.startsWith("/dev/tty.")
          continue  # Drop TTY device (for Mac)
        id = (parseInt(port.vendorId) << 16) + parseInt(port.productId)
        devices.push({
          friendlyName: port.manufacturer
          path: port.path
          productId: port.productId
          vendorId: port.vendorId
          hidden: !VID_PID_LIST.includes(id)
        })
      return devices
    )
