David Norman
David Norman

Reputation: 301

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

Upvotes: 1

Views: 3463

Answers (2)

user207421
user207421

Reputation: 311018

You can't do any I/O in Java based on a MAC address unless you are prepared to use third party stuff.

Upvotes: 1

clentfort
clentfort

Reputation: 2504

"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.

Upvotes: 2

Related Questions