Doug Anson / mbedConnectorInterface

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

Committer:
ansond
Date:
Wed Jan 28 14:43:46 2015 +0000
Revision:
5:a929d65eb385
Parent:
2:853f9ecc12df
updates should be close to final

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
sam_grove 2:853f9ecc12df 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 */
sam_grove 2:853f9ecc12df 22
sam_grove 2:853f9ecc12df 23 #ifndef __ENDPOINT_H__
sam_grove 2:853f9ecc12df 24 #define __ENDPOINT_H__
sam_grove 2:853f9ecc12df 25
sam_grove 2:853f9ecc12df 26 // Support for Logging/Debug output
sam_grove 2:853f9ecc12df 27 #include "Logger.h"
sam_grove 2:853f9ecc12df 28
sam_grove 2:853f9ecc12df 29 // Options support
sam_grove 2:853f9ecc12df 30 #include "Options.h"
sam_grove 2:853f9ecc12df 31
sam_grove 2:853f9ecc12df 32 // Connector namespace
sam_grove 2:853f9ecc12df 33 namespace Connector {
sam_grove 2:853f9ecc12df 34
sam_grove 2:853f9ecc12df 35 /** Endpoint class
sam_grove 2:853f9ecc12df 36 */
sam_grove 2:853f9ecc12df 37 class Endpoint
sam_grove 2:853f9ecc12df 38 {
sam_grove 2:853f9ecc12df 39
sam_grove 2:853f9ecc12df 40 public:
sam_grove 2:853f9ecc12df 41 /**
sam_grove 2:853f9ecc12df 42 Default Constructor
sam_grove 2:853f9ecc12df 43 */
sam_grove 2:853f9ecc12df 44 Endpoint(const Logger *logger,const Options *ob);
sam_grove 2:853f9ecc12df 45
sam_grove 2:853f9ecc12df 46 /**
sam_grove 2:853f9ecc12df 47 Copy Constructor
sam_grove 2:853f9ecc12df 48 @param ob input endpoint instance to deep copy
sam_grove 2:853f9ecc12df 49 */
sam_grove 2:853f9ecc12df 50 Endpoint(const Endpoint &ep);
sam_grove 2:853f9ecc12df 51
sam_grove 2:853f9ecc12df 52 /**
sam_grove 2:853f9ecc12df 53 Destructor
sam_grove 2:853f9ecc12df 54 */
sam_grove 2:853f9ecc12df 55 virtual ~Endpoint();
sam_grove 2:853f9ecc12df 56
sam_grove 2:853f9ecc12df 57 /**
ansond 5:a929d65eb385 58 Initialize the endpoint configuration
sam_grove 2:853f9ecc12df 59 */
sam_grove 2:853f9ecc12df 60 void initialize();
sam_grove 2:853f9ecc12df 61
sam_grove 2:853f9ecc12df 62 /**
ansond 5:a929d65eb385 63 Plumb the lower RF network stack
ansond 5:a929d65eb385 64 @param canActAsRouterNode input boolean indicating whether this node can act as a router node or not.
ansond 5:a929d65eb385 65 */
ansond 5:a929d65eb385 66 static void plumbNetwork(bool canActAsRouterNode = false);
ansond 5:a929d65eb385 67
ansond 5:a929d65eb385 68 /**
ansond 5:a929d65eb385 69 Initialize the endpoint's configuration and begin the endpoint's main even loop
sam_grove 2:853f9ecc12df 70 */
sam_grove 2:853f9ecc12df 71 static void start();
sam_grove 2:853f9ecc12df 72
sam_grove 2:853f9ecc12df 73 private:
sam_grove 2:853f9ecc12df 74 Logger *m_logger;
sam_grove 2:853f9ecc12df 75 Options *m_options;
ansond 5:a929d65eb385 76
sam_grove 2:853f9ecc12df 77 // initialize the NSDL network
sam_grove 2:853f9ecc12df 78 void initNetwork();
sam_grove 2:853f9ecc12df 79
sam_grove 2:853f9ecc12df 80 // access the logger
sam_grove 2:853f9ecc12df 81 Logger *logger();
sam_grove 2:853f9ecc12df 82 };
sam_grove 2:853f9ecc12df 83
sam_grove 2:853f9ecc12df 84 } // namespace Connector
sam_grove 2:853f9ecc12df 85
sam_grove 2:853f9ecc12df 86 #endif // __ENDPOINT_H__