mbedConnectorInterface back port from mbedOS v3 using mbed-client C++ call interface

Embed: (wiki syntax)

« Back to documentation index

OptionsBuilder Class Reference

OptionsBuilder Class Reference

OptionsBuilder class. More...

#include <OptionsBuilder.h>

Inherits Connector::Options.

Public Member Functions

 OptionsBuilder ()
 Default Constructor.
 OptionsBuilder (const OptionsBuilder &ob)
 Copy Constructor.
virtual ~OptionsBuilder ()
 Destructor.
OptionsBuildersetLifetime (int lifetime)
 Set the NSDL Endpoint Lifetime.
OptionsBuildersetDomain (const char *domain)
 Set the NSDL Domain.
OptionsBuildersetEndpointNodename (const char *node_name)
 Set the Endpoint Node Name.
OptionsBuildersetEndpointType (const char *endpoint_type)
 Set the NSDL Endpoint Type.
OptionsBuildersetRegUpdatePeriod (const int reg_update_period_ms)
 Set the mbed Registration Update Period.
OptionsBuildersetConnectorURL (const char *connector_url)
 Set the Connector URL.
OptionsBuilderaddResource (const DeviceResource *device_resource)
 Add a NSDL device resource (static)
OptionsBuilderaddResource (const StaticResource *static_resource)
 Add a NSDL endpoint resource (static)
OptionsBuilderaddResource (const DynamicResource *dynamic_resource)
 Add a NSDL endpoint resource (dynamic)
OptionsBuilderaddResource (const DynamicResource *dynamic_resource, const bool use_observer)
 Add a NSDL endpoint resource (dynamic)
OptionsBuilderaddResource (const DynamicResource *dynamic_resource, const int sleep_time)
 Add a NSDL endpoint resource (dynamic)
OptionsBuilderaddResource (const DynamicResource *dynamic_resource, const int sleep_time, const bool use_observer)
 Add a NSDL endpoint resource (dynamic)
OptionsBuildersetWiFiSSID (char *ssid)
 Set the WiFi SSID.
OptionsBuildersetWiFiAuthType (WiFiAuthTypes auth_type)
 Set the WiFi AuthType.
OptionsBuildersetWiFiAuthKey (char *auth_key)
 Set the WiFi AuthKey.
OptionsBuildersetPreSharedKey (unsigned char psk[16])
 Set the 802.15.4 Pre Shared Key.
OptionsBuildersetPreSharedKeyIdentity (unsigned char psk_identity[2])
 Set the 802.15.4 Pre Shared Key Identity.
OptionsBuildersetMeshType (MeshTypes mesh_type)
 Set the 802.15.4 Mesh Type.
OptionsBuildersetCoAPConnectionType (CoAPConnectionTypes coap_connection_type)
 Set the CoAP Connection Type.
OptionsBuildersetIPAddressType (IPAddressTypes ip_address_type)
 Set the IP Address Type.
OptionsBuildersetImmedateObservationEnabled (bool enable)
 Enable/Disable immediate observationing.
OptionsBuildersetEnableGETObservationControl (bool enable)
 Enable/Disable GET-based control of observations.
OptionsBuildersetServerCertificate (uint8_t cert[], int cert_size)
 Set the Server Certificate.
OptionsBuildersetClientCertificate (uint8_t cert[], int cert_size)
 Set the Client Certificate.
OptionsBuildersetClientKey (uint8_t key[], int key_size)
 Set the Client Key.
Optionsbuild ()
 Build our our immutable self.
void setEndpoint (void *endpoint)
 Set our Endpoint instance.

Private Member Functions

int getLifetime ()
 Get the node lifetime.
string getDomain ()
 Get the NSP domain.
string getEndpointNodename ()
 Get the node name.
string getEndpointType ()
 Get the node type.
int getRegUpdatePeriod ()
 Get the mbed registration update period.
char * getConnectorURL ()
 Get the endpoint Connector URL.
uint16_t getConnectorPort ()
 Get the connector connection port from the URL.
DeviceResourcesList * getDeviceResourceList ()
 Get the list of device resources.
StaticResourcesList * getStaticResourceList ()
 Get the list of static resources.
DynamicResourcesList * getDynamicResourceList ()
 Get the list of dynamic resources.
string getWiFiSSID ()
 Get the WiFi SSID.
WiFiAuthTypes getWiFiAuthType ()
 Get the WiFi Auth Type.
