Web server based weather station using Sparkfun Weather Meters.

Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Committer:
AdamGreen
Date:
Thu Feb 23 21:38:39 2012 +0000
Revision:
0:616601bde9fb

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AdamGreen 0:616601bde9fb 1 /*
AdamGreen 0:616601bde9fb 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
AdamGreen 0:616601bde9fb 3 * All rights reserved.
AdamGreen 0:616601bde9fb 4 *
AdamGreen 0:616601bde9fb 5 * Redistribution and use in source and binary forms, with or without modification,
AdamGreen 0:616601bde9fb 6 * are permitted provided that the following conditions are met:
AdamGreen 0:616601bde9fb 7 *
AdamGreen 0:616601bde9fb 8 * 1. Redistributions of source code must retain the above copyright notice,
AdamGreen 0:616601bde9fb 9 * this list of conditions and the following disclaimer.
AdamGreen 0:616601bde9fb 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
AdamGreen 0:616601bde9fb 11 * this list of conditions and the following disclaimer in the documentation
AdamGreen 0:616601bde9fb 12 * and/or other materials provided with the distribution.
AdamGreen 0:616601bde9fb 13 * 3. The name of the author may not be used to endorse or promote products
AdamGreen 0:616601bde9fb 14 * derived from this software without specific prior written permission.
AdamGreen 0:616601bde9fb 15 *
AdamGreen 0:616601bde9fb 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
AdamGreen 0:616601bde9fb 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
AdamGreen 0:616601bde9fb 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
AdamGreen 0:616601bde9fb 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
AdamGreen 0:616601bde9fb 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
AdamGreen 0:616601bde9fb 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
AdamGreen 0:616601bde9fb 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
AdamGreen 0:616601bde9fb 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
AdamGreen 0:616601bde9fb 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
AdamGreen 0:616601bde9fb 25 * OF SUCH DAMAGE.
AdamGreen 0:616601bde9fb 26 *
AdamGreen 0:616601bde9fb 27 * This file is part of the lwIP TCP/IP stack.
AdamGreen 0:616601bde9fb 28 *
AdamGreen 0:616601bde9fb 29 * Author: Adam Dunkels <adam@sics.se>
AdamGreen 0:616601bde9fb 30 *
AdamGreen 0:616601bde9fb 31 */
AdamGreen 0:616601bde9fb 32 #ifndef __LWIP_RAW_H__
AdamGreen 0:616601bde9fb 33 #define __LWIP_RAW_H__
AdamGreen 0:616601bde9fb 34
AdamGreen 0:616601bde9fb 35 #include "lwip/opt.h"
AdamGreen 0:616601bde9fb 36
AdamGreen 0:616601bde9fb 37 #if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
AdamGreen 0:616601bde9fb 38
AdamGreen 0:616601bde9fb 39 #include "lwip/pbuf.h"
AdamGreen 0:616601bde9fb 40 #include "lwip/def.h"
AdamGreen 0:616601bde9fb 41 #include "lwip/ip.h"
AdamGreen 0:616601bde9fb 42 #include "lwip/ip_addr.h"
AdamGreen 0:616601bde9fb 43
AdamGreen 0:616601bde9fb 44 #ifdef __cplusplus
AdamGreen 0:616601bde9fb 45 extern "C" {
AdamGreen 0:616601bde9fb 46 #endif
AdamGreen 0:616601bde9fb 47
AdamGreen 0:616601bde9fb 48 struct raw_pcb;
AdamGreen 0:616601bde9fb 49
AdamGreen 0:616601bde9fb 50 /** Function prototype for raw pcb receive callback functions.
AdamGreen 0:616601bde9fb 51 * @param arg user supplied argument (raw_pcb.recv_arg)
AdamGreen 0:616601bde9fb 52 * @param pcb the raw_pcb which received data
AdamGreen 0:616601bde9fb 53 * @param p the packet buffer that was received
AdamGreen 0:616601bde9fb 54 * @param addr the remote IP address from which the packet was received
AdamGreen 0:616601bde9fb 55 * @return 1 if the packet was 'eaten' (aka. deleted),
AdamGreen 0:616601bde9fb 56 * 0 if the packet lives on
AdamGreen 0:616601bde9fb 57 * If returning 1, the callback is responsible for freeing the pbuf
AdamGreen 0:616601bde9fb 58 * if it's not used any more.
AdamGreen 0:616601bde9fb 59 */
AdamGreen 0:616601bde9fb 60 typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p,
AdamGreen 0:616601bde9fb 61 ip_addr_t *addr);
AdamGreen 0:616601bde9fb 62
AdamGreen 0:616601bde9fb 63 struct raw_pcb {
AdamGreen 0:616601bde9fb 64 /* Common members of all PCB types */
AdamGreen 0:616601bde9fb 65 IP_PCB;
AdamGreen 0:616601bde9fb 66
AdamGreen 0:616601bde9fb 67 struct raw_pcb *next;
AdamGreen 0:616601bde9fb 68
AdamGreen 0:616601bde9fb 69 u8_t protocol;
AdamGreen 0:616601bde9fb 70
AdamGreen 0:616601bde9fb 71 /** receive callback function */
AdamGreen 0:616601bde9fb 72 raw_recv_fn recv;
AdamGreen 0:616601bde9fb 73 /* user-supplied argument for the recv callback */
AdamGreen 0:616601bde9fb 74 void *recv_arg;
AdamGreen 0:616601bde9fb 75 };
AdamGreen 0:616601bde9fb 76
AdamGreen 0:616601bde9fb 77 /* The following functions is the application layer interface to the
AdamGreen 0:616601bde9fb 78 RAW code. */
AdamGreen 0:616601bde9fb 79 struct raw_pcb * raw_new (u8_t proto);
AdamGreen 0:616601bde9fb 80 void raw_remove (struct raw_pcb *pcb);
AdamGreen 0:616601bde9fb 81 err_t raw_bind (struct raw_pcb *pcb, ip_addr_t *ipaddr);
AdamGreen 0:616601bde9fb 82 err_t raw_connect (struct raw_pcb *pcb, ip_addr_t *ipaddr);
AdamGreen 0:616601bde9fb 83
AdamGreen 0:616601bde9fb 84 void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg);
AdamGreen 0:616601bde9fb 85 err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr);
AdamGreen 0:616601bde9fb 86 err_t raw_send (struct raw_pcb *pcb, struct pbuf *p);
AdamGreen 0:616601bde9fb 87
AdamGreen 0:616601bde9fb 88 /* The following functions are the lower layer interface to RAW. */
AdamGreen 0:616601bde9fb 89 u8_t raw_input (struct pbuf *p, struct netif *inp);
AdamGreen 0:616601bde9fb 90 #define raw_init() /* Compatibility define, not init needed. */
AdamGreen 0:616601bde9fb 91
AdamGreen 0:616601bde9fb 92 #ifdef __cplusplus
AdamGreen 0:616601bde9fb 93 }
AdamGreen 0:616601bde9fb 94 #endif
AdamGreen 0:616601bde9fb 95
AdamGreen 0:616601bde9fb 96 #endif /* LWIP_RAW */
AdamGreen 0:616601bde9fb 97
AdamGreen 0:616601bde9fb 98 #endif /* __LWIP_RAW_H__ */