First off, I apologize if I'm not using the right C / C++ nomenclature. It's just what was able to stick with me.
I'm trying to use the newly redesigned ICMPPing.h to ping an address that I put in from a keypad. The information is available as a string ("192.168.1.100") or as a byte array ([192],[168],[1],[100]). In the example given, there is this line:
IPAddress pingAddr(192,168,1,100);
I tried reading through the header file and I think it's a little-endian uint32_t data type. I've tried a number of items, but I seem to have the most promise with something like this:
So, the good news is that part works. It also takes keypad input, which is better. However, I still get the following error:
In file included from C:\Program Files (x86)\Arduino\libraries\ICMPPing/ICMPPing.h:12,
from KeypadPing3.ino:16:
C:\Program Files (x86)\Arduino\libraries\Ethernet/utility/w5100.h:98: error: expected unqualified-id before numeric constant
The lines of code that actually do the pinging are copied & pasted from the example, so I know they work.
ArrayToInteger converter; //Create a converter
converter.array[0] = NewIP[0] ; //save something to each byte in the array
converter.array[1] = NewIP[1] ; //save something to each byte in the array
converter.array[2] = NewIP[2] ; //save something to each byte in the array
converter.array[3] = NewIP[3] ; //save something to each byte in the array
IPAddress pingAddr(converter.integer);
I will test this in a few hours. My whole codebase is a mess, and I'm sure it would give any proper programmer fits. But, if it's ugly and works, it's not so ugly.
I also figured out what I did wrong. At one point I created a byte array for the IP address, but it didn't work. When I changed it to an int array, it passed the information successfully.