-24-
v7.3
Software
Example of use (POST and PUT methods):
{
char host[] = “test.libelium.com”;
uint16_t port = 80;
char resource[] = “/test-get-post.php”;
char data[] = “varA=1&varB=2&varC=3&varD=4&varE=5”;
_4G.http(Wasp4G::HTTP_POST, host, port, resource, data);
}
Once the request has been sent, the function waits for data from the server and stores it in
_buffer
. It also stores
the HTTP status code from the server in
_httpCode
.
Related variable:
_4G._httpCode
→
Stores the HTTP code from the server
_4G._buffer
→
Stores data received from server
_4G._length
→
Stores data length
Possible error codes for this function:
•
1: not registered, ME is not currently searching for a new operator to register to
•
2: not registered, but ME is currently searching for a new operator to register to
•
3: registration denied
•
4: unknown
•
6: not registered, ME is not currently searching for a new operator to register to
•
8: not registered, but ME is currently searching for a new operator to register to
•
9: registration denied
•
10: unknown
•
12: if error setting APN
•
13: if error setting login
•
14: if error setting password
•
15: if error activating GPRS connection
•
16: if error setting URL and port
•
17: if error sending the request
•
18: if error sending POST / PUT data
•
19: if wrong method has been selected
•
20: if timeout waiting the URC
•
21: if error reading the URC
•
22: if error reading the HTTP status
•
23: if error reading the HTTP data length
•
24: if error reading the HTTP data
•
25: if error code from 4G module while waiting for HTTP response
•
26: if timeout waiting for HTTP response
•
27: if HTTP response data length is zero
Example of HTTP GET:
www.libelium.com/development/waspmote/examples/4g-06-http-get
Example of HTTP POST:
www.libelium.com/development/waspmote/examples/4g-07-http-post
Содержание LE910
Страница 1: ...Waspmote 4G Networking Guide ...