On Saturday, 22 January 2022 at 20:55:38 UTC, Daren Scot Wilson wrote:
I'm writing a command line program to control certain hardware devices. I can hardcode or have in a config file the IP addresses for the devices, if I know that info. If I don't?

Depending on the hardware, you might be able to send a broadcast packet and listen to replies too.

The nmap command you do just does pings to each address in that range (btw I actually wrote a little module to turn one of those ranges into a bunch of ip address strings: https://github.com/adamdruppe/arsd/blob/master/cidr.d ). The stdlib doesn't have a convenient ping function though.

But yah depending on the hardware you might be able to do udp broadcasts and such. I had this led tower light thing for a client I had to set up and that's what i did there - udp broadcast a config packet, get the list of all the mac addresses, send config packets to change their ips, and get going.

Reply via email to