I am using tcpclient function just like below:
TCPport=tcpclient('192.168.1.1', 8080,'ConnectTimeout',2)
But when I have two WI-FI interfaces with two hosts having the same IP (192.168.1.1) it often doesn't work. I presume that it is because the tcpclient function may try to use the wrong interface. Is there a way to tell Matlab which interface to use? below I paste what I get when I ask windows to show what networks I have
[~,~,wifi]=evalc('system([''netsh wlan show networks''])');
wifi =
' Interface name : Wireless Network Connection There are 7 networks currently visible. SSID 1 : AdyPan Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP SSID 2 : Horizontal Versine Trolley 1 Network type : Infrastructure Authentication : Open Encryption : None SSID 3 : Network type : Infrastructure Authentication : Open Encryption : None SSID 4 : WiFi_AdVa Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP SSID 5 : TP-LINK_903D_EXT Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP SSID 6 : TP-LINK_903D Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP SSID 7 : Toduti Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP Interface name : Wireless Network Connection 4 There are 3 networks currently visible. SSID 1 : Horizontal Versine Trolley 1 Network type : Infrastructure Authentication : Open Encryption : None SSID 2 : Toduti Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP SSID 3 : WiFi_AdVa Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP
Thus, what I want to do is to tell which interface to use "Wireless Network Connection" or "Wireless Network Connection 4". I need to do this because both interfaces have an IP address of 192.168.1.1
Kind regards, Marius
Best Answer