ZCL library  4.3
ZCL library to manage a Zigbee network
ReadAttribute Class Reference

This Class defines the Read attribute. More...

#include <ReadAttribute.h>

Inheritance diagram for ReadAttribute:
DiscoveredAttribute Attribute ReportAttribute ClusterSpecCmdAttribute WriteAttribute ReadAttributeResponse

List of all members.

Public Member Functions

const byte * getData (int &size) const
 Get the data of this attribute.
bool getDataAsBoolean () const
 Get the data as a boolean.
const char * getDataAsString () const
 Get the data as a string.
std::string getDataAsUTF8String () const
 Get the data as a UTF-8 string.
long getDataAsNumber () const
 Get the data as a number.
long long getDataAs64bitsNumber () const
 Get the data as a 64 bits number.
float getDataAsFloat () const
 Get the data as a float.
double getDataAsDouble () const
 Get the data as a double.
virtual const byte * toBytes (int &size)
 Return the attribute as array of bytes.

Detailed Description

This Class defines the Read attribute.


Member Function Documentation

const byte* ReadAttribute::getData ( int &  size) const

Get the data of this attribute.

Parameters:
[out]sizethe returned data array size.
Returns:
the data as an array of bytes.
long long ReadAttribute::getDataAs64bitsNumber ( ) const

Get the data as a 64 bits number.

the DataType of this attribute must be equal to

  • UNSIGNED_8BITS to UNSIGNED_64BITS
  • SIGNED_8BITS to SIGNED_64BITS
  • DATA_8BITS to DATA_64BITS
  • BITMAP_8BITS to BITMAP_64BITS
  • ENUMERATION_8BITS to ENUMERATION_16BITS
  • UTC_TIME
  • CLUSTER_ID
  • ATTRIBUTE_ID
  • BACNET_OID
  • BOOLEAN_8BITS
Returns:
the data as a 64 bits number.
bool ReadAttribute::getDataAsBoolean ( ) const

Get the data as a boolean.

the DataType of this attribute must be equal to

  • BOOLEAN_8BITS
Returns:
the data as a boolean;
double ReadAttribute::getDataAsDouble ( ) const

Get the data as a double.

the DataType of this attribute must be equal to

  • DataType.SEMI_PRECISION
  • DataType.SINGLE_PRECISION
  • DataType.DOUBLE_PRECISION
Returns:
the data as a double.
float ReadAttribute::getDataAsFloat ( ) const

Get the data as a float.

the DataType of this attribute must be equal to

  • DataType.SEMI_PRECISION
  • DataType.SINGLE_PRECISION
Returns:
the data as a float.
long ReadAttribute::getDataAsNumber ( ) const

Get the data as a number.

the DataType of this attribute must be equal to

  • UNSIGNED_8BITS to UNSIGNED_32BITS
  • SIGNED_8BITS to SIGNED_32BITS
  • DATA_8BITS to DATA_32BITS
  • BITMAP_8BITS to BITMAP_32BITS
  • ENUMERATION_8BITS to ENUMERATION_16BITS
  • UTC_TIME
  • CLUSTER_ID
  • ATTRIBUTE_ID
  • BACNET_OID
  • BOOLEAN_8BITS
Returns:
the data as a number.
const char* ReadAttribute::getDataAsString ( ) const

Get the data as a string.

the DataType of this attribute must be equal to

  • CHARACTER_STRING
  • LONG_CHAR_STRING
Returns:
the data as a string;
std::string ReadAttribute::getDataAsUTF8String ( ) const

Get the data as a UTF-8 string.

the DataType of this attribute must be equal to

  • DataType.OCTET_STRING
  • DataType.CHARACTER_STRING
Returns:
the data as a UTF-8 string;
virtual const byte* ReadAttribute::toBytes ( int &  size) [virtual]

Return the attribute as array of bytes.

Parameters:
[out]sizethe returned array size.
Returns:
the array of bytes.

Reimplemented from DiscoveredAttribute.

Reimplemented in ClusterSpecCmdAttribute, WriteAttribute, ReadAttributeResponse, and ReportAttribute.


The documentation for this class was generated from the following file: