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 /**
shintamainjp 0:521ba375aa0f 25 \file Net Service base class header file
shintamainjp 0:521ba375aa0f 26 */
shintamainjp 0:521ba375aa0f 27
shintamainjp 0:521ba375aa0f 28 #ifndef NETSERVICE_H
shintamainjp 0:521ba375aa0f 29 #define NETSERVICE_H
shintamainjp 0:521ba375aa0f 30
shintamainjp 0:521ba375aa0f 31 #include <list>
shintamainjp 0:521ba375aa0f 32 using std::list;
shintamainjp 0:521ba375aa0f 33
shintamainjp 0:521ba375aa0f 34 ///Net Service base class
shintamainjp 0:521ba375aa0f 35 /**
shintamainjp 0:521ba375aa0f 36 Each connection-oriented object can register as service (by inheriting this class), so that it is polled regularly.
shintamainjp 0:521ba375aa0f 37 It notifies the pool when the connection is terminated so that it can be destroyed.
shintamainjp 0:521ba375aa0f 38 */
shintamainjp 0:521ba375aa0f 39 class NetService
shintamainjp 0:521ba375aa0f 40 {
shintamainjp 0:521ba375aa0f 41 public:
shintamainjp 0:521ba375aa0f 42 ///Instantiates a new service
shintamainjp 0:521ba375aa0f 43 /**
shintamainjp 0:521ba375aa0f 44 @param owned If true the object is owned by the pool and will be destroyed on closure.
shintamainjp 0:521ba375aa0f 45 */
shintamainjp 0:521ba375aa0f 46 NetService(bool owned = true); //Is owned by the pool?
shintamainjp 0:521ba375aa0f 47 virtual ~NetService();
shintamainjp 0:521ba375aa0f 48
shintamainjp 0:521ba375aa0f 49 ///This method can be inherited so that it is called on each @a Net::poll() call.
shintamainjp 0:521ba375aa0f 50 virtual void poll();
shintamainjp 0:521ba375aa0f 51
shintamainjp 0:521ba375aa0f 52 static void servicesPoll(); //Poll all registered services & destroy closed ones
shintamainjp 0:521ba375aa0f 53
shintamainjp 0:521ba375aa0f 54 protected:
shintamainjp 0:521ba375aa0f 55 ///This flags the service as to be destructed if owned by the pool.
shintamainjp 0:521ba375aa0f 56 void close();
shintamainjp 0:521ba375aa0f 57
shintamainjp 0:521ba375aa0f 58 private:
shintamainjp 0:521ba375aa0f 59 bool m_closed;
shintamainjp 0:521ba375aa0f 60 bool m_removed;
shintamainjp 0:521ba375aa0f 61 bool m_owned;
shintamainjp 0:521ba375aa0f 62
shintamainjp 0:521ba375aa0f 63 static list<NetService*>& lpServices(); //Helper to prevent static initialization fiasco
shintamainjp 0:521ba375aa0f 64
shintamainjp 0:521ba375aa0f 65 };
shintamainjp 0:521ba375aa0f 66
shintamainjp 0:521ba375aa0f 67 #endif