string getWiFiAuthKey ()
 Get the WiFi Auth Key.
unsigned char * getPreSharedKey ()
 Get the 802.15.4 Pre Shared Key.
unsigned char * getPreSharedKeyIdentity ()
 Get the 802.15.4 Pre Shared Key Identity.
MeshTypes getMeshType ()
 Get the 802.15.14 Mesh Type.
CoAPConnectionTypes getCoAPConnectionType ()
 Get the CoAP Connection Type.
IPAddressTypes getIPAddressType ()
 Get the IP Address Type.
bool immedateObservationEnabled ()
 Enable/Disable Immediate Observationing.
bool enableGETObservationControl ()
 Enable/Disable Observation control via GET.
uint8_t * getServerCertificate ()
 Get the Server Certificate.
int getServerCertificateSize ()
 Get the Server Certificate Size (bytes)
uint8_t * getClientCertificate ()
 Get the Client Certificate.
int getClientCertificateSize ()
 Get the Client Certificate Size (bytes)
uint8_t * getClientKey ()
 Get the Client Key.
int getClientKeySize ()
 Get the Client Key Size (bytes)
void * getEndpoint ()
 Get Our Endpoint.

Detailed Description

OptionsBuilder class.

Definition at line 34 of file OptionsBuilder.h.


Constructor & Destructor Documentation

Default Constructor.

Definition at line 43 of file OptionsBuilder.cpp.

OptionsBuilder ( const OptionsBuilder ob )

Copy Constructor.

Parameters:
obinput options builder instance to deep copy

Definition at line 58 of file OptionsBuilder.cpp.

~OptionsBuilder (  ) [virtual]

Destructor.

Definition at line 73 of file OptionsBuilder.cpp.


Member Function Documentation

OptionsBuilder & addResource ( const DeviceResource device_resource )

Add a NSDL device resource (static)

Parameters:
device_resourceinput the NSDL device resource
Returns:
instance to ourself

Definition at line 126 of file OptionsBuilder.cpp.

OptionsBuilder & addResource ( const StaticResource static_resource )

Add a NSDL endpoint resource (static)

Parameters:
static_resourceinput the NSDL static resource
Returns:
instance to ourself

Definition at line 135 of file OptionsBuilder.cpp.

OptionsBuilder & addResource ( const DynamicResource dynamic_resource )

Add a NSDL endpoint resource (dynamic)

Parameters:
dynamic_resourceinput the NSDL dynamic resource

Definition at line 145 of file OptionsBuilder.cpp.

OptionsBuilder & addResource ( const DynamicResource dynamic_resource,
const bool  use_observer 
)

Add a NSDL endpoint resource (dynamic)

Parameters:
dynamic_resourceinput the NSDL dynamic resource
use_observerinput if true, use an appropriate ResourceObserver to observer. if false, the underlying resource will handle it
Returns:
instance to ourself

Definition at line 159 of file OptionsBuilder.cpp.

OptionsBuilder & addResource ( const DynamicResource dynamic_resource,
const int  sleep_time 
)

Add a NSDL endpoint resource (dynamic)

Parameters:
dynamic_resourceinput the NSDL dynamic resource
sleep_timeinput the observation sleep time in milliseconds (for observable resource only)
Returns:
instance to ourself

Definition at line 152 of file OptionsBuilder.cpp.

OptionsBuilder & addResource ( const DynamicResource dynamic_resource,
const int  sleep_time,
const bool  use_observer 
)

Add a NSDL endpoint resource (dynamic)

Parameters:
dynamic_resourceinput the NSDL dynamic resource
sleep_timeinput the observation sleep time in milliseconds (for observable resource only)
use_observerinput if true, use an appropriate ResourceObserver to observer. if false, the underlying resource will handle it
Returns:
instance to ourself

Definition at line 166 of file OptionsBuilder.cpp.

Options * build (  )

Build our our immutable self.

Definition at line 252 of file OptionsBuilder.cpp.

OptionsBuilder & setClientCertificate ( uint8_t  cert[],
int  cert_size 
)

Set the Client Certificate.

Parameters:
certinput the client certificate
cert_sizeinput the length of the client certificate

Definition at line 283 of file OptionsBuilder.cpp.

OptionsBuilder & setClientKey ( uint8_t  key[],
int  key_size 
)

Set the Client Key.

Parameters:
keyinput the client key
key_sizeinput the length of the client key

Definition at line 296 of file OptionsBuilder.cpp.

