Hi,
For CC3000, I wonder is there a way for me to give value to ip directly?
I saw tons of examples of giving value to ip by this function "getHostByName(WEBSITE, &ip))"
But if I know the ip address, how do I give to ip without using "getHostByName"?
Thanks a lot!
CC3000 ConnectTCP IP Question
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: CC3000 ConnectTCP IP Question
Take a look at the cc3000 object's IP2U32 function. You can pass the 4 byte components of an IP address and get a uint32_t ip address directly. For example to grab the value for 192.168.1.100 call:
uint32_t ip = cc3000.IP2U32(192, 168, 1, 100);
uint32_t ip = cc3000.IP2U32(192, 168, 1, 100);
Please be positive and constructive with your questions and comments.