CDC/ECM driver for mbed, based on USBDevice by mbed-official. Uses PicoTCP to access Ethernet USB device. License: GPLv2
Fork of USB_Ethernet by
modules/pico_http_client.h@2:540f6e142d59, 2013-08-03 (annotated)
- Committer:
- daniele
- Date:
- Sat Aug 03 13:16:14 2013 +0000
- Revision:
- 2:540f6e142d59
Moved to single package
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
daniele | 2:540f6e142d59 | 1 | /********************************************************************* |
daniele | 2:540f6e142d59 | 2 | PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. |
daniele | 2:540f6e142d59 | 3 | See LICENSE and COPYING for usage. |
daniele | 2:540f6e142d59 | 4 | |
daniele | 2:540f6e142d59 | 5 | Author: Andrei Carp <andrei.carp@tass.be> |
daniele | 2:540f6e142d59 | 6 | *********************************************************************/ |
daniele | 2:540f6e142d59 | 7 | |
daniele | 2:540f6e142d59 | 8 | |
daniele | 2:540f6e142d59 | 9 | #ifndef PICO_HTTP_CLIENT_H_ |
daniele | 2:540f6e142d59 | 10 | #define PICO_HTTP_CLIENT_H_ |
daniele | 2:540f6e142d59 | 11 | |
daniele | 2:540f6e142d59 | 12 | #include "pico_http_util.h" |
daniele | 2:540f6e142d59 | 13 | |
daniele | 2:540f6e142d59 | 14 | /* |
daniele | 2:540f6e142d59 | 15 | * Transfer encodings |
daniele | 2:540f6e142d59 | 16 | */ |
daniele | 2:540f6e142d59 | 17 | #define HTTP_TRANSFER_CHUNKED 1u |
daniele | 2:540f6e142d59 | 18 | #define HTTP_TRANSFER_FULL 0u |
daniele | 2:540f6e142d59 | 19 | |
daniele | 2:540f6e142d59 | 20 | /* |
daniele | 2:540f6e142d59 | 21 | * Parameters for the send header function |
daniele | 2:540f6e142d59 | 22 | */ |
daniele | 2:540f6e142d59 | 23 | #define HTTP_HEADER_RAW 0u |
daniele | 2:540f6e142d59 | 24 | #define HTTP_HEADER_DEFAULT 1u |
daniele | 2:540f6e142d59 | 25 | |
daniele | 2:540f6e142d59 | 26 | /* |
daniele | 2:540f6e142d59 | 27 | * Data types |
daniele | 2:540f6e142d59 | 28 | */ |
daniele | 2:540f6e142d59 | 29 | |
daniele | 2:540f6e142d59 | 30 | struct pico_http_header |
daniele | 2:540f6e142d59 | 31 | { |
daniele | 2:540f6e142d59 | 32 | uint16_t responseCode; // http response |
daniele | 2:540f6e142d59 | 33 | char * location; // if redirect is reported |
daniele | 2:540f6e142d59 | 34 | uint32_t contentLengthOrChunk; // size of the message |
daniele | 2:540f6e142d59 | 35 | uint8_t transferCoding; // chunked or full |
daniele | 2:540f6e142d59 | 36 | |
daniele | 2:540f6e142d59 | 37 | }; |
daniele | 2:540f6e142d59 | 38 | |
daniele | 2:540f6e142d59 | 39 | int pico_http_client_open(char * uri, void (*wakeup)(uint16_t ev, uint16_t conn)); |
daniele | 2:540f6e142d59 | 40 | int pico_http_client_sendHeader(uint16_t conn, char * header, int hdr); |
daniele | 2:540f6e142d59 | 41 | |
daniele | 2:540f6e142d59 | 42 | struct pico_http_header * pico_http_client_readHeader(uint16_t conn); |
daniele | 2:540f6e142d59 | 43 | struct pico_http_uri * pico_http_client_readUriData(uint16_t conn); |
daniele | 2:540f6e142d59 | 44 | char * pico_http_client_buildHeader(const struct pico_http_uri * uriData); |
daniele | 2:540f6e142d59 | 45 | |
daniele | 2:540f6e142d59 | 46 | int pico_http_client_readData(uint16_t conn, char * data, uint16_t size); |
daniele | 2:540f6e142d59 | 47 | int pico_http_client_close(uint16_t conn); |
daniele | 2:540f6e142d59 | 48 | |
daniele | 2:540f6e142d59 | 49 | #endif /* PICO_HTTP_CLIENT_H_ */ |