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