Hi. This is the feed program for Cosm. (The previous name of the services is Pachube.)

Dependencies:   mbed ThermistorPack Pachube ConfigFile EthernetNetIf TextLCD HTTPClient_ToBeRemoved FatFileSystem SDFileSystem

Committer:
shintamainjp
Date:
Mon Aug 06 12:37:59 2012 +0000
Revision:
0:521ba375aa0f
Pachube renamed to Cosm.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shintamainjp 0:521ba375aa0f 1 /*
shintamainjp 0:521ba375aa0f 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
shintamainjp 0:521ba375aa0f 3 * All rights reserved.
shintamainjp 0:521ba375aa0f 4 *
shintamainjp 0:521ba375aa0f 5 * Redistribution and use in source and binary forms, with or without modification,
shintamainjp 0:521ba375aa0f 6 * are permitted provided that the following conditions are met:
shintamainjp 0:521ba375aa0f 7 *
shintamainjp 0:521ba375aa0f 8 * 1. Redistributions of source code must retain the above copyright notice,
shintamainjp 0:521ba375aa0f 9 * this list of conditions and the following disclaimer.
shintamainjp 0:521ba375aa0f 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
shintamainjp 0:521ba375aa0f 11 * this list of conditions and the following disclaimer in the documentation
shintamainjp 0:521ba375aa0f 12 * and/or other materials provided with the distribution.
shintamainjp 0:521ba375aa0f 13 * 3. The name of the author may not be used to endorse or promote products
shintamainjp 0:521ba375aa0f 14 * derived from this software without specific prior written permission.
shintamainjp 0:521ba375aa0f 15 *
shintamainjp 0:521ba375aa0f 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
shintamainjp 0:521ba375aa0f 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
shintamainjp 0:521ba375aa0f 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
shintamainjp 0:521ba375aa0f 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
shintamainjp 0:521ba375aa0f 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
shintamainjp 0:521ba375aa0f 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
shintamainjp 0:521ba375aa0f 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
shintamainjp 0:521ba375aa0f 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
shintamainjp 0:521ba375aa0f 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
shintamainjp 0:521ba375aa0f 25 * OF SUCH DAMAGE.
shintamainjp 0:521ba375aa0f 26 *
shintamainjp 0:521ba375aa0f 27 * This file is part of the lwIP TCP/IP stack.
shintamainjp 0:521ba375aa0f 28 *
shintamainjp 0:521ba375aa0f 29 * Author: Adam Dunkels <adam@sics.se>
shintamainjp 0:521ba375aa0f 30 *
shintamainjp 0:521ba375aa0f 31 */
shintamainjp 0:521ba375aa0f 32 #ifndef __LWIP_TCPIP_H__
shintamainjp 0:521ba375aa0f 33 #define __LWIP_TCPIP_H__
shintamainjp 0:521ba375aa0f 34
shintamainjp 0:521ba375aa0f 35 #include "lwip/opt.h"
shintamainjp 0:521ba375aa0f 36
shintamainjp 0:521ba375aa0f 37 #if !NO_SYS /* don't build if not configured for use in lwipopts.h */
shintamainjp 0:521ba375aa0f 38
shintamainjp 0:521ba375aa0f 39 #include "lwip/api_msg.h"
shintamainjp 0:521ba375aa0f 40 #include "lwip/netifapi.h"
shintamainjp 0:521ba375aa0f 41 #include "lwip/pbuf.h"
shintamainjp 0:521ba375aa0f 42 #include "lwip/api.h"
shintamainjp 0:521ba375aa0f 43 #include "lwip/sys.h"
shintamainjp 0:521ba375aa0f 44 #include "lwip/timers.h"
shintamainjp 0:521ba375aa0f 45 #include "lwip/netif.h"
shintamainjp 0:521ba375aa0f 46
shintamainjp 0:521ba375aa0f 47 #ifdef __cplusplus
shintamainjp 0:521ba375aa0f 48 extern "C" {
shintamainjp 0:521ba375aa0f 49 #endif
shintamainjp 0:521ba375aa0f 50
shintamainjp 0:521ba375aa0f 51 /** Define this to something that triggers a watchdog. This is called from
shintamainjp 0:521ba375aa0f 52 * tcpip_thread after processing a message. */
shintamainjp 0:521ba375aa0f 53 #ifndef LWIP_TCPIP_THREAD_ALIVE
shintamainjp 0:521ba375aa0f 54 #define LWIP_TCPIP_THREAD_ALIVE()
shintamainjp 0:521ba375aa0f 55 #endif
shintamainjp 0:521ba375aa0f 56
shintamainjp 0:521ba375aa0f 57 #if LWIP_TCPIP_CORE_LOCKING
shintamainjp 0:521ba375aa0f 58 /** The global semaphore to lock the stack. */
shintamainjp 0:521ba375aa0f 59 extern sys_mutex_t lock_tcpip_core;
shintamainjp 0:521ba375aa0f 60 #define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core)
shintamainjp 0:521ba375aa0f 61 #define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core)
shintamainjp 0:521ba375aa0f 62 #define TCPIP_APIMSG(m) tcpip_apimsg_lock(m)
shintamainjp 0:521ba375aa0f 63 #define TCPIP_APIMSG_ACK(m)
shintamainjp 0:521ba375aa0f 64 #define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m)
shintamainjp 0:521ba375aa0f 65 #define TCPIP_NETIFAPI_ACK(m)
shintamainjp 0:521ba375aa0f 66 #else /* LWIP_TCPIP_CORE_LOCKING */
shintamainjp 0:521ba375aa0f 67 #define LOCK_TCPIP_CORE()
shintamainjp 0:521ba375aa0f 68 #define UNLOCK_TCPIP_CORE()
shintamainjp 0:521ba375aa0f 69 #define TCPIP_APIMSG(m) tcpip_apimsg(m)
shintamainjp 0:521ba375aa0f 70 #define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed)
shintamainjp 0:521ba375aa0f 71 #define TCPIP_NETIFAPI(m) tcpip_netifapi(m)
shintamainjp 0:521ba375aa0f 72 #define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(&m->sem)
shintamainjp 0:521ba375aa0f 73 #endif /* LWIP_TCPIP_CORE_LOCKING */
shintamainjp 0:521ba375aa0f 74
shintamainjp 0:521ba375aa0f 75 /** Function prototype for the init_done function passed to tcpip_init */
shintamainjp 0:521ba375aa0f 76 typedef void (*tcpip_init_done_fn)(void *arg);
shintamainjp 0:521ba375aa0f 77 /** Function prototype for functions passed to tcpip_callback() */
shintamainjp 0:521ba375aa0f 78 typedef void (*tcpip_callback_fn)(void *ctx);
shintamainjp 0:521ba375aa0f 79
shintamainjp 0:521ba375aa0f 80 void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);
shintamainjp 0:521ba375aa0f 81
shintamainjp 0:521ba375aa0f 82 #if LWIP_NETCONN
shintamainjp 0:521ba375aa0f 83 err_t tcpip_apimsg(struct api_msg *apimsg);
shintamainjp 0:521ba375aa0f 84 #if LWIP_TCPIP_CORE_LOCKING
shintamainjp 0:521ba375aa0f 85 err_t tcpip_apimsg_lock(struct api_msg *apimsg);
shintamainjp 0:521ba375aa0f 86 #endif /* LWIP_TCPIP_CORE_LOCKING */
shintamainjp 0:521ba375aa0f 87 #endif /* LWIP_NETCONN */
shintamainjp 0:521ba375aa0f 88
shintamainjp 0:521ba375aa0f 89 err_t tcpip_input(struct pbuf *p, struct netif *inp);
shintamainjp 0:521ba375aa0f 90
shintamainjp 0:521ba375aa0f 91 #if LWIP_NETIF_API
shintamainjp 0:521ba375aa0f 92 err_t tcpip_netifapi(struct netifapi_msg *netifapimsg);
shintamainjp 0:521ba375aa0f 93 #if LWIP_TCPIP_CORE_LOCKING
shintamainjp 0:521ba375aa0f 94 err_t tcpip_netifapi_lock(struct netifapi_msg *netifapimsg);
shintamainjp 0:521ba375aa0f 95 #endif /* LWIP_TCPIP_CORE_LOCKING */
shintamainjp 0:521ba375aa0f 96 #endif /* LWIP_NETIF_API */
shintamainjp 0:521ba375aa0f 97
shintamainjp 0:521ba375aa0f 98 err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);
shintamainjp 0:521ba375aa0f 99 #define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1)
shintamainjp 0:521ba375aa0f 100
shintamainjp 0:521ba375aa0f 101 /* free pbufs or heap memory from another context without blocking */
shintamainjp 0:521ba375aa0f 102 err_t pbuf_free_callback(struct pbuf *p);
shintamainjp 0:521ba375aa0f 103 err_t mem_free_callback(void *m);
shintamainjp 0:521ba375aa0f 104
shintamainjp 0:521ba375aa0f 105 #if LWIP_TCPIP_TIMEOUT
shintamainjp 0:521ba375aa0f 106 err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg);
shintamainjp 0:521ba375aa0f 107 err_t tcpip_untimeout(sys_timeout_handler h, void *arg);
shintamainjp 0:521ba375aa0f 108 #endif /* LWIP_TCPIP_TIMEOUT */
shintamainjp 0:521ba375aa0f 109
shintamainjp 0:521ba375aa0f 110 enum tcpip_msg_type {
shintamainjp 0:521ba375aa0f 111 #if LWIP_NETCONN
shintamainjp 0:521ba375aa0f 112 TCPIP_MSG_API,
shintamainjp 0:521ba375aa0f 113 #endif /* LWIP_NETCONN */
shintamainjp 0:521ba375aa0f 114 TCPIP_MSG_INPKT,
shintamainjp 0:521ba375aa0f 115 #if LWIP_NETIF_API
shintamainjp 0:521ba375aa0f 116 TCPIP_MSG_NETIFAPI,
shintamainjp 0:521ba375aa0f 117 #endif /* LWIP_NETIF_API */
shintamainjp 0:521ba375aa0f 118 #if LWIP_TCPIP_TIMEOUT
shintamainjp 0:521ba375aa0f 119 TCPIP_MSG_TIMEOUT,
shintamainjp 0:521ba375aa0f 120 TCPIP_MSG_UNTIMEOUT,
shintamainjp 0:521ba375aa0f 121 #endif /* LWIP_TCPIP_TIMEOUT */
shintamainjp 0:521ba375aa0f 122 TCPIP_MSG_CALLBACK
shintamainjp 0:521ba375aa0f 123 };
shintamainjp 0:521ba375aa0f 124
shintamainjp 0:521ba375aa0f 125 struct tcpip_msg {
shintamainjp 0:521ba375aa0f 126 enum tcpip_msg_type type;
shintamainjp 0:521ba375aa0f 127 sys_sem_t *sem;
shintamainjp 0:521ba375aa0f 128 union {
shintamainjp 0:521ba375aa0f 129 #if LWIP_NETCONN
shintamainjp 0:521ba375aa0f 130 struct api_msg *apimsg;
shintamainjp 0:521ba375aa0f 131 #endif /* LWIP_NETCONN */
shintamainjp 0:521ba375aa0f 132 #if LWIP_NETIF_API
shintamainjp 0:521ba375aa0f 133 struct netifapi_msg *netifapimsg;
shintamainjp 0:521ba375aa0f 134 #endif /* LWIP_NETIF_API */
shintamainjp 0:521ba375aa0f 135 struct {
shintamainjp 0:521ba375aa0f 136 struct pbuf *p;
shintamainjp 0:521ba375aa0f 137 struct netif *netif;
shintamainjp 0:521ba375aa0f 138 } inp;
shintamainjp 0:521ba375aa0f 139 struct {
shintamainjp 0:521ba375aa0f 140 tcpip_callback_fn function;
shintamainjp 0:521ba375aa0f 141 void *ctx;
shintamainjp 0:521ba375aa0f 142 } cb;
shintamainjp 0:521ba375aa0f 143 #if LWIP_TCPIP_TIMEOUT
shintamainjp 0:521ba375aa0f 144 struct {
shintamainjp 0:521ba375aa0f 145 u32_t msecs;
shintamainjp 0:521ba375aa0f 146 sys_timeout_handler h;
shintamainjp 0:521ba375aa0f 147 void *arg;
shintamainjp 0:521ba375aa0f 148 } tmo;
shintamainjp 0:521ba375aa0f 149 #endif /* LWIP_TCPIP_TIMEOUT */
shintamainjp 0:521ba375aa0f 150 } msg;
shintamainjp 0:521ba375aa0f 151 };
shintamainjp 0:521ba375aa0f 152
shintamainjp 0:521ba375aa0f 153 #ifdef __cplusplus
shintamainjp 0:521ba375aa0f 154 }
shintamainjp 0:521ba375aa0f 155 #endif
shintamainjp 0:521ba375aa0f 156
shintamainjp 0:521ba375aa0f 157 #endif /* !NO_SYS */
shintamainjp 0:521ba375aa0f 158
shintamainjp 0:521ba375aa0f 159 #endif /* __LWIP_TCPIP_H__ */