mbed Connector Endpoint interface. This interface permits a mbed endpoint to easily setup MDS resources and emit those resources to an MDS server.

Dependents:   IoT_LED_demo ServoTest uWater_Project hackathon ... more

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?

UserRevisionLine numberNew contents of line
ansond 0:b438482ebbfc 1 /**
ansond 0:b438482ebbfc 2 * @file OptionsBuilder.h
ansond 0:b438482ebbfc 3 * @brief mbed CoAP OptionsBuilder 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_BUILDER_H__
ansond 0:b438482ebbfc 24 #define __OPTIONS_BUILDER_H__
ansond 0:b438482ebbfc 25
ansond 0:b438482ebbfc 26 // base class support
ansond 0:b438482ebbfc 27 #include "Options.h"
ansond 0:b438482ebbfc 28
ansond 0:b438482ebbfc 29 // Connector namespace
ansond 0:b438482ebbfc 30 namespace Connector {
ansond 0:b438482ebbfc 31 class OptionsBuilder : Options {
ansond 0:b438482ebbfc 32 public:
ansond 0:b438482ebbfc 33 /**
ansond 0:b438482ebbfc 34 Default Constructor
ansond 0:b438482ebbfc 35 */
ansond 0:b438482ebbfc 36 OptionsBuilder();
ansond 0:b438482ebbfc 37
ansond 0:b438482ebbfc 38 /**
ansond 0:b438482ebbfc 39 Copy Constructor
ansond 0:b438482ebbfc 40 @param ob input options builder instance to deep copy
ansond 0:b438482ebbfc 41 */
ansond 0:b438482ebbfc 42 OptionsBuilder(const OptionsBuilder &ob);
ansond 0:b438482ebbfc 43
ansond 0:b438482ebbfc 44 /**
ansond 0:b438482ebbfc 45 Destructor
ansond 0:b438482ebbfc 46 */
ansond 0:b438482ebbfc 47 virtual ~OptionsBuilder();
ansond 0:b438482ebbfc 48
ansond 0:b438482ebbfc 49 /**
ansond 0:b438482ebbfc 50 Set the NSDL Endpoint Lifetime
ansond 0:b438482ebbfc 51 @param lifetime input the NSDL endpoint lifetime (seconds)
ansond 0:b438482ebbfc 52 @return instance to ourself
ansond 0:b438482ebbfc 53 */
ansond 0:b438482ebbfc 54 OptionsBuilder &setLifetime(const char *lifetime);
ansond 0:b438482ebbfc 55
ansond 0:b438482ebbfc 56 /**
ansond 0:b438482ebbfc 57 Set the NSDL Domain
ansond 0:b438482ebbfc 58 @param domain input the NSDL domain to set
ansond 0:b438482ebbfc 59 @return instance to ourself
ansond 0:b438482ebbfc 60 */
ansond 0:b438482ebbfc 61 OptionsBuilder &setDomain(const char *domain);
ansond 0:b438482ebbfc 62
ansond 0:b438482ebbfc 63 /**
ansond 0:b438482ebbfc 64 Set the Endpoint Node Name
ansond 0:b438482ebbfc 65 @param node_name input the node endpoint name
ansond 0:b438482ebbfc 66 @return instance to ourself
ansond 0:b438482ebbfc 67 */
ansond 0:b438482ebbfc 68 OptionsBuilder &setEndpointNodename(const char *node_name);
ansond 0:b438482ebbfc 69
ansond 0:b438482ebbfc 70 /**
ansond 0:b438482ebbfc 71 Set the NSDL Endpoint Type
ansond 0:b438482ebbfc 72 @param endpoint_type input the NSDL endpoint type
ansond 0:b438482ebbfc 73 @return instance to ourself
ansond 0:b438482ebbfc 74 */
ansond 0:b438482ebbfc 75 OptionsBuilder &setEndpointType(const char *endpoint_type);
ansond 0:b438482ebbfc 76
ansond 0:b438482ebbfc 77 /**
ansond 0:b438482ebbfc 78 Set the NSDL Port Number
ansond 0:b438482ebbfc 79 @param port_num input the NSDL port number
ansond 0:b438482ebbfc 80 @return instance to ourself
ansond 0:b438482ebbfc 81 */
ansond 0:b438482ebbfc 82 OptionsBuilder &setNSPPortNumber(const int port_num);
ansond 0:b438482ebbfc 83
ansond 0:b438482ebbfc 84 /**
ansond 0:b438482ebbfc 85 Set the underlying radio stack channel list
ansond 0:b438482ebbfc 86 @param channel_list input the radio channel list
ansond 0:b438482ebbfc 87 @return instance to ourself
ansond 0:b438482ebbfc 88 */
ansond 0:b438482ebbfc 89 OptionsBuilder &setRadioChannelList(const uint32_t channel_list);
ansond 0:b438482ebbfc 90
ansond 0:b438482ebbfc 91 /**
ansond 0:b438482ebbfc 92 Set the NSDL Read Update Period
ansond 0:b438482ebbfc 93 @param rd_update_period_ms input the NSDL read update period (in ms)
ansond 0:b438482ebbfc 94 @return instance to ourself
ansond 0:b438482ebbfc 95 */
ansond 0:b438482ebbfc 96 OptionsBuilder &setReadUpdatePeriod(const int rd_update_period_ms);
ansond 0:b438482ebbfc 97
ansond 0:b438482ebbfc 98 /**
ansond 0:b438482ebbfc 99 Set the NSP IPv6 Address
ansond 0:b438482ebbfc 100 @param nsp_address input the NSP IPv6 address
ansond 0:b438482ebbfc 101 @param nsp_address_length input the length of the NSP IPv6 address buffer
ansond 0:b438482ebbfc 102 @return instance to ourself
ansond 0:b438482ebbfc 103 */
ansond 0:b438482ebbfc 104 OptionsBuilder &setNSPAddress(const uint8_t *nsp_address,const int nsp_address_length);
ansond 0:b438482ebbfc 105
ansond 0:b438482ebbfc 106 /**
ansond 0:b438482ebbfc 107 Set the MAC address
ansond 0:b438482ebbfc 108 @param mac_address input the MAC address buffer
ansond 0:b438482ebbfc 109 @param mac_address_length input the MAC address buffer length
ansond 0:b438482ebbfc 110 @return instance to ourself
ansond 0:b438482ebbfc 111 */
ansond 0:b438482ebbfc 112 OptionsBuilder &setMACAddress(const uint8_t *mac_address,const int mac_address_length);
ansond 0:b438482ebbfc 113
ansond 0:b438482ebbfc 114 /**
ansond 0:b438482ebbfc 115 Add a NSDL endpoint resource (static)
ansond 0:b438482ebbfc 116 @param static_resource input the NSDL static resource
ansond 0:b438482ebbfc 117 @return instance to ourself
ansond 0:b438482ebbfc 118 */
ansond 0:b438482ebbfc 119 OptionsBuilder &addResource(const StaticResource *static_resource);
ansond 0:b438482ebbfc 120
ansond 0:b438482ebbfc 121 /**
ansond 0:b438482ebbfc 122 Add a NSDL endpoint resource (dynamic)
ansond 0:b438482ebbfc 123 @param dynamic_resource input the NSDL dynamic resource
ansond 0:b438482ebbfc 124 @return instance to ourself
ansond 0:b438482ebbfc 125 */
ansond 0:b438482ebbfc 126 OptionsBuilder &addResource(const DynamicResource *static_resource);
ansond 0:b438482ebbfc 127
ansond 0:b438482ebbfc 128 /**
ansond 0:b438482ebbfc 129 Build our our immutable self
ansond 0:b438482ebbfc 130 */
ansond 0:b438482ebbfc 131 Options *build();
ansond 0:b438482ebbfc 132
ansond 0:b438482ebbfc 133 };
ansond 0:b438482ebbfc 134 }
ansond 0:b438482ebbfc 135
ansond 0:b438482ebbfc 136 #endif // __OPTIONS_BUILDER_H__