Trial code integration web page update with analogue data and ntp support

Dependencies:   NTPClient_NetServices mbed

Committer:
pmr1
Date:
Fri Aug 06 17:57:45 2010 +0000
Revision:
0:8cc2035bebfc

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pmr1 0:8cc2035bebfc 1 /*
pmr1 0:8cc2035bebfc 2 * Redistribution and use in source and binary forms, with or without modification,
pmr1 0:8cc2035bebfc 3 * are permitted provided that the following conditions are met:
pmr1 0:8cc2035bebfc 4 *
pmr1 0:8cc2035bebfc 5 * 1. Redistributions of source code must retain the above copyright notice,
pmr1 0:8cc2035bebfc 6 * this list of conditions and the following disclaimer.
pmr1 0:8cc2035bebfc 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
pmr1 0:8cc2035bebfc 8 * this list of conditions and the following disclaimer in the documentation
pmr1 0:8cc2035bebfc 9 * and/or other materials provided with the distribution.
pmr1 0:8cc2035bebfc 10 * 3. The name of the author may not be used to endorse or promote products
pmr1 0:8cc2035bebfc 11 * derived from this software without specific prior written permission.
pmr1 0:8cc2035bebfc 12 *
pmr1 0:8cc2035bebfc 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
pmr1 0:8cc2035bebfc 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
pmr1 0:8cc2035bebfc 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
pmr1 0:8cc2035bebfc 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
pmr1 0:8cc2035bebfc 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
pmr1 0:8cc2035bebfc 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
pmr1 0:8cc2035bebfc 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
pmr1 0:8cc2035bebfc 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
pmr1 0:8cc2035bebfc 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
pmr1 0:8cc2035bebfc 22 * OF SUCH DAMAGE.
pmr1 0:8cc2035bebfc 23 *
pmr1 0:8cc2035bebfc 24 * This file is part of the lwIP TCP/IP stack.
pmr1 0:8cc2035bebfc 25 *
pmr1 0:8cc2035bebfc 26 */
pmr1 0:8cc2035bebfc 27
pmr1 0:8cc2035bebfc 28 #ifndef __LWIP_NETIFAPI_H__
pmr1 0:8cc2035bebfc 29 #define __LWIP_NETIFAPI_H__
pmr1 0:8cc2035bebfc 30
pmr1 0:8cc2035bebfc 31 #include "lwip/opt.h"
pmr1 0:8cc2035bebfc 32
pmr1 0:8cc2035bebfc 33 #if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
pmr1 0:8cc2035bebfc 34
pmr1 0:8cc2035bebfc 35 #include "lwip/sys.h"
pmr1 0:8cc2035bebfc 36 #include "lwip/netif.h"
pmr1 0:8cc2035bebfc 37 #include "lwip/dhcp.h"
pmr1 0:8cc2035bebfc 38 #include "lwip/autoip.h"
pmr1 0:8cc2035bebfc 39
pmr1 0:8cc2035bebfc 40 #ifdef __cplusplus
pmr1 0:8cc2035bebfc 41 extern "C" {
pmr1 0:8cc2035bebfc 42 #endif
pmr1 0:8cc2035bebfc 43
pmr1 0:8cc2035bebfc 44 typedef void (*netifapi_void_fn)(struct netif *netif);
pmr1 0:8cc2035bebfc 45 typedef err_t (*netifapi_errt_fn)(struct netif *netif);
pmr1 0:8cc2035bebfc 46
pmr1 0:8cc2035bebfc 47 struct netifapi_msg_msg {
pmr1 0:8cc2035bebfc 48 #if !LWIP_TCPIP_CORE_LOCKING
pmr1 0:8cc2035bebfc 49 sys_sem_t sem;
pmr1 0:8cc2035bebfc 50 #endif /* !LWIP_TCPIP_CORE_LOCKING */
pmr1 0:8cc2035bebfc 51 err_t err;
pmr1 0:8cc2035bebfc 52 struct netif *netif;
pmr1 0:8cc2035bebfc 53 union {
pmr1 0:8cc2035bebfc 54 struct {
pmr1 0:8cc2035bebfc 55 ip_addr_t *ipaddr;
pmr1 0:8cc2035bebfc 56 ip_addr_t *netmask;
pmr1 0:8cc2035bebfc 57 ip_addr_t *gw;
pmr1 0:8cc2035bebfc 58 void *state;
pmr1 0:8cc2035bebfc 59 netif_init_fn init;
pmr1 0:8cc2035bebfc 60 netif_input_fn input;
pmr1 0:8cc2035bebfc 61 } add;
pmr1 0:8cc2035bebfc 62 struct {
pmr1 0:8cc2035bebfc 63 netifapi_void_fn voidfunc;
pmr1 0:8cc2035bebfc 64 netifapi_errt_fn errtfunc;
pmr1 0:8cc2035bebfc 65 } common;
pmr1 0:8cc2035bebfc 66 } msg;
pmr1 0:8cc2035bebfc 67 };
pmr1 0:8cc2035bebfc 68
pmr1 0:8cc2035bebfc 69 struct netifapi_msg {
pmr1 0:8cc2035bebfc 70 void (* function)(struct netifapi_msg_msg *msg);
pmr1 0:8cc2035bebfc 71 struct netifapi_msg_msg msg;
pmr1 0:8cc2035bebfc 72 };
pmr1 0:8cc2035bebfc 73
pmr1 0:8cc2035bebfc 74
pmr1 0:8cc2035bebfc 75 /* API for application */
pmr1 0:8cc2035bebfc 76 err_t netifapi_netif_add ( struct netif *netif,
pmr1 0:8cc2035bebfc 77 ip_addr_t *ipaddr,
pmr1 0:8cc2035bebfc 78 ip_addr_t *netmask,
pmr1 0:8cc2035bebfc 79 ip_addr_t *gw,
pmr1 0:8cc2035bebfc 80 void *state,
pmr1 0:8cc2035bebfc 81 netif_init_fn init,
pmr1 0:8cc2035bebfc 82 netif_input_fn input);
pmr1 0:8cc2035bebfc 83
pmr1 0:8cc2035bebfc 84 err_t netifapi_netif_set_addr ( struct netif *netif,
pmr1 0:8cc2035bebfc 85 ip_addr_t *ipaddr,
pmr1 0:8cc2035bebfc 86 ip_addr_t *netmask,
pmr1 0:8cc2035bebfc 87 ip_addr_t *gw );
pmr1 0:8cc2035bebfc 88
pmr1 0:8cc2035bebfc 89 err_t netifapi_netif_common ( struct netif *netif,
pmr1 0:8cc2035bebfc 90 netifapi_void_fn voidfunc,
pmr1 0:8cc2035bebfc 91 netifapi_errt_fn errtfunc);
pmr1 0:8cc2035bebfc 92
pmr1 0:8cc2035bebfc 93 #define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL)
pmr1 0:8cc2035bebfc 94 #define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL)
pmr1 0:8cc2035bebfc 95 #define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL)
pmr1 0:8cc2035bebfc 96 #define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL)
pmr1 0:8cc2035bebfc 97 #define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start)
pmr1 0:8cc2035bebfc 98 #define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL)
pmr1 0:8cc2035bebfc 99 #define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start)
pmr1 0:8cc2035bebfc 100 #define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop)
pmr1 0:8cc2035bebfc 101
pmr1 0:8cc2035bebfc 102 #ifdef __cplusplus
pmr1 0:8cc2035bebfc 103 }
pmr1 0:8cc2035bebfc 104 #endif
pmr1 0:8cc2035bebfc 105
pmr1 0:8cc2035bebfc 106 #endif /* LWIP_NETIF_API */
pmr1 0:8cc2035bebfc 107
pmr1 0:8cc2035bebfc 108 #endif /* __LWIP_NETIFAPI_H__ */