Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DeviceIntegerResource Class Reference
DeviceIntegerResource class. More...
#include <DeviceIntegerResource.h>
Inherits DynamicResource.
Public Member Functions | |
| DeviceIntegerResource (const Logger *logger, const char *obj_name, const char *res_name, const char *res_type, const void *dm_responder, bool observable=false) | |
| Default constructor. | |
| virtual string | get () |
| GET handler. | |
| virtual void | put (string value) |
| PUT handler. | |
| virtual M2MObject * | bind (void *p) |
| Bind resource to endpoint. | |
| uint8_t | process (M2MBase::Operation op, M2MBase::BaseType type, void *args=NULL) |
| Process the CoAP message. | |
| virtual void | post (void *args) |
| Resource value setter (POST) (OPTIONAL: defaulted noop if not derived. | |
| virtual void | del (void *args) |
| Resource value deleter (OPTIONAL: defaulted noop if not derived. | |
| int | notify (const string data) |
| Send notification of new data. | |
| bool | isObservable () |
| Determine whether this dynamic resource is observable or not. | |
| void | setObserver (void *observer) |
| Set the observer pointer. | |
| void | setContentFormat (uint8_t content_format) |
| Set the content format for responses. | |
| void | setMaxAge (uint8_t maxage) |
| Set the max-age for cache control of responses in a proxy cache. | |
| void | setDataWrapper (DataWrapper *data_wrapper) |
| Set the data wrapper. | |
| virtual void | observe () |
| observe the resource | |
| M2MBase * | getResource () |
| get the base resource representation | |
| void | process_resource_post (void *args) |
| Process a POST message for Resources. | |
| void | process_resource_delete (void *args) |
| Process a DELETE message for Resources. | |
| bool | isConnected () |
| Determine if we are connected or not. | |
| bool | isRegistered () |
| Determine if we are registered or not. | |
| string | getObjName () |
| Get the Object name. | |
| string | getResName () |
| Get the Resource name. | |
| string | getFullName () |
| Get the Full name. | |
| string | getValue () |
| Get the resource value. | |
| void | setName (const string name) |
| Set the resource name. | |
| void | setValue (const stringvalue) |
| Set the resource value. | |
| void | setOptions (const void *options) |
| set the options | |
| void | setEndpoint (const void *endpoint) |
| set the endpoint | |
Detailed Description
DeviceIntegerResource class.
Definition at line 34 of file DeviceIntegerResource.h.
Constructor & Destructor Documentation
| DeviceIntegerResource | ( | const Logger * | logger, |
| const char * | obj_name, | ||
| const char * | res_name, | ||
| const char * | res_type, | ||
| const void * | dm_responder, | ||
| bool | observable = false |
||
| ) |
Default constructor.
- Parameters:
-
logger input logger instance for this resource obj_name input the Integer Object ID res_name input the Integer Resource ID res_type input the Integer Resource Type dm_responder input the DM responder instance observable input this Integer is observable
Definition at line 46 of file DeviceIntegerResource.h.
Member Function Documentation
| M2MObject * bind | ( | void * | p ) | [virtual, inherited] |
Bind resource to endpoint.
- Parameters:
-
p input pointer to the endpoint resources necessary for binding
Implements Resource< string >.
Definition at line 109 of file DynamicResource.cpp.
| void del | ( | void * | args ) | [virtual, inherited] |
Resource value deleter (OPTIONAL: defaulted noop if not derived.
Binders MAY implement DELETE if needed)
- Parameters:
-
void * args for the del() operation
Definition at line 352 of file DynamicResource.cpp.
| virtual string get | ( | ) | [virtual] |
GET handler.
- Returns:
- string with this resource type
Implements DynamicResource.
Definition at line 57 of file DeviceIntegerResource.h.
| string getFullName | ( | ) | [inherited] |
| string getObjName | ( | ) | [inherited] |
| string getResName | ( | ) | [inherited] |
| M2MBase * getResource | ( | ) | [inherited] |
get the base resource representation
Definition at line 180 of file DynamicResource.cpp.
| string getValue | ( | ) | [inherited] |
Get the resource value.
- Returns:
- the value of the resource
Definition at line 107 of file Resource.h.
| bool isConnected | ( | ) | [inherited] |
Determine if we are connected or not.
Definition at line 402 of file DynamicResource.cpp.
| bool isObservable | ( | ) | [inherited] |
Determine whether this dynamic resource is observable or not.
- Returns:
- true - is observable, false - otherwise
Definition at line 133 of file DynamicResource.h.
| bool isRegistered | ( | ) | [inherited] |
Determine if we are registered or not.
Definition at line 425 of file DynamicResource.cpp.
| int notify | ( | const string | data ) | [inherited] |
Send notification of new data.
- Parameters:
-
data input the new data to update
- Returns:
- 1 - success, 0 - failure
Definition at line 299 of file DynamicResource.cpp.
| void observe | ( | ) | [virtual, inherited] |
observe the resource
Definition at line 359 of file DynamicResource.cpp.
| void post | ( | void * | args ) | [virtual, inherited] |
Resource value setter (POST) (OPTIONAL: defaulted noop if not derived.
Binders MAY implement POST if needed)
- Parameters:
-
void * args for the post() operation
Reimplemented in DeviceActionResource.
Definition at line 345 of file DynamicResource.cpp.
| uint8_t process | ( | M2MBase::Operation | op, |
| M2MBase::BaseType | type, | ||
| void * | args = NULL |
||
| ) | [inherited] |
Process the CoAP message.
- Parameters:
-
op input the CoAP Verb (operation) type input clarification of the M2MBase instance being passed in (Object vs. ObjectInstance vs. Resource vs. ResourceInstance) args input arguments (unused)
- Returns:
- 0 - success, 1 - failure
Definition at line 199 of file DynamicResource.cpp.
| void process_resource_delete | ( | void * | args ) | [inherited] |
Process a DELETE message for Resources.
Definition at line 192 of file DynamicResource.cpp.
| void process_resource_post | ( | void * | args ) | [inherited] |
Process a POST message for Resources.
Definition at line 185 of file DynamicResource.cpp.
| virtual void put | ( | string | value ) | [virtual] |
PUT handler.
- Parameters:
-
value input input value
Reimplemented from DynamicResource.
Definition at line 68 of file DeviceIntegerResource.h.
| void setContentFormat | ( | uint8_t | content_format ) | [inherited] |
Set the content format for responses.
- Parameters:
-
content_format short integer CoAP content-format ID
Definition at line 371 of file DynamicResource.cpp.
| void setDataWrapper | ( | DataWrapper * | data_wrapper ) | [inherited] |
Set the data wrapper.
- Parameters:
-
data_wrapper input the data wrapper instance
Definition at line 157 of file DynamicResource.h.
| void setEndpoint | ( | const void * | endpoint ) | [inherited] |
set the endpoint
Definition at line 147 of file Resource.h.
| void setMaxAge | ( | uint8_t | maxage ) | [inherited] |
Set the max-age for cache control of responses in a proxy cache.
- Parameters:
-
maxage short integer CoAP max-age in seconds
Definition at line 376 of file DynamicResource.cpp.
| void setName | ( | const string | name ) | [inherited] |
Set the resource name.
- Parameters:
-
name input the resource name
Definition at line 115 of file Resource.h.
| void setObserver | ( | void * | observer ) | [inherited] |
Set the observer pointer.
- Parameters:
-
observer input the pointer to the ResourceObserver observing this resource
Definition at line 366 of file DynamicResource.cpp.
| void setOptions | ( | const void * | options ) | [inherited] |
set the options
Definition at line 140 of file Resource.h.
| void setValue | ( | const string | value ) | [inherited] |
Set the resource value.
- Parameters:
-
value input the resource value
Definition at line 123 of file Resource.h.
Generated on Wed Jul 13 2022 21:59:32 by
1.7.2