source/lib/VBListPanel.js
// Establish a new connection with the specified device

Establish a new connection with the specified device
Establish a new connection with the specified device
onConnectClick(e) {
    const ip = validIpAddr(this.connectToIp.value)
    if (ip) {
      const port = validPort(this.connectToPort.value)
      if (port) {
        if (!this.displaySelectedDevice(ip)) {
          VBDiscover.ecp(ip, this.onDiscoveredDevice.bind(this))
        }
        this.connectCallback(ip, port)
        ipcRenderer.send('update-last-connected-device', ip, port.toString())
      }
    }
  }
onConnectClick ( e ) { const ip = validIpAddr ( this . connectToIp . value ) if ( ip ) { const port = validPort ( this . connectToPort . value ) if ( port ) { if ( ! this . displaySelectedDevice ( ip ) ) { VBDiscover . ecp ( ip , this . onDiscoveredDevice . bind ( this ) ) } this . connectCallback ( ip , port ) ipcRenderer . send ( 'update-last-connected-device' , ip , port . toString ( ) ) } } }
Establish a new connection with the specified device
Establish a new connection with the specified device
// Invalid ip address will be returned with ip32 property of zero
 // Invalid port will be returned as zero
 // If the ip address and port are valid, attempt to establish a connection
 // Fill in the selected device details
 // If the IP does not exist in the discovered device table,
 // send off an ECP request to get its details
 // The connect callback executes in the DockPanel's context
 // Send IPC to main process so its config object can be updated
 // to record the last connected device and port
