[英]how to send messages within LAN using MAC address
I had a query related to java programming. 我有一个与java编程有关的查询。 I have two wifi modules connected to my access point and my android phone connected to the same access point.
我有两个wifi模块连接到我的接入点,我的Android手机连接到同一个接入点。 Can I send a string message to any of the two modules from my phone using only MAC address?
我是否可以仅使用MAC地址向手机中的任意两个模块发送字符串消息? I dont want to create a server on my phone.
我不想在手机上创建服务器。
Any help is much appreciate 任何帮助都非常感激
"Can I send a string message to any of the two modules from my phone using only MAC address?"
“我可以仅使用MAC地址从手机的两个模块中发送一个字符串消息吗?”
Theoretically: Yes, but hard work. 从理论上讲:是的,但努力工作。
You would need to implement a transport-layer protocol just for that. 您需要为此实现传输层协议。 What speaks against using the IP stack?
什么反对使用IP堆栈? It has some more overhead in comparison to just sending the messages based on Ethernet but that overhead is totally okay in comparison to the effort you had to invest in building the your own protocol-stack.
与仅基于以太网发送消息相比,它有更多的开销,但与您在构建自己的协议栈方面投入的成本相比,开销完全没问题。
"I dont want to create a server on my phone."
“我不想在手机上创建服务器。”
You don't need to create a server on your phone. 您无需在手机上创建服务器。 The other two modules do need a "server" that is listening for the message from your phone.
其他两个模块确实需要一个“服务器”来监听来自手机的消息。 Your phone would need to run a client capable sending the message to the other two modules.
您的手机需要运行能够将消息发送到其他两个模块的客户端。
Please don't misunderstand me here, but from the question you are asking I'd say working on such a project with that little knowledge would be very frustrating. 请不要在这里误解我,但是从你提出的问题来看,我说如果用这些小知识来处理这样的项目会非常令人沮丧。
If you want to pull it off I recommend having a look at Jpcap. 如果你想把它拉掉,我建议看一下Jpcap。 It is a Java library that is design to capture and send network packets.
它是一个Java库,用于捕获和发送网络数据包。
除非您准备使用第三方内容,否则您不能基于MAC地址在Java中执行任何I / O.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.