简体   繁体   English

如何使用MAC地址在LAN内发送消息

[英]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.

相关问题 如何仅使用局域网内的 IP 地址发送消息 - how to send messages using only IP address within LAN 谁能告诉我如何获取局域网中所有系统的MAC地址 - Can anyone tell how to get MAC address of all system in LAN 如何在本地局域网上找到“关机”系统的MAC地址(可能吗?) - How to find the MAC address of a 'shutdown' system on local lan (is it possible?) 获取局域网中的所有IP和Mac地址 - Get All IP and Mac Address in lan 如何使两个独立的Mac终端(命令提示符窗口)相互发送文本消息而不会出现“地址已在使用中”错误? - How to make two separate mac terminals (command prompt windows) send text messages to each other without getting the “Address already in use” error? 如何使用java获取我们自己的无线局域网IP地址 - How to get our own Wireless LAN Ip address using java 如何使用Gmail和Java从其他地址发送邮件? - How do you send messages from a different address using Gmail and Java? 使用Java的有线/无线LAN中的IP地址 - IP Address in a wired /wireless LAN using java 如何使用java代码欺骗mac地址? - how to spoof mac address using java code? 局域网内的发送者的MAC,接收者的MAC和路由器MAC:java jpcap的测试 - Sender's MAC, Receiver's MAC and Routers MAC - within a LAN: a testing by java jpcap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM