added max-age and content-format
Fork of mbedConnectorInterface by
api/Options.cpp@4:84159d67d32d, 2015-01-28 (annotated)
- Committer:
- ansond
- Date:
- Wed Jan 28 12:11:22 2015 +0000
- Revision:
- 4:84159d67d32d
- Parent:
- 2:853f9ecc12df
- Child:
- 15:8ada80242804
updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 0:b438482ebbfc | 1 | /** |
ansond | 0:b438482ebbfc | 2 | * @file Options.cpp |
ansond | 0:b438482ebbfc | 3 | * @brief mbed CoAP Options (immutable OptionsBuilder instance) class implementation |
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 | #include "Options.h" |
sam_grove | 2:853f9ecc12df | 24 | |
sam_grove | 2:853f9ecc12df | 25 | namespace Connector { |
sam_grove | 2:853f9ecc12df | 26 | |
sam_grove | 2:853f9ecc12df | 27 | // default constructor |
sam_grove | 2:853f9ecc12df | 28 | Options::Options() |
sam_grove | 2:853f9ecc12df | 29 | { |
sam_grove | 2:853f9ecc12df | 30 | } |
sam_grove | 2:853f9ecc12df | 31 | |
sam_grove | 2:853f9ecc12df | 32 | // copy constructor |
sam_grove | 2:853f9ecc12df | 33 | Options::Options(const Options &opt) |
sam_grove | 2:853f9ecc12df | 34 | { |
sam_grove | 2:853f9ecc12df | 35 | } |
sam_grove | 2:853f9ecc12df | 36 | |
sam_grove | 2:853f9ecc12df | 37 | // destructors |
sam_grove | 2:853f9ecc12df | 38 | Options::~Options() |
sam_grove | 2:853f9ecc12df | 39 | { |
sam_grove | 2:853f9ecc12df | 40 | } |
sam_grove | 2:853f9ecc12df | 41 | |
sam_grove | 2:853f9ecc12df | 42 | // lifetime pointer |
sam_grove | 2:853f9ecc12df | 43 | char *Options::getLifetime() |
sam_grove | 2:853f9ecc12df | 44 | { |
sam_grove | 2:853f9ecc12df | 45 | return this->m_lifetime; |
sam_grove | 2:853f9ecc12df | 46 | } |
sam_grove | 2:853f9ecc12df | 47 | |
sam_grove | 2:853f9ecc12df | 48 | // NSP domain |
sam_grove | 2:853f9ecc12df | 49 | string Options::getDomain() |
sam_grove | 2:853f9ecc12df | 50 | { |
sam_grove | 2:853f9ecc12df | 51 | return this->m_domain; |
sam_grove | 2:853f9ecc12df | 52 | } |
sam_grove | 2:853f9ecc12df | 53 | |
sam_grove | 2:853f9ecc12df | 54 | // Endpoint name |
sam_grove | 2:853f9ecc12df | 55 | string Options::getEndpointNodename() |
sam_grove | 2:853f9ecc12df | 56 | { |
sam_grove | 2:853f9ecc12df | 57 | return this->m_node_name; |
sam_grove | 2:853f9ecc12df | 58 | } |
sam_grove | 2:853f9ecc12df | 59 | |
sam_grove | 2:853f9ecc12df | 60 | // Endpoint Type |
sam_grove | 2:853f9ecc12df | 61 | string Options::getEndpointType() |
sam_grove | 2:853f9ecc12df | 62 | { |
sam_grove | 2:853f9ecc12df | 63 | return this->m_endpoint_type; |
sam_grove | 2:853f9ecc12df | 64 | } |
sam_grove | 2:853f9ecc12df | 65 | |
sam_grove | 2:853f9ecc12df | 66 | // NSP Port number |
sam_grove | 2:853f9ecc12df | 67 | int Options::getNSPPortNumber() |
sam_grove | 2:853f9ecc12df | 68 | { |
sam_grove | 2:853f9ecc12df | 69 | return this->m_nsp_port; |
sam_grove | 2:853f9ecc12df | 70 | } |
sam_grove | 2:853f9ecc12df | 71 | |
sam_grove | 2:853f9ecc12df | 72 | // NODE Radio Channel List |
ansond | 4:84159d67d32d | 73 | uint32_t Options::getRadioChannelList() |
sam_grove | 2:853f9ecc12df | 74 | { |
sam_grove | 2:853f9ecc12df | 75 | return this->m_channel_list; |
sam_grove | 2:853f9ecc12df | 76 | } |
sam_grove | 2:853f9ecc12df | 77 | |
sam_grove | 2:853f9ecc12df | 78 | // NSP Read update period |
sam_grove | 2:853f9ecc12df | 79 | int Options::getReadUpdatePeriod() |
sam_grove | 2:853f9ecc12df | 80 | { |
sam_grove | 2:853f9ecc12df | 81 | return this->m_rd_update_period; |
sam_grove | 2:853f9ecc12df | 82 | } |
sam_grove | 2:853f9ecc12df | 83 | |
sam_grove | 2:853f9ecc12df | 84 | // NSP Address |
sam_grove | 2:853f9ecc12df | 85 | uint8_t *Options::getNSPAddress() |
sam_grove | 2:853f9ecc12df | 86 | { |
sam_grove | 2:853f9ecc12df | 87 | return this->m_nsp_address; |
sam_grove | 2:853f9ecc12df | 88 | } |
sam_grove | 2:853f9ecc12df | 89 | |
sam_grove | 2:853f9ecc12df | 90 | // NODE MAC Address |
ansond | 4:84159d67d32d | 91 | uint8_t *Options::getMACAddress() |
sam_grove | 2:853f9ecc12df | 92 | { |
sam_grove | 2:853f9ecc12df | 93 | return this->m_mac_address; |
sam_grove | 2:853f9ecc12df | 94 | } |
sam_grove | 2:853f9ecc12df | 95 | |
sam_grove | 2:853f9ecc12df | 96 | // Static Resources |
sam_grove | 2:853f9ecc12df | 97 | StaticResourcesList *Options::getStaticResourceList() |
sam_grove | 2:853f9ecc12df | 98 | { |
sam_grove | 2:853f9ecc12df | 99 | return &this->m_static_resources; |
sam_grove | 2:853f9ecc12df | 100 | } |
sam_grove | 2:853f9ecc12df | 101 | |
sam_grove | 2:853f9ecc12df | 102 | // Dynamic Resources |
sam_grove | 2:853f9ecc12df | 103 | DynamicResourcesList *Options::getDynamicResourceList() |
sam_grove | 2:853f9ecc12df | 104 | { |
sam_grove | 2:853f9ecc12df | 105 | return &this->m_dynamic_resources; |
sam_grove | 2:853f9ecc12df | 106 | } |
sam_grove | 2:853f9ecc12df | 107 | |
sam_grove | 2:853f9ecc12df | 108 | } // namespace Connector |