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 /*
shintamainjp 0:521ba375aa0f 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
shintamainjp 0:521ba375aa0f 4
shintamainjp 0:521ba375aa0f 5 Permission is hereby granted, free of charge, to any person obtaining a copy
shintamainjp 0:521ba375aa0f 6 of this software and associated documentation files (the "Software"), to deal
shintamainjp 0:521ba375aa0f 7 in the Software without restriction, including without limitation the rights
shintamainjp 0:521ba375aa0f 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
shintamainjp 0:521ba375aa0f 9 copies of the Software, and to permit persons to whom the Software is
shintamainjp 0:521ba375aa0f 10 furnished to do so, subject to the following conditions:
shintamainjp 0:521ba375aa0f 11
shintamainjp 0:521ba375aa0f 12 The above copyright notice and this permission notice shall be included in
shintamainjp 0:521ba375aa0f 13 all copies or substantial portions of the Software.
shintamainjp 0:521ba375aa0f 14
shintamainjp 0:521ba375aa0f 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
shintamainjp 0:521ba375aa0f 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
shintamainjp 0:521ba375aa0f 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
shintamainjp 0:521ba375aa0f 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
shintamainjp 0:521ba375aa0f 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
shintamainjp 0:521ba375aa0f 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
shintamainjp 0:521ba375aa0f 21 THE SOFTWARE.
shintamainjp 0:521ba375aa0f 22 */
shintamainjp 0:521ba375aa0f 23
shintamainjp 0:521ba375aa0f 24 #ifndef NET_H
shintamainjp 0:521ba375aa0f 25 #define NET_H
shintamainjp 0:521ba375aa0f 26
shintamainjp 0:521ba375aa0f 27 class NetIf;
shintamainjp 0:521ba375aa0f 28 class NetTcpSocket;
shintamainjp 0:521ba375aa0f 29 class NetUdpSocket;
shintamainjp 0:521ba375aa0f 30 class NetDnsRequest;
shintamainjp 0:521ba375aa0f 31
shintamainjp 0:521ba375aa0f 32 #include <list>
shintamainjp 0:521ba375aa0f 33 using std::list;
shintamainjp 0:521ba375aa0f 34
shintamainjp 0:521ba375aa0f 35 /*
shintamainjp 0:521ba375aa0f 36 #include "host.h"
shintamainjp 0:521ba375aa0f 37 #include "ipaddr.h"
shintamainjp 0:521ba375aa0f 38 #include "netservice.h"
shintamainjp 0:521ba375aa0f 39 #include "if/net/netif.h"
shintamainjp 0:521ba375aa0f 40 #include "if/net/nettcpsocket.h"
shintamainjp 0:521ba375aa0f 41 #include "if/net/netudpsocket.h"
shintamainjp 0:521ba375aa0f 42 #include "if/net/netdnsrequest.h"
shintamainjp 0:521ba375aa0f 43 */
shintamainjp 0:521ba375aa0f 44
shintamainjp 0:521ba375aa0f 45 class Host;
shintamainjp 0:521ba375aa0f 46 class NetIf;
shintamainjp 0:521ba375aa0f 47 class NetTcpSocket;
shintamainjp 0:521ba375aa0f 48 class NetUdpSocket;
shintamainjp 0:521ba375aa0f 49 class NetDnsRequest;
shintamainjp 0:521ba375aa0f 50
shintamainjp 0:521ba375aa0f 51 class Net
shintamainjp 0:521ba375aa0f 52 {
shintamainjp 0:521ba375aa0f 53 private:
shintamainjp 0:521ba375aa0f 54 Net();
shintamainjp 0:521ba375aa0f 55 ~Net();
shintamainjp 0:521ba375aa0f 56 public:
shintamainjp 0:521ba375aa0f 57 static void poll(); //Poll every if & socket
shintamainjp 0:521ba375aa0f 58
shintamainjp 0:521ba375aa0f 59 static NetTcpSocket* tcpSocket(NetIf& netif);
shintamainjp 0:521ba375aa0f 60 static NetTcpSocket* tcpSocket(); //Socket on default if
shintamainjp 0:521ba375aa0f 61 static void releaseTcpSocket(NetTcpSocket* pNetTcpSocket);
shintamainjp 0:521ba375aa0f 62
shintamainjp 0:521ba375aa0f 63 static NetUdpSocket* udpSocket(NetIf& netif);
shintamainjp 0:521ba375aa0f 64 static NetUdpSocket* udpSocket(); //Socket on default if
shintamainjp 0:521ba375aa0f 65 static void releaseUdpSocket(NetUdpSocket* pNetUdpSocket);
shintamainjp 0:521ba375aa0f 66
shintamainjp 0:521ba375aa0f 67 static NetDnsRequest* dnsRequest(const char* hostname, NetIf& netif);
shintamainjp 0:521ba375aa0f 68 static NetDnsRequest* dnsRequest(const char* hostname); //Create a new NetDnsRequest object from default if
shintamainjp 0:521ba375aa0f 69
shintamainjp 0:521ba375aa0f 70 static NetDnsRequest* dnsRequest(Host* pHost, NetIf& netif);
shintamainjp 0:521ba375aa0f 71 static NetDnsRequest* dnsRequest(Host* pHost); //Create a new NetDnsRequest object from default if
shintamainjp 0:521ba375aa0f 72
shintamainjp 0:521ba375aa0f 73 static void setDefaultIf(NetIf& netif); //Deprecated
shintamainjp 0:521ba375aa0f 74 static void setDefaultIf(NetIf* pIf);
shintamainjp 0:521ba375aa0f 75 static NetIf* getDefaultIf();
shintamainjp 0:521ba375aa0f 76
shintamainjp 0:521ba375aa0f 77 protected:
shintamainjp 0:521ba375aa0f 78 friend class NetIf;
shintamainjp 0:521ba375aa0f 79 friend class NetTcpSocket;
shintamainjp 0:521ba375aa0f 80 friend class NetUdpSocket;
shintamainjp 0:521ba375aa0f 81
shintamainjp 0:521ba375aa0f 82 static void registerIf(NetIf* pIf);
shintamainjp 0:521ba375aa0f 83 static void unregisterIf(NetIf* pIf);
shintamainjp 0:521ba375aa0f 84
shintamainjp 0:521ba375aa0f 85 static void registerNetTcpSocket(NetTcpSocket* pNetTcpSocket);
shintamainjp 0:521ba375aa0f 86 static void unregisterNetTcpSocket(NetTcpSocket* pNetTcpSocket);
shintamainjp 0:521ba375aa0f 87
shintamainjp 0:521ba375aa0f 88 static void registerNetUdpSocket(NetUdpSocket* pNetUdpSocket);
shintamainjp 0:521ba375aa0f 89 static void unregisterNetUdpSocket(NetUdpSocket* pNetUdpSocket);
shintamainjp 0:521ba375aa0f 90
shintamainjp 0:521ba375aa0f 91 private:
shintamainjp 0:521ba375aa0f 92 static Net& net(); //Return inst of singleton
shintamainjp 0:521ba375aa0f 93
shintamainjp 0:521ba375aa0f 94 NetIf* m_defaultIf;
shintamainjp 0:521ba375aa0f 95
shintamainjp 0:521ba375aa0f 96 list<NetIf*> m_lpIf;
shintamainjp 0:521ba375aa0f 97 list<NetTcpSocket*> m_lpNetTcpSocket;
shintamainjp 0:521ba375aa0f 98 list<NetUdpSocket*> m_lpNetUdpSocket;
shintamainjp 0:521ba375aa0f 99 };
shintamainjp 0:521ba375aa0f 100
shintamainjp 0:521ba375aa0f 101 #endif