Doug Anson / mbedConnectorInterface

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

Committer:
ansond
Date:
Tue Jan 27 22:52:25 2015 +0000
Revision:
1:cabdd0350707
Parent:
0:b438482ebbfc
Child:
2:853f9ecc12df
updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:b438482ebbfc 1 /**
ansond 0:b438482ebbfc 2 * @file Endpoint.h
ansond 0:b438482ebbfc 3 * @brief mbed CoAP Endpoint base class
ansond 0:b438482ebbfc 4 * @author Doug Anson/Chris Paola
ansond 0:b438482ebbfc 5 * @version 1.0
ansond 0:b438482ebbfc 6 * @see
ansond 0:b438482ebbfc 7 *
ansond 0:b438482ebbfc 8 * Copyright (c) 2014
ansond 0:b438482ebbfc 9 *
ansond 0:b438482ebbfc 10 * Licensed under the Apache License, Version 2.0 (the "License");
ansond 0:b438482ebbfc 11 * you may not use this file except in compliance with the License.
ansond 0:b438482ebbfc 12 * You may obtain a copy of the License at
ansond 0:b438482ebbfc 13 *
ansond 0:b438482ebbfc 14 * http://www.apache.org/licenses/LICENSE-2.0
ansond 0:b438482ebbfc 15 *
ansond 0:b438482ebbfc 16 * Unless required by applicable law or agreed to in writing, software
ansond 0:b438482ebbfc 17 * distributed under the License is distributed on an "AS IS" BASIS,
ansond 0:b438482ebbfc 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ansond 0:b438482ebbfc 19 * See the License for the specific language governing permissions and
ansond 0:b438482ebbfc 20 * limitations under the License.
ansond 0:b438482ebbfc 21 */
ansond 0:b438482ebbfc 22
ansond 0:b438482ebbfc 23 #ifndef __ENDPOINT_H__
ansond 0:b438482ebbfc 24 #define __ENDPOINT_H__
ansond 0:b438482ebbfc 25
ansond 0:b438482ebbfc 26 // Support for Logging/Debug output
ansond 0:b438482ebbfc 27 #include "Logger.h"
ansond 0:b438482ebbfc 28
ansond 0:b438482ebbfc 29 // Options support
ansond 0:b438482ebbfc 30 #include "Options.h"
ansond 0:b438482ebbfc 31
ansond 0:b438482ebbfc 32 // Connector namespace
ansond 0:b438482ebbfc 33 namespace Connector {
ansond 0:b438482ebbfc 34
ansond 0:b438482ebbfc 35 class Endpoint {
ansond 0:b438482ebbfc 36
ansond 0:b438482ebbfc 37 public:
ansond 0:b438482ebbfc 38 /**
ansond 0:b438482ebbfc 39 Default Constructor
ansond 0:b438482ebbfc 40 */
ansond 0:b438482ebbfc 41 Endpoint(const Logger *logger,const Options *ob);
ansond 0:b438482ebbfc 42
ansond 0:b438482ebbfc 43 /**
ansond 0:b438482ebbfc 44 Copy Constructor
ansond 0:b438482ebbfc 45 @param ob input endpoint instance to deep copy
ansond 0:b438482ebbfc 46 */
ansond 0:b438482ebbfc 47 Endpoint(const Endpoint &ep);
ansond 0:b438482ebbfc 48
ansond 0:b438482ebbfc 49 /**
ansond 0:b438482ebbfc 50 Destructor
ansond 0:b438482ebbfc 51 */
ansond 0:b438482ebbfc 52 virtual ~Endpoint();
ansond 0:b438482ebbfc 53
ansond 0:b438482ebbfc 54 /**
ansond 0:b438482ebbfc 55 Plumb the underlying network
ansond 0:b438482ebbfc 56 @param canActAsRouterNode input boolean indicating whether this node can act as a router node or not.
ansond 0:b438482ebbfc 57 */
ansond 0:b438482ebbfc 58 static void plumbNetwork(bool canActAsRouterNode = false);
ansond 0:b438482ebbfc 59
ansond 0:b438482ebbfc 60 /**
ansond 0:b438482ebbfc 61 Initialize the endpoint
ansond 0:b438482ebbfc 62 */
ansond 0:b438482ebbfc 63 void initialize();
ansond 0:b438482ebbfc 64
ansond 0:b438482ebbfc 65 /**
ansond 1:cabdd0350707 66 Finalize the endpoint's configuration and begin the endpoint's main even loop
ansond 0:b438482ebbfc 67 */
ansond 1:cabdd0350707 68 static void start();
ansond 0:b438482ebbfc 69
ansond 0:b438482ebbfc 70 protected:
ansond 0:b438482ebbfc 71
ansond 0:b438482ebbfc 72 private:
ansond 0:b438482ebbfc 73 Logger *m_logger;
ansond 0:b438482ebbfc 74 Options *m_options;
ansond 0:b438482ebbfc 75
ansond 0:b438482ebbfc 76 // initialize the NSDL network
ansond 0:b438482ebbfc 77 void initNetwork();
ansond 0:b438482ebbfc 78
ansond 0:b438482ebbfc 79 // access the logger
ansond 0:b438482ebbfc 80 Logger *logger();
ansond 0:b438482ebbfc 81 };
ansond 0:b438482ebbfc 82 }
ansond 0:b438482ebbfc 83
ansond 0:b438482ebbfc 84 #endif // __ENDPOINT_H__