Leest de waarde van een sensor binnen een maakt deze beschikbaar via internet

Dependencies:   NTPClient_NetServices mbed

Committer:
hendrikvincent
Date:
Mon Dec 02 09:01:23 2013 +0000
Revision:
0:05ccbd4f84f1
eerste programma;

Who changed what in which revision?

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