OptionsBuilder & setCoAPConnectionType ( CoAPConnectionTypes  coap_connection_type )

Set the CoAP Connection Type.

Parameters:
coap_connection_typeinput the CoAP Connection type

Definition at line 238 of file OptionsBuilder.cpp.

OptionsBuilder & setConnectorURL ( const char *  connector_url )

Set the Connector URL.

Parameters:
urlinput the Connector URL
Returns:
instance to ourself

Definition at line 117 of file OptionsBuilder.cpp.

OptionsBuilder & setDomain ( const char *  domain )

Set the NSDL Domain.

Parameters:
domaininput the NSDL domain to set
Returns:
instance to ourself

Definition at line 89 of file OptionsBuilder.cpp.

OptionsBuilder & setEnableGETObservationControl ( bool  enable )

Enable/Disable GET-based control of observations.

Parameters:
enableinput enable GET-based observation enable/disable control

Definition at line 264 of file OptionsBuilder.cpp.

void setEndpoint ( void *  endpoint )

Set our Endpoint instance.

Definition at line 309 of file OptionsBuilder.cpp.

OptionsBuilder & setEndpointNodename ( const char *  node_name )

Set the Endpoint Node Name.

Parameters:
node_nameinput the node endpoint name
Returns:
instance to ourself

Definition at line 96 of file OptionsBuilder.cpp.

OptionsBuilder & setEndpointType ( const char *  endpoint_type )

Set the NSDL Endpoint Type.

Parameters:
endpoint_typeinput the NSDL endpoint type
Returns:
instance to ourself

Definition at line 103 of file OptionsBuilder.cpp.

OptionsBuilder & setImmedateObservationEnabled ( bool  enable )

Enable/Disable immediate observationing.

Parameters:
enableinput enable immediate observationing without GET

Definition at line 258 of file OptionsBuilder.cpp.

OptionsBuilder & setIPAddressType ( IPAddressTypes  ip_address_type )

Set the IP Address Type.

Parameters:
ip_address_typeinput the IP Address type

Definition at line 245 of file OptionsBuilder.cpp.

OptionsBuilder & setLifetime ( int  lifetime )

Set the NSDL Endpoint Lifetime.

Parameters:
lifetimeinput the NSDL endpoint lifetime (seconds)
Returns:
instance to ourself

Definition at line 82 of file OptionsBuilder.cpp.

OptionsBuilder & setMeshType ( MeshTypes  mesh_type )

Set the 802.15.4 Mesh Type.

Parameters:
mesh_typeinput the 802.15.4 mesh type

Definition at line 231 of file OptionsBuilder.cpp.

OptionsBuilder & setPreSharedKey ( unsigned char  psk[16] )

Set the 802.15.4 Pre Shared Key.

Parameters:
pskinput the 802.15.4 mesh pre shared key

Definition at line 211 of file OptionsBuilder.cpp.

OptionsBuilder & setPreSharedKeyIdentity ( unsigned char  psk_identity[2] )

Set the 802.15.4 Pre Shared Key Identity.

Parameters:
psk_identityinput the 802.15.4 mesh pre shared key Identity

Definition at line 221 of file OptionsBuilder.cpp.

OptionsBuilder & setRegUpdatePeriod ( const int  reg_update_period_ms )

Set the mbed Registration Update Period.

Parameters:
rd_update_period_msinput the NSDL read update period (in ms)
Returns:
instance to ourself

Definition at line 110 of file OptionsBuilder.cpp.

OptionsBuilder & setServerCertificate ( uint8_t  cert[],
int  cert_size 
)

Set the Server Certificate.

Parameters:
certinput the server certificate
cert_sizeinput the length of the server certificate

Definition at line 270 of file OptionsBuilder.cpp.

OptionsBuilder & setWiFiAuthKey ( char *  auth_key )

Set the WiFi AuthKey.

Parameters:
auth_keyinput the WiFi AuthKey

Definition at line 204 of file OptionsBuilder.cpp.

OptionsBuilder & setWiFiAuthType ( WiFiAuthTypes  auth_type )

Set the WiFi AuthType.

Parameters:
auth_typeinput the WiFi AuthType

Definition at line 197 of file OptionsBuilder.cpp.

OptionsBuilder & setWiFiSSID ( char *  ssid )

Set the WiFi SSID.

Parameters:
ssidinput the WiFi SSID

Definition at line 190 of file OptionsBuilder.cpp.