
-54-
v4.9
TCP and UDP connections
Related constants of Wasp3G.h
#define _3G_APN “myapn”
#define _3G_LOGIN “user_name”
#define _3G_PASSW “password”
#define RETRIES
“10”
#define DELAY_SEND
“0”
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with CME code is available
•
‘-3’ if error configuring IP parameters.
11.2. Getting the IP assigned to the module
The function
getIP()
gets the IP assigned to the module by the network provider. The IP address is stored in
buffer_3G
.
Example of use:
{
// Gets the IP assigned:
_3G.getIP();
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with IP error code available
11.3. Query a IP address from a domain name
This function obtains the IP address from a given domain name. The IP address is stored in
buffer_3G
.
Example of use:
{
// Query the IP address from a domain name
_3G.QueryIPfromDomain(“www.libelium.com”);
}
This function returns:
•
‘1’ on success
•
‘0’ if error