mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

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