Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbedConnectorInterface by
Options.h
00001 /** 00002 * @file Options.h 00003 * @brief mbed CoAP Options (immutable OptionsBuilder instance) class header 00004 * @author Doug Anson/Chris Paola 00005 * @version 1.0 00006 * @see 00007 * 00008 * Copyright (c) 2014 00009 * 00010 * Licensed under the Apache License, Version 2.0 (the "License"); 00011 * you may not use this file except in compliance with the License. 00012 * You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, software 00017 * distributed under the License is distributed on an "AS IS" BASIS, 00018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 * See the License for the specific language governing permissions and 00020 * limitations under the License. 00021 */ 00022 00023 #ifndef __OPTIONS_H__ 00024 #define __OPTIONS_H__ 00025 00026 // Static Resources 00027 #include "StaticResource.h" 00028 00029 // Dynamic Resources 00030 #include "DynamicResource.h" 00031 00032 // include the mbed connector resource list 00033 #include "mbedConnectorInterface.h" 00034 00035 // determine if we have seen rtos.h yet or not... 00036 #ifdef RTOS_H 00037 // we will use the ThreadedResourceObserver if needed 00038 #define CONNECTOR_USING_THREADS 1 00039 #endif 00040 00041 // include the resource observer includes here so that they are not required in main.cpp 00042 #include "ThreadedResourceObserver.h" 00043 #include "TickerResourceObserver.h" 00044 00045 // Vector support 00046 #include <vector> 00047 00048 // Resources list 00049 typedef vector<StaticResource *> StaticResourcesList; 00050 typedef vector<DynamicResource *> DynamicResourcesList; 00051 typedef vector<ResourceObserver *> ResourceObserversList; 00052 00053 // WiFi Security types 00054 typedef enum { 00055 WIFI_WPA_PERSONAL, 00056 WIFI_WPA2_PERSONAL, 00057 WIFI_WEP, 00058 WIFI_NUM_TYPES 00059 } WiFiAuthTypes; 00060 00061 namespace Connector { 00062 00063 /** Options class 00064 */ 00065 class Options 00066 { 00067 public: 00068 /** 00069 Default constructor 00070 */ 00071 Options(); 00072 00073 /** 00074 Copy constructor 00075 */ 00076 Options(const Options &opt); 00077 00078 /** 00079 Destructor 00080 */ 00081 virtual ~Options(); 00082 00083 /** 00084 Get the node lifetime 00085 */ 00086 char *getLifetime(); 00087 00088 /** 00089 Get the NSP domain 00090 */ 00091 string getDomain(); 00092 00093 /** 00094 Get the node name 00095 */ 00096 string getEndpointNodename(); 00097 00098 /** 00099 Get the node type 00100 */ 00101 string getEndpointType(); 00102 00103 /** 00104 Get the NSP port number 00105 */ 00106 int getNSPPortNumber(); 00107 00108 /** 00109 Get the node radio channel list 00110 */ 00111 uint32_t getRadioChannelList(); 00112 00113 /** 00114 Get the NSP read update period 00115 */ 00116 int getReadUpdatePeriod(); 00117 00118 /** 00119 Get the NSP address 00120 */ 00121 uint8_t *getNSPAddress(); 00122 00123 /** 00124 Get the node MAC address 00125 */ 00126 uint8_t *getMACAddress(); 00127 00128 /** 00129 Get the list of static resources 00130 */ 00131 StaticResourcesList *getStaticResourceList(); 00132 00133 /** 00134 Get the list of dynamic resources 00135 */ 00136 DynamicResourcesList *getDynamicResourceList(); 00137 00138 /** 00139 Get the WiFi SSID 00140 */ 00141 string getWiFiSSID(); 00142 00143 /** 00144 Get the WiFi Auth Type 00145 */ 00146 WiFiAuthTypes getWiFiAuthType(); 00147 00148 /** 00149 Get the WiFi Auth Key 00150 */ 00151 string getWiFiAuthKey(); 00152 00153 /** 00154 Get the 802.15.4 Network ID 00155 */ 00156 string getNetworkID(); 00157 00158 /** 00159 Get the 802.15.4 Radio channel 00160 */ 00161 uint8_t getRadioChannel(); 00162 00163 /** 00164 Enable/Disable Immediate Observationing 00165 */ 00166 bool immedateObservationEnabled(); 00167 00168 /** 00169 Enable/Disable Observation control via GET 00170 */ 00171 bool enableGETObservationControl(); 00172 00173 protected: 00174 // mDS Resources 00175 char *m_lifetime; 00176 string m_domain; 00177 string m_node_name; 00178 string m_endpoint_type; 00179 int m_rd_update_period; 00180 int m_nsp_port; 00181 uint8_t m_nsp_address[NSP_IP_ADDRESS_LENGTH]; 00182 00183 // WiFi Resources 00184 string m_wifi_ssid; 00185 string m_wifi_auth_key; 00186 WiFiAuthTypes m_wifi_auth_type; 00187 00188 // 802.15.4 Resources 00189 string m_network_id; 00190 uint32_t m_channel_list; 00191 uint8_t m_mac_address[NODE_MAC_ADDRESS_LENGTH]; 00192 uint8_t m_channel; 00193 00194 // CoAP behavior adjustments 00195 bool m_enable_immediate_observation; 00196 bool m_enable_get_obs_control; 00197 00198 // Endpoint Resources 00199 StaticResourcesList m_static_resources; 00200 DynamicResourcesList m_dynamic_resources; 00201 ResourceObserversList m_resource_observers; 00202 }; 00203 00204 } // namespace Connector 00205 00206 #endif // __OPTIONS_H__
Generated on Wed Jul 13 2022 02:58:57 by
1.7.2
