简体   繁体   English

如何以编程方式通过Wifi获取连接到交换机网络的其他设备的IP地址?

[英]How to get Ip address of other devices connected to switch network via Wifi programmatically?

In my project I need to get the ip address of the two different network that is connected to the switch for example my device ip is 192.168.2.5 and my printer ip address is 10.1.7.5在我的项目中,我需要获取连接到交换机的两个不同网络的 IP 地址,例如我的设备 IP 是 192.168.2.5,我的打印机 IP 地址是 10.1.7.5

I need to detect the printer ip address from my devices programmatically in android.我需要在 android 中以编程方式从我的设备中检测打印机 IP 地址。

There are only 2 ways of solving your problem:只有两种方法可以解决您的问题:

1) Your printer must register it IPv4 address somewhere. 1) 您的打印机必须在某处注册 IPv4 地址。 For example, in dynamic DNS zone with a predefined name.例如,在具有预定义名称的动态 DNS 区域中。 Then you can lookup this name there and get it IP addr.然后你可以在那里查找这个名字并获得它的 IP 地址。

2) If your switch is smart enough (eg, is manageable one), You can login into it interface (ssh or web) and scan through MAC address table. 2) 如果您的交换机足够智能(例如,是可管理的),您可以登录它的界面(ssh 或 web)并扫描 MAC 地址表。 In this case you must know printer MAC to look for.在这种情况下,您必须知道要查找的打印机 MAC。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android中以编程方式在网络上查找其他WiFi设备的IP地址 - How to find IP address of OTHER WiFi Devices on network programmatically in android 以编程方式将设备连接到android中的同一wifi网络? - Get Devices connected to same wifi network in android programmatically? 如何获取其他设备的对端IP地址 - How to get the peer IP address of other devices 获取 Wifi 网络上设备的名称和 IP - Get the name and IP of devices on a Wifi network 找到连接到同一Wifi网络的所有设备的MAC地址 - Find the MAC address of all devices connected to the same Wifi network 如何在Android上获取本地网络中所有设备的IP地址和名称 - How to get IP address and names of all devices in local network on Android 加快查找连接到Wifi网络的设备并获取设备名称的速度 - Speed up finding devices connected to a Wifi network and get device name 如何从 Android 应用程序检测 WiFi 网络中连接的所有设备 - How to detect all the Devices connected in a WiFi network from Android App 使用Java获取网络上其他设备可以访问的IP地址 - Getting IP Address which is reachable by other devices on the network in Java 如何获取所连接接口的IP地址 - how to get the ip address of the connected interface
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM