custom for >5 resources

Fork of mbedConnectorInterface by Doug Anson

Committer:
ansond
Date:
Tue Feb 24 02:05:06 2015 +0000
Revision:
19:e2cbaeeea509
Parent:
15:8ada80242804
Child:
42:20c375e74e8e
added additional 802.15.4 configuration support

Who changed what in which revision?

UserRevisionLine numberNew 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
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 __OPTIONS_H__
sam_grove 2:853f9ecc12df 24 #define __OPTIONS_H__
sam_grove 2:853f9ecc12df 25
sam_grove 2:853f9ecc12df 26 // Static Resources
sam_grove 2:853f9ecc12df 27 #include "StaticResource.h"
sam_grove 2:853f9ecc12df 28
sam_grove 2:853f9ecc12df 29 // Dynamic Resources
sam_grove 2:853f9ecc12df 30 #include "DynamicResource.h"
sam_grove 2:853f9ecc12df 31
sam_grove 2:853f9ecc12df 32 // include the mbed connector resource list
sam_grove 2:853f9ecc12df 33 #include "mbedConnectorInterface.h"
sam_grove 2:853f9ecc12df 34
sam_grove 2:853f9ecc12df 35 // Vector support
sam_grove 2:853f9ecc12df 36 #include <vector>
sam_grove 2:853f9ecc12df 37
sam_grove 2:853f9ecc12df 38 // Resources list
sam_grove 2:853f9ecc12df 39 typedef vector<StaticResource *> StaticResourcesList;
sam_grove 2:853f9ecc12df 40 typedef vector<DynamicResource *> DynamicResourcesList;
sam_grove 2:853f9ecc12df 41
ansond 15:8ada80242804 42 // WiFi Security types
ansond 15:8ada80242804 43 typedef enum {
ansond 15:8ada80242804 44 WIFI_WPA_PERSONAL,
ansond 15:8ada80242804 45 WIFI_WPA2_PERSONAL,
ansond 15:8ada80242804 46 WIFI_WEP,
ansond 15:8ada80242804 47 WIFI_NUM_TYPES
ansond 15:8ada80242804 48 } WiFiAuthTypes;
ansond 15:8ada80242804 49
sam_grove 2:853f9ecc12df 50 namespace Connector {
sam_grove 2:853f9ecc12df 51
sam_grove 2:853f9ecc12df 52 /** Options class
sam_grove 2:853f9ecc12df 53 */
sam_grove 2:853f9ecc12df 54 class Options
sam_grove 2:853f9ecc12df 55 {
sam_grove 2:853f9ecc12df 56 public:
sam_grove 2:853f9ecc12df 57 /**
sam_grove 2:853f9ecc12df 58 Default constructor
sam_grove 2:853f9ecc12df 59 */
sam_grove 2:853f9ecc12df 60 Options();
sam_grove 2:853f9ecc12df 61
sam_grove 2:853f9ecc12df 62 /**
sam_grove 2:853f9ecc12df 63 Copy constructor
sam_grove 2:853f9ecc12df 64 */
sam_grove 2:853f9ecc12df 65 Options(const Options &opt);
sam_grove 2:853f9ecc12df 66
sam_grove 2:853f9ecc12df 67 /**
sam_grove 2:853f9ecc12df 68 Destructor
sam_grove 2:853f9ecc12df 69 */
sam_grove 2:853f9ecc12df 70 virtual ~Options();
sam_grove 2:853f9ecc12df 71
sam_grove 2:853f9ecc12df 72 /**
sam_grove 2:853f9ecc12df 73 Get the node lifetime
sam_grove 2:853f9ecc12df 74 */
sam_grove 2:853f9ecc12df 75 char *getLifetime();
sam_grove 2:853f9ecc12df 76
sam_grove 2:853f9ecc12df 77 /**
sam_grove 2:853f9ecc12df 78 Get the NSP domain
sam_grove 2:853f9ecc12df 79 */
sam_grove 2:853f9ecc12df 80 string getDomain();
sam_grove 2:853f9ecc12df 81
sam_grove 2:853f9ecc12df 82 /**
sam_grove 2:853f9ecc12df 83 Get the node name
sam_grove 2:853f9ecc12df 84 */
sam_grove 2:853f9ecc12df 85 string getEndpointNodename();
sam_grove 2:853f9ecc12df 86
sam_grove 2:853f9ecc12df 87 /**
sam_grove 2:853f9ecc12df 88 Get the node type
sam_grove 2:853f9ecc12df 89 */
sam_grove 2:853f9ecc12df 90 string getEndpointType();
sam_grove 2:853f9ecc12df 91
sam_grove 2:853f9ecc12df 92 /**
sam_grove 2:853f9ecc12df 93 Get the NSP port number
sam_grove 2:853f9ecc12df 94 */
sam_grove 2:853f9ecc12df 95 int getNSPPortNumber();
sam_grove 2:853f9ecc12df 96
sam_grove 2:853f9ecc12df 97 /**
sam_grove 2:853f9ecc12df 98 Get the node radio channel list
sam_grove 2:853f9ecc12df 99 */
ansond 4:84159d67d32d 100 uint32_t getRadioChannelList();
sam_grove 2:853f9ecc12df 101
sam_grove 2:853f9ecc12df 102 /**
sam_grove 2:853f9ecc12df 103 Get the NSP read update period
sam_grove 2:853f9ecc12df 104 */
sam_grove 2:853f9ecc12df 105 int getReadUpdatePeriod();
sam_grove 2:853f9ecc12df 106
sam_grove 2:853f9ecc12df 107 /**
sam_grove 2:853f9ecc12df 108 Get the NSP address
sam_grove 2:853f9ecc12df 109 */
sam_grove 2:853f9ecc12df 110 uint8_t *getNSPAddress();
sam_grove 2:853f9ecc12df 111
sam_grove 2:853f9ecc12df 112 /**
sam_grove 2:853f9ecc12df 113 Get the node MAC address
sam_grove 2:853f9ecc12df 114 */
ansond 4:84159d67d32d 115 uint8_t *getMACAddress();
sam_grove 2:853f9ecc12df 116
sam_grove 2:853f9ecc12df 117 /**
sam_grove 2:853f9ecc12df 118 Get the list of static resources
sam_grove 2:853f9ecc12df 119 */
sam_grove 2:853f9ecc12df 120 StaticResourcesList *getStaticResourceList();
sam_grove 2:853f9ecc12df 121
sam_grove 2:853f9ecc12df 122 /**
sam_grove 2:853f9ecc12df 123 Get the list of dynamic resources
sam_grove 2:853f9ecc12df 124 */
sam_grove 2:853f9ecc12df 125 DynamicResourcesList *getDynamicResourceList();
ansond 15:8ada80242804 126
ansond 15:8ada80242804 127 /**
ansond 15:8ada80242804 128 Get the WiFi SSID
ansond 15:8ada80242804 129 */
ansond 15:8ada80242804 130 string getWiFiSSID();
ansond 15:8ada80242804 131
ansond 15:8ada80242804 132 /**
ansond 15:8ada80242804 133 Get the WiFi Auth Type
ansond 15:8ada80242804 134 */
ansond 15:8ada80242804 135 WiFiAuthTypes getWiFiAuthType();
ansond 15:8ada80242804 136
ansond 15:8ada80242804 137 /**
ansond 15:8ada80242804 138 Get the WiFi Auth Key
ansond 15:8ada80242804 139 */
ansond 15:8ada80242804 140 string getWiFiAuthKey();
ansond 19:e2cbaeeea509 141
ansond 19:e2cbaeeea509 142 /**
ansond 19:e2cbaeeea509 143 Get the 802.15.4 Network ID
ansond 19:e2cbaeeea509 144 */
ansond 19:e2cbaeeea509 145 string getNetworkID();
ansond 19:e2cbaeeea509 146
ansond 19:e2cbaeeea509 147 /**
ansond 19:e2cbaeeea509 148 Get the 802.15.4 Radio channel
ansond 19:e2cbaeeea509 149 */
ansond 19:e2cbaeeea509 150 uint8_t getRadioChannel();
sam_grove 2:853f9ecc12df 151
sam_grove 2:853f9ecc12df 152 protected:
ansond 19:e2cbaeeea509 153 // mDS Resources
sam_grove 2:853f9ecc12df 154 char *m_lifetime;
sam_grove 2:853f9ecc12df 155 string m_domain;
sam_grove 2:853f9ecc12df 156 string m_node_name;
sam_grove 2:853f9ecc12df 157 string m_endpoint_type;
sam_grove 2:853f9ecc12df 158 int m_rd_update_period;
sam_grove 2:853f9ecc12df 159 int m_nsp_port;
sam_grove 2:853f9ecc12df 160 uint8_t m_nsp_address[NSP_IP_ADDRESS_LENGTH];
ansond 15:8ada80242804 161
ansond 15:8ada80242804 162 // WiFi Resources
ansond 15:8ada80242804 163 string m_wifi_ssid;
ansond 15:8ada80242804 164 string m_wifi_auth_key;
ansond 15:8ada80242804 165 WiFiAuthTypes m_wifi_auth_type;
ansond 19:e2cbaeeea509 166
ansond 19:e2cbaeeea509 167 // 802.15.4 Resources
ansond 19:e2cbaeeea509 168 string m_network_id;
ansond 19:e2cbaeeea509 169 uint32_t m_channel_list;
ansond 19:e2cbaeeea509 170 uint8_t m_mac_address[NODE_MAC_ADDRESS_LENGTH];
ansond 19:e2cbaeeea509 171 uint8_t m_channel;
ansond 19:e2cbaeeea509 172
ansond 19:e2cbaeeea509 173 // Endpoint Resources
ansond 19:e2cbaeeea509 174 StaticResourcesList m_static_resources;
ansond 19:e2cbaeeea509 175 DynamicResourcesList m_dynamic_resources;
sam_grove 2:853f9ecc12df 176 };
sam_grove 2:853f9ecc12df 177
sam_grove 2:853f9ecc12df 178 } // namespace Connector
sam_grove 2:853f9ecc12df 179
sam_grove 2:853f9ecc12df 180 #endif // __OPTIONS_H__