16 #ifndef M2M_OBJECT_INSTANCE_H 17 #define M2M_OBJECT_INSTANCE_H 23 typedef Vector<M2MResource *> M2MResourceList;
24 typedef Vector<M2MResourceInstance *> M2MResourceInstanceList;
54 bool external_blockwise_store =
false);
97 const String &resource_type,
100 const uint8_t value_length,
101 bool multiple_instance =
false,
102 bool external_blockwise_store =
false);
119 const String &resource_type,
122 bool multiple_instance =
false,
123 bool external_blockwise_store =
false);
140 const char *resource_type,
143 bool multiple_instance =
false,
144 bool external_blockwise_store =
false);
169 const String &resource_type,
171 const uint8_t *value,
172 const uint8_t value_length,
174 bool external_blockwise_store =
false);
190 const String &resource_type,
193 uint16_t instance_id,
194 bool external_blockwise_store =
false);
220 uint16_t instance_id);
240 const M2MResourceList &
resources()
const;
303 sn_coap_hdr_s *received_coap_header,
316 sn_coap_hdr_s *received_coap_header,
331 sn_coap_hdr_s *received_coap_header,
333 bool &execute_value_updated,
334 sn_nsdl_addr_s *address = NULL);
336 inline M2MObject &get_parent_object()
const;
360 M2MResourceList _resource_list;
362 friend class Test_M2MObjectInstance;
363 friend class Test_M2MObject;
364 friend class Test_M2MDevice;
365 friend class Test_M2MSecurity;
366 friend class Test_M2MServer;
367 friend class Test_M2MInterfaceFactory;
368 friend class Test_M2MNsdlInterface;
369 friend class Test_M2MTLVSerializer;
370 friend class Test_M2MTLVDeserializer;
371 friend class Test_M2MBase;
372 friend class Test_M2MResource;
373 friend class Test_M2MResourceInstance;
374 friend class Test_M2MReportHandler;
375 friend class TestFactory;
376 friend class Test_M2MInterfaceImpl;
377 friend class Test_M2MDiscover;
378 friend class Test_M2MDynLog;
381 inline M2MObject &M2MObjectInstance::get_parent_object()
const 386 #endif // M2M_OBJECT_INSTANCE_H Definition: m2mobject.h:35
Definition: m2mobservationhandler.h:30
virtual sn_coap_hdr_s * handle_put_request(nsdl_s *nsdl, sn_coap_hdr_s *received_coap_header, M2MObservationHandler *observation_handler, bool &execute_value_updated)
Handles PUT request for the registered objects.
virtual sn_coap_hdr_s * handle_post_request(nsdl_s *nsdl, sn_coap_hdr_s *received_coap_header, M2MObservationHandler *observation_handler, bool &execute_value_updated, sn_nsdl_addr_s *address=NULL)
Handles POST request for the registered objects.
M2MResource * create_static_resource(const lwm2m_parameters_s *static_res, M2MResourceInstance::ResourceType type)
TODO!
Observation
Enum to define observation level.
Definition: m2mbase.h:74
virtual void add_observation_level(M2MBase::Observation observation_level)
Adds the observation level for the object.
const char * name() const
Returns the object name.
Definition: m2mobjectinstance.h:42
ResourceType
Definition: m2mresourcebase.h:61
uint16_t resource_count() const
Returns the total number of resources with the object.
LwM2M parameters.
Definition: m2mbase.h:199
virtual M2MObservationHandler * observation_handler() const
Returns the Observation Handler object.
bool remove_resource(const String &name)
Removes the resource with the given name.
DataType
Enum defining a resource data type.
Definition: m2mbase.h:98
M2MResourceInstance * create_static_resource_instance(const String &resource_name, const String &resource_type, M2MResourceInstance::ResourceType type, const uint8_t *value, const uint8_t value_length, uint16_t instance_id, bool external_blockwise_store=false)
Creates a static resource instance for a given mbed Client Inteface object. With this, the client can respond to server's GET methods with the provided value.
bool remove_resource_instance(const String &resource_name, uint16_t instance_id)
Removes the resource instance with the given name.
void notification_update(M2MBase::Observation observation_level)
Definition: m2mresourceinstance.h:38
M2MResource * resource(const uint16_t resource_id) const
Returns the resource with the given name.
virtual void set_observation_handler(M2MObservationHandler *handler)
Sets the observation handler.
virtual M2MBase * get_parent() const
Returns the owner object. Can return NULL if the object has no parent.
virtual sn_coap_hdr_s * handle_get_request(nsdl_s *nsdl, sn_coap_hdr_s *received_coap_header, M2MObservationHandler *observation_handler=NULL)
Handles GET request for the registered objects.
M2MResourceInstance * create_dynamic_resource_instance(const String &resource_name, const String &resource_type, M2MResourceInstance::ResourceType type, bool observable, uint16_t instance_id, bool external_blockwise_store=false)
Creates a dynamic resource instance for a given mbed Client Inteface object. With this...
Definition: m2mresource.h:38
const M2MResourceList & resources() const
Returns a list of M2MResourceBase objects.
const char * resource_type() const
Returns the resource type of the object.
M2MBase::Observation observation_level() const
Returns the observation level of the object.
M2MResource * create_dynamic_resource(const String &resource_name, const String &resource_type, M2MResourceInstance::ResourceType type, bool observable, bool multiple_instance=false, bool external_blockwise_store=false)
Creates a dynamic resource for a given mbed Client Inteface object. With this, the client can respond...
uint16_t instance_id() const
Returns the object's instance ID.
virtual void remove_observation_level(M2MBase::Observation observation_level)
Removes the observation level from the object.
void execute_value_updated(const String &name)
Calls the function that is set in the "set_value_updated_function".