Search network device from LAN through my C++ application and change the IP address
- by Arun Kumar K S
I am developing an application in C++ to communicate with my network device. I used UDP classes to search the device from the network.
I done the code in such a way that from my application a broadcast message will send to the local network. The device will respond to the broadcast message and the application will get the IP address from that response. After establishing a network communication send a message to the device for changing the IP address. That worked fine if my devices IP address is correct.
But when I set a wrong IP address and subnet to the device. My application will never get any messages from the device. So I can't able communicate to the device and not able get the device and unable to change the IP address etc.
Say example
IP address of the device 20.1.1.1
Subnet Mask 255.0.0.0
And in my system that runs the application
IP address 192.168.1.23
Subnet Mask 255.255.255.0
I tried the Lantronix device installation software with their Lantronix device in network. It listed the device from the network and I am able to change the IP address from their software.
Any one know how this is done in this type of software? How I can search in network to find the device and change the IP address when its IP address is not in range? Which protocol they used to find the device?