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) 2002 CITEL Technologies Ltd.
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
AdamGreen 0:616601bde9fb 6 * modification, are permitted provided that the following conditions
AdamGreen 0:616601bde9fb 7 * are met:
AdamGreen 0:616601bde9fb 8 * 1. Redistributions of source code must retain the above copyright
AdamGreen 0:616601bde9fb 9 * notice, this list of conditions and the following disclaimer.
AdamGreen 0:616601bde9fb 10 * 2. Redistributions in binary form must reproduce the above copyright
AdamGreen 0:616601bde9fb 11 * notice, this list of conditions and the following disclaimer in the
AdamGreen 0:616601bde9fb 12 * documentation and/or other materials provided with the distribution.
AdamGreen 0:616601bde9fb 13 * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
AdamGreen 0:616601bde9fb 14 * may be used to endorse or promote products derived from this software
AdamGreen 0:616601bde9fb 15 * without specific prior written permission.
AdamGreen 0:616601bde9fb 16 *
AdamGreen 0:616601bde9fb 17 * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
AdamGreen 0:616601bde9fb 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
AdamGreen 0:616601bde9fb 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
AdamGreen 0:616601bde9fb 20 * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
AdamGreen 0:616601bde9fb 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
AdamGreen 0:616601bde9fb 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
AdamGreen 0:616601bde9fb 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
AdamGreen 0:616601bde9fb 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
AdamGreen 0:616601bde9fb 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
AdamGreen 0:616601bde9fb 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
AdamGreen 0:616601bde9fb 27 * SUCH DAMAGE.
AdamGreen 0:616601bde9fb 28 *
AdamGreen 0:616601bde9fb 29 * This file is a contribution to the lwIP TCP/IP stack.
AdamGreen 0:616601bde9fb 30 * The Swedish Institute of Computer Science and Adam Dunkels
AdamGreen 0:616601bde9fb 31 * are specifically granted permission to redistribute this
AdamGreen 0:616601bde9fb 32 * source code.
AdamGreen 0:616601bde9fb 33 */
AdamGreen 0:616601bde9fb 34
AdamGreen 0:616601bde9fb 35 #ifndef __LWIP_IGMP_H__
AdamGreen 0:616601bde9fb 36 #define __LWIP_IGMP_H__
AdamGreen 0:616601bde9fb 37
AdamGreen 0:616601bde9fb 38 #include "lwip/opt.h"
AdamGreen 0:616601bde9fb 39 #include "lwip/ip_addr.h"
AdamGreen 0:616601bde9fb 40 #include "lwip/netif.h"
AdamGreen 0:616601bde9fb 41 #include "lwip/pbuf.h"
AdamGreen 0:616601bde9fb 42
AdamGreen 0:616601bde9fb 43 #if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */
AdamGreen 0:616601bde9fb 44
AdamGreen 0:616601bde9fb 45 #ifdef __cplusplus
AdamGreen 0:616601bde9fb 46 extern "C" {
AdamGreen 0:616601bde9fb 47 #endif
AdamGreen 0:616601bde9fb 48
AdamGreen 0:616601bde9fb 49
AdamGreen 0:616601bde9fb 50 /* IGMP timer */
AdamGreen 0:616601bde9fb 51 #define IGMP_TMR_INTERVAL 100 /* Milliseconds */
AdamGreen 0:616601bde9fb 52 #define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL)
AdamGreen 0:616601bde9fb 53 #define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL)
AdamGreen 0:616601bde9fb 54
AdamGreen 0:616601bde9fb 55 /* MAC Filter Actions, these are passed to a netif's
AdamGreen 0:616601bde9fb 56 * igmp_mac_filter callback function. */
AdamGreen 0:616601bde9fb 57 #define IGMP_DEL_MAC_FILTER 0
AdamGreen 0:616601bde9fb 58 #define IGMP_ADD_MAC_FILTER 1
AdamGreen 0:616601bde9fb 59
AdamGreen 0:616601bde9fb 60
AdamGreen 0:616601bde9fb 61 /**
AdamGreen 0:616601bde9fb 62 * igmp group structure - there is
AdamGreen 0:616601bde9fb 63 * a list of groups for each interface
AdamGreen 0:616601bde9fb 64 * these should really be linked from the interface, but
AdamGreen 0:616601bde9fb 65 * if we keep them separate we will not affect the lwip original code
AdamGreen 0:616601bde9fb 66 * too much
AdamGreen 0:616601bde9fb 67 *
AdamGreen 0:616601bde9fb 68 * There will be a group for the all systems group address but this
AdamGreen 0:616601bde9fb 69 * will not run the state machine as it is used to kick off reports
AdamGreen 0:616601bde9fb 70 * from all the other groups
AdamGreen 0:616601bde9fb 71 */
AdamGreen 0:616601bde9fb 72 struct igmp_group {
AdamGreen 0:616601bde9fb 73 /** next link */
AdamGreen 0:616601bde9fb 74 struct igmp_group *next;
AdamGreen 0:616601bde9fb 75 /** interface on which the group is active */
AdamGreen 0:616601bde9fb 76 struct netif *netif;
AdamGreen 0:616601bde9fb 77 /** multicast address */
AdamGreen 0:616601bde9fb 78 ip_addr_t group_address;
AdamGreen 0:616601bde9fb 79 /** signifies we were the last person to report */
AdamGreen 0:616601bde9fb 80 u8_t last_reporter_flag;
AdamGreen 0:616601bde9fb 81 /** current state of the group */
AdamGreen 0:616601bde9fb 82 u8_t group_state;
AdamGreen 0:616601bde9fb 83 /** timer for reporting, negative is OFF */
AdamGreen 0:616601bde9fb 84 u16_t timer;
AdamGreen 0:616601bde9fb 85 /** counter of simultaneous uses */
AdamGreen 0:616601bde9fb 86 u8_t use;
AdamGreen 0:616601bde9fb 87 };
AdamGreen 0:616601bde9fb 88
AdamGreen 0:616601bde9fb 89 /* Prototypes */
AdamGreen 0:616601bde9fb 90 void igmp_init(void);
AdamGreen 0:616601bde9fb 91 err_t igmp_start(struct netif *netif);
AdamGreen 0:616601bde9fb 92 err_t igmp_stop(struct netif *netif);
AdamGreen 0:616601bde9fb 93 void igmp_report_groups(struct netif *netif);
AdamGreen 0:616601bde9fb 94 struct igmp_group *igmp_lookfor_group(struct netif *ifp, ip_addr_t *addr);
AdamGreen 0:616601bde9fb 95 void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest);
AdamGreen 0:616601bde9fb 96 err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
AdamGreen 0:616601bde9fb 97 err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
AdamGreen 0:616601bde9fb 98 void igmp_tmr(void);
AdamGreen 0:616601bde9fb 99
AdamGreen 0:616601bde9fb 100 #ifdef __cplusplus
AdamGreen 0:616601bde9fb 101 }
AdamGreen 0:616601bde9fb 102 #endif
AdamGreen 0:616601bde9fb 103
AdamGreen 0:616601bde9fb 104 #endif /* LWIP_IGMP */
AdamGreen 0:616601bde9fb 105
AdamGreen 0:616601bde9fb 106 #endif /* __LWIP_IGMP_H__ */