简体   繁体   English

使用Mac地址和UDP端口进行Smartplug套接字编程

[英]Smartplug socket programming using Mac Address and UDP port

I need to access a smartplug device using socket programming . 我需要使用套接字编程来访问smartplug设备。 I have the MAC address and UDP port number of the device . 我有设备的MAC地址和UDP端口号。 Other information like SSID,password , Apps Id, Dev Id, Cmd ID are also present . 还提供了其他信息,例如SSID,密码,应用程序ID,开发ID,Cmd ID。

Could you please let me know if this can be achieved using Python or Java API . 您能否让我知道是否可以使用Python或Java API来实现。 Is there a way in socket programming to access a device using MAC address and get the information sent from a specific UDP port . 套接字编程中是否可以使用MAC地址访问设备并获取从特定UDP端口发送的信息。

Thanks in advance for your help . 在此先感谢您的帮助 。

You can access the device via a UDP socket, provided you have the IP address of the device as well as the UDP port number. 您可以通过UDP套接字访问设备,前提是您拥有设备的IP地址以及UDP端口号。

Both Java and Python have socket APIs so you can use either one. Java和Python都具有套接字API,因此您可以使用其中任何一个。 Just make sure you follow the network protocol defined by the device to be able to read to / write from the device properly. 只需确保遵循设备定义的网络协议,即可正确读取/写入设备。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM