This is the sample program that can see the decode result of barcode data on Watson IoT.

Dependencies:   AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice

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.
OptionsBuildersetConnectorURL (const char *connector_url)
 Set the Connector URL.
OptionsBuildersetDeviceResourcesObject (const void *device_resources_object)
 Set the LWM2M Device Resource Object Instance.
OptionsBuildersetFirmwareResourcesObject (const void *firmware_resources_object)
 Set the LWM2M Firmware Resource Object Instance.
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.
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.
char * getConnectorURL ()
 Get the endpoint Connector URL.
uint16_t getConnectorPort ()
 Get the connector connection port from the URL.
void * getDeviceResourcesObject ()
 Get the Device Resources Object Instance.
void * getFirmwareResourcesObject ()
 Get the Firmware Resources Object Instance.
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.
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 35 of file OptionsBuilder.cpp.

OptionsBuilder ( const OptionsBuilder ob )

Copy Constructor.

Parameters:
obinput options builder instance to deep copy

Definition at line 57 of file OptionsBuilder.cpp.

~OptionsBuilder (  ) [virtual]

Destructor.

Definition at line 87 of file OptionsBuilder.cpp.


Member Function Documentation

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 152 of file OptionsBuilder.cpp.

OptionsBuilder & addResource ( const DynamicResource dynamic_resource )

Add a NSDL endpoint resource (dynamic)

Parameters:
dynamic_resourceinput the NSDL dynamic resource
Returns:
instance to ourself

Definition at line 162 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 176 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 169 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 183 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 277 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 284 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 125 of file OptionsBuilder.cpp.

OptionsBuilder & setDeviceResourcesObject ( const void *  device_resources_object )

Set the LWM2M Device Resource Object Instance.

Parameters:
device_resources_objectinput the LWM2M device resource object instance
Returns:
instance to ourself

Definition at line 134 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 104 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 291 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 111 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 118 of file OptionsBuilder.cpp.

OptionsBuilder & setFirmwareResourcesObject ( const void *  firmware_resources_object )

Set the LWM2M Firmware Resource Object Instance.

Parameters:
firmware_resources_objectinput the LWM2M firmware resource object instance
Returns:
instance to ourself

Definition at line 143 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 97 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 231 of file OptionsBuilder.cpp.

OptionsBuilder & setWiFiAuthType ( WiFiAuthTypes  auth_type )

Set the WiFi AuthType.

Parameters:
auth_typeinput the WiFi AuthType

Definition at line 224 of file OptionsBuilder.cpp.

OptionsBuilder & setWiFiSSID ( char *  ssid )

Set the WiFi SSID.

Parameters:
ssidinput the WiFi SSID

Definition at line 217 of file OptionsBuilder.cpp.