CDC/ECM driver for mbed, based on USBDevice by mbed-official. Uses PicoTCP to access Ethernet USB device. License: GPLv2

Dependents:   USBEthernet_TEST

Fork of USB_Ethernet by Daniele Lacamera

modules/pico_http_server.h

Committer:
daniele
Date:
2013-08-03
Revision:
2:540f6e142d59

File content as of revision 2:540f6e142d59:

/*********************************************************************
PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved.
See LICENSE and COPYING for usage.

Author: Andrei Carp <andrei.carp@tass.be>
*********************************************************************/

#ifndef PICO_HTTP_SERVER_H_
#define PICO_HTTP_SERVER_H_

#include <stdint.h>
#include "pico_http_util.h"

// Response codes
#define HTTP_RESOURCE_FOUND                0
#define HTTP_RESOURCE_NOT_FOUND        1

// Generic id for the server
#define HTTP_SERVER_ID                    0

/*
 * Server functions
 */
int pico_http_server_start(uint16_t port, void (*wakeup)(uint16_t ev, uint16_t conn));
int pico_http_server_accept(void);

/*
 * Client functions
 */
char * pico_http_getResource(uint16_t conn);
int      pico_http_getProgress(uint16_t conn, uint16_t * sent, uint16_t *total);

/*
 * Handshake and data functions
 */
int      pico_http_respond(uint16_t conn, uint16_t code);
int      pico_http_submitData(uint16_t conn, void * buffer, int len);
int      pico_http_close(uint16_t conn);

#endif /* PICO_HTTP_SERVER_H_ */