Mayank Gupta / Mbed OS pelion-example-frdm

Dependencies:   FXAS21002 FXOS8700Q

Embed: (wiki syntax)

« Back to documentation index

M2MReportHandler Class Reference

M2MReportHandler Class Reference

M2MReportHandler. More...

#include <m2mreporthandler.h>

Inherits M2MTimerObserver.

Public Types

enum  
 

Enum defining which write attributes are set.

More...
enum  Type
 

The types of timer that can be created for mbed Client.

More...

Public Member Functions

virtual ~M2MReportHandler ()
 Destructor.
void set_under_observation (bool observed)
 Sets that object is under observation.
void set_value_float (float value)
 Sets the float value of the given resource.
void set_value_int (int64_t value)
 Sets the integer value of the given resource.
void set_notification_trigger (uint16_t obj_instance_id=0)
 Sets notification trigger.
bool parse_notification_attribute (const char *query, M2MBase::BaseType type, M2MResourceInstance::ResourceType resource_type=M2MResourceInstance::OPAQUE)
 Parses the received query for notification attribute.
void set_default_values ()
 Set back to default values.
uint8_t attribute_flags () const
 Return write attribute flags.
void set_observation_token (const uint8_t *token, const uint8_t length)
 Sets the observation token value.
void get_observation_token (uint8_t *token, uint8_t &token_length) const
 Provides a copy of the observation token of the object.
uint16_t observation_number () const
 Returns the observation number.
void add_observation_level (M2MBase::Observation obs_level)
 Adds the observation level for the object.
void remove_observation_level (M2MBase::Observation obs_level)
 Removes the observation level for the object.
M2MBase::Observation observation_level () const
 Returns the observation level of the object.
bool is_under_observation () const
 Returns whether this resource is under observation or not.
void schedule_report (bool in_queue=false)
 Schedule a report, if the pmin is exceeded report immediately, otherwise store the state to be reported once the time fires.
void set_notification_in_queue (bool to_queue)
 Set flag that new notification needs to be send.
bool notification_in_queue () const
 Returns whether notification needs to be send or not.
void set_notification_send_in_progress (bool progress)
 Set flag that new notification needs to be send.
bool notification_send_in_progress () const
 Returns whether notification send is in progress or not.
void set_blockwise_notify (bool blockwise_notify)
 Sets whether notification will be sent using blockwise or not.
bool blockwise_notify () const
 Returns whether notification is sent using blockwise or not.

Detailed Description

M2MReportHandler.

This class is handles all the observation related operations.

Definition at line 57 of file m2mreporthandler.h.


Member Enumeration Documentation

anonymous enum

Enum defining which write attributes are set.

Definition at line 72 of file m2mreporthandler.h.

enum Type [inherited]

The types of timer that can be created for mbed Client.

Definition at line 30 of file m2mtimerobserver.h.


Constructor & Destructor Documentation

~M2MReportHandler (  ) [virtual]

Destructor.

Definition at line 77 of file m2mreporthandler.cpp.


Member Function Documentation

void add_observation_level ( M2MBase::Observation  obs_level )

Adds the observation level for the object.

Parameters:
observation_levelThe level of observation.

Definition at line 643 of file m2mreporthandler.cpp.

uint8_t attribute_flags (  ) const

Return write attribute flags.

Definition at line 613 of file m2mreporthandler.cpp.

bool blockwise_notify (  ) const

Returns whether notification is sent using blockwise or not.

Returns:
Is notification sent using blockwise.

Definition at line 699 of file m2mreporthandler.cpp.

void get_observation_token ( uint8_t *  token,
uint8_t &  token_length 
) const

Provides a copy of the observation token of the object.

Parameters:
value[OUT]A pointer to the value of the token.
value_length[OUT]The length of the token pointer.

Definition at line 632 of file m2mreporthandler.cpp.

bool is_under_observation (  ) const

Returns whether this resource is under observation or not.

Returns:
True if the resource is under observation, else false,

Definition at line 658 of file m2mreporthandler.cpp.

bool notification_in_queue (  ) const

Returns whether notification needs to be send or not.

Returns:
Is notification sending needed or not.

Definition at line 679 of file m2mreporthandler.cpp.

bool notification_send_in_progress (  ) const

Returns whether notification send is in progress or not.

Returns:
Is notification sending ongoing or not.

Definition at line 689 of file m2mreporthandler.cpp.

M2MBase::Observation observation_level (  ) const

Returns the observation level of the object.

Returns:
The observation level of the object.

Definition at line 653 of file m2mreporthandler.cpp.

uint16_t observation_number (  ) const

Returns the observation number.

Returns:
The observation number of the object.

Definition at line 638 of file m2mreporthandler.cpp.

bool parse_notification_attribute ( const char *  query,
M2MBase::BaseType  type,
M2MResourceInstance::ResourceType  resource_type = M2MResourceInstance::OPAQUE 
)

Parses the received query for notification attribute.

Parameters:
queryQuery to be parsed for attributes.
typeType of the Base Object.
resource_typeType of the Resource.
Returns:
true if required attributes are present else false.

Definition at line 150 of file m2mreporthandler.cpp.

void remove_observation_level ( M2MBase::Observation  obs_level )

Removes the observation level for the object.

Parameters:
observation_levelThe level of observation.

Definition at line 648 of file m2mreporthandler.cpp.

void schedule_report ( bool  in_queue = false )

Schedule a report, if the pmin is exceeded report immediately, otherwise store the state to be reported once the time fires.

Parameters:
in_queueIf the message is queued message then it must be send even if current and last values are the same.

Definition at line 346 of file m2mreporthandler.cpp.

void set_blockwise_notify ( bool  blockwise_notify )

Sets whether notification will be sent using blockwise or not.

Parameters:
blockwise_notifyIf True then notification is sent using blockwise.

Definition at line 694 of file m2mreporthandler.cpp.

void set_default_values (  )

Set back to default values.

Definition at line 492 of file m2mreporthandler.cpp.

void set_notification_in_queue ( bool  to_queue )

Set flag that new notification needs to be send.

Parameters:
to_queueIf True then notification is marked to be send

Definition at line 674 of file m2mreporthandler.cpp.

void set_notification_send_in_progress ( bool  progress )

Set flag that new notification needs to be send.

Parameters:
to_queueIf True then notification is marked to be send

Definition at line 684 of file m2mreporthandler.cpp.

void set_notification_trigger ( uint16_t  obj_instance_id = 0 )

Sets notification trigger.

Parameters:
obj_instance_id,Objectinstance id that has changed

Definition at line 122 of file m2mreporthandler.cpp.

void set_observation_token ( const uint8_t *  token,
const uint8_t  length 
)

Sets the observation token value.

Parameters:
tokenA pointer to the token of the resource.
lengthThe length of the token pointer.

Definition at line 618 of file m2mreporthandler.cpp.

void set_under_observation ( bool  observed )

Sets that object is under observation.

Parameters:
Valuefor the observation.
handler,Handlerobject for sending observation callbacks.

Definition at line 83 of file m2mreporthandler.cpp.

void set_value_float ( float  value )

Sets the float value of the given resource.

Parameters:
value,Valueof the observed resource.

Definition at line 98 of file m2mreporthandler.cpp.

void set_value_int ( int64_t  value )

Sets the integer value of the given resource.

Parameters:
value,Valueof the observed resource.

Definition at line 110 of file m2mreporthandler.cpp.