custom for >5 resources
Fork of mbedConnectorInterface by
api/Options.h@0:b438482ebbfc, 2015-01-27 (annotated)
- Committer:
- ansond
- Date:
- Tue Jan 27 22:23:51 2015 +0000
- Revision:
- 0:b438482ebbfc
- Child:
- 2:853f9ecc12df
initial check in
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 0:b438482ebbfc | 1 | /** |
ansond | 0:b438482ebbfc | 2 | * @file Options.h |
ansond | 0:b438482ebbfc | 3 | * @brief mbed CoAP Options (immutable OptionsBuilder instance) class header |
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 __OPTIONS_H__ |
ansond | 0:b438482ebbfc | 24 | #define __OPTIONS_H__ |
ansond | 0:b438482ebbfc | 25 | |
ansond | 0:b438482ebbfc | 26 | // Static Resources |
ansond | 0:b438482ebbfc | 27 | #include "StaticResource.h" |
ansond | 0:b438482ebbfc | 28 | |
ansond | 0:b438482ebbfc | 29 | // Dynamic Resources |
ansond | 0:b438482ebbfc | 30 | #include "DynamicResource.h" |
ansond | 0:b438482ebbfc | 31 | |
ansond | 0:b438482ebbfc | 32 | // include the mbed connector resource list |
ansond | 0:b438482ebbfc | 33 | #include "mbedConnectorInterface.h" |
ansond | 0:b438482ebbfc | 34 | |
ansond | 0:b438482ebbfc | 35 | // Vector support |
ansond | 0:b438482ebbfc | 36 | #include <vector> |
ansond | 0:b438482ebbfc | 37 | |
ansond | 0:b438482ebbfc | 38 | // Resources list |
ansond | 0:b438482ebbfc | 39 | typedef vector<StaticResource *> StaticResourcesList; |
ansond | 0:b438482ebbfc | 40 | typedef vector<DynamicResource *> DynamicResourcesList; |
ansond | 0:b438482ebbfc | 41 | |
ansond | 0:b438482ebbfc | 42 | namespace Connector { |
ansond | 0:b438482ebbfc | 43 | class Options { |
ansond | 0:b438482ebbfc | 44 | public: |
ansond | 0:b438482ebbfc | 45 | /** |
ansond | 0:b438482ebbfc | 46 | Default constructor |
ansond | 0:b438482ebbfc | 47 | */ |
ansond | 0:b438482ebbfc | 48 | Options(); |
ansond | 0:b438482ebbfc | 49 | |
ansond | 0:b438482ebbfc | 50 | /** |
ansond | 0:b438482ebbfc | 51 | Copy constructor |
ansond | 0:b438482ebbfc | 52 | */ |
ansond | 0:b438482ebbfc | 53 | Options(const Options &opt); |
ansond | 0:b438482ebbfc | 54 | |
ansond | 0:b438482ebbfc | 55 | /** |
ansond | 0:b438482ebbfc | 56 | Destructor |
ansond | 0:b438482ebbfc | 57 | */ |
ansond | 0:b438482ebbfc | 58 | virtual ~Options(); |
ansond | 0:b438482ebbfc | 59 | |
ansond | 0:b438482ebbfc | 60 | /** |
ansond | 0:b438482ebbfc | 61 | Get the node lifetime |
ansond | 0:b438482ebbfc | 62 | */ |
ansond | 0:b438482ebbfc | 63 | char *getLifetime(); |
ansond | 0:b438482ebbfc | 64 | |
ansond | 0:b438482ebbfc | 65 | /** |
ansond | 0:b438482ebbfc | 66 | Get the NSP domain |
ansond | 0:b438482ebbfc | 67 | */ |
ansond | 0:b438482ebbfc | 68 | string getDomain(); |
ansond | 0:b438482ebbfc | 69 | |
ansond | 0:b438482ebbfc | 70 | /** |
ansond | 0:b438482ebbfc | 71 | Get the node name |
ansond | 0:b438482ebbfc | 72 | */ |
ansond | 0:b438482ebbfc | 73 | string getEndpointNodename(); |
ansond | 0:b438482ebbfc | 74 | |
ansond | 0:b438482ebbfc | 75 | /** |
ansond | 0:b438482ebbfc | 76 | Get the node type |
ansond | 0:b438482ebbfc | 77 | */ |
ansond | 0:b438482ebbfc | 78 | string getEndpointType(); |
ansond | 0:b438482ebbfc | 79 | |
ansond | 0:b438482ebbfc | 80 | /** |
ansond | 0:b438482ebbfc | 81 | Get the NSP port number |
ansond | 0:b438482ebbfc | 82 | */ |
ansond | 0:b438482ebbfc | 83 | int getNSPPortNumber(); |
ansond | 0:b438482ebbfc | 84 | |
ansond | 0:b438482ebbfc | 85 | /** |
ansond | 0:b438482ebbfc | 86 | Get the node radio channel list |
ansond | 0:b438482ebbfc | 87 | */ |
ansond | 0:b438482ebbfc | 88 | uint32_t setRadioChannelList(); |
ansond | 0:b438482ebbfc | 89 | |
ansond | 0:b438482ebbfc | 90 | /** |
ansond | 0:b438482ebbfc | 91 | Get the NSP read update period |
ansond | 0:b438482ebbfc | 92 | */ |
ansond | 0:b438482ebbfc | 93 | int getReadUpdatePeriod(); |
ansond | 0:b438482ebbfc | 94 | |
ansond | 0:b438482ebbfc | 95 | /** |
ansond | 0:b438482ebbfc | 96 | Get the NSP address |
ansond | 0:b438482ebbfc | 97 | */ |
ansond | 0:b438482ebbfc | 98 | uint8_t *getNSPAddress(); |
ansond | 0:b438482ebbfc | 99 | |
ansond | 0:b438482ebbfc | 100 | /** |
ansond | 0:b438482ebbfc | 101 | Get the node MAC address |
ansond | 0:b438482ebbfc | 102 | */ |
ansond | 0:b438482ebbfc | 103 | uint8_t *setMACAddress(); |
ansond | 0:b438482ebbfc | 104 | |
ansond | 0:b438482ebbfc | 105 | /** |
ansond | 0:b438482ebbfc | 106 | Get the list of static resources |
ansond | 0:b438482ebbfc | 107 | */ |
ansond | 0:b438482ebbfc | 108 | StaticResourcesList *getStaticResourceList(); |
ansond | 0:b438482ebbfc | 109 | |
ansond | 0:b438482ebbfc | 110 | /** |
ansond | 0:b438482ebbfc | 111 | Get the list of dynamic resources |
ansond | 0:b438482ebbfc | 112 | */ |
ansond | 0:b438482ebbfc | 113 | DynamicResourcesList *getDynamicResourceList(); |
ansond | 0:b438482ebbfc | 114 | |
ansond | 0:b438482ebbfc | 115 | protected: |
ansond | 0:b438482ebbfc | 116 | char *m_lifetime; |
ansond | 0:b438482ebbfc | 117 | string m_domain; |
ansond | 0:b438482ebbfc | 118 | string m_node_name; |
ansond | 0:b438482ebbfc | 119 | string m_endpoint_type; |
ansond | 0:b438482ebbfc | 120 | uint32_t m_channel_list; |
ansond | 0:b438482ebbfc | 121 | int m_rd_update_period; |
ansond | 0:b438482ebbfc | 122 | int m_nsp_port; |
ansond | 0:b438482ebbfc | 123 | uint8_t m_nsp_address[NSP_IP_ADDRESS_LENGTH]; |
ansond | 0:b438482ebbfc | 124 | uint8_t m_mac_address[NODE_MAC_ADDRESS_LENGTH]; |
ansond | 0:b438482ebbfc | 125 | StaticResourcesList m_static_resources; |
ansond | 0:b438482ebbfc | 126 | DynamicResourcesList m_dynamic_resources; |
ansond | 0:b438482ebbfc | 127 | }; |
ansond | 0:b438482ebbfc | 128 | } |
ansond | 0:b438482ebbfc | 129 | |
ansond | 0:b438482ebbfc | 130 | #endif // __OPTIONS_H__ |