简体   繁体   中英

how to send messages within LAN using MAC address

I had a query related to java programming. I have two wifi modules connected to my access point and my android phone connected to the same access point. Can I send a string message to any of the two modules from my phone using only MAC address? 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?"

Theoretically: Yes, but hard work.

You would need to implement a transport-layer protocol just for that. What speaks against using the IP stack? 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. It is a Java library that is design to capture and send network packets.

除非您准备使用第三方内容,否则您不能基于MAC地址在Java中执行任何I / O.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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