Tizen Native API  5.0
Read Attribute Status Record

The read attribute status record.

Required Header

#include <zigbee.h>

Overview

The read attributes status record is generated in response to a read attributes or read attributes structured command. The command frame shall contain a read attribute status record for each attribute identifier specified in the original read attributes or read attributes structured command. For each read attribute status record, the attribute identifier field shall contain the identifier specified in the original read attributes or read attributes structured command. The status field shall contain a suitable status code.

Functions

int zb_read_attr_status_record_create (zb_zcl_read_attr_status_record_h *handle)
 Creates a read attribute status record.
int zb_read_attr_status_record_clone (zb_zcl_read_attr_status_record_h src, zb_zcl_read_attr_status_record_h *dst)
 Clones a read attribute status record.
int zb_read_attr_status_record_destroy (zb_zcl_read_attr_status_record_h handle)
 Destroys a read attribute status record.
int zb_read_attr_status_record_get_id (zb_zcl_read_attr_status_record_h handle, zb_attribute_id *id)
 Gets identifier from read attribute status record.
int zb_read_attr_status_record_set_id (zb_zcl_read_attr_status_record_h handle, zb_attribute_id id)
 Sets identifier to read attribute status record.
int zb_read_attr_status_record_get_status (zb_zcl_read_attr_status_record_h handle, zb_zcl_status_e *status)
 Gets status from read attribute status record.
int zb_read_attr_status_record_set_status (zb_zcl_read_attr_status_record_h handle, zb_zcl_status_e status)
 Sets status to read attribute status record.
int zb_read_attr_status_record_get_type (zb_zcl_read_attr_status_record_h handle, zb_zcl_data_type_e *type)
 Gets type from read attribute status record.
int zb_read_attr_status_record_set_type (zb_zcl_read_attr_status_record_h handle, zb_zcl_data_type_e type)
 Sets type to read attribute status record.
int zb_read_attr_status_record_get_value (zb_zcl_read_attr_status_record_h handle, zb_zcl_data_type_e *type, unsigned char **value, int *count)
 Gets data value from read attribute status record.
int zb_read_attr_status_record_set_value (zb_zcl_read_attr_status_record_h handle, zb_zcl_data_type_e type, unsigned char *value, int count)
 Sets data value to read attribute status record.

Function Documentation

Clones a read attribute status record.

Since :
5.0
Remarks:
The dst should be released using zb_read_attr_status_record_destroy().
Parameters:
[in]srcSource handle of read attribute status record
[in]dstDestination handle of read attribute status record
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
ZIGBEE_ERROR_NO_DATANo data
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()

Creates a read attribute status record.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Parameters:
[in]handleThe handle of read attribute status record
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_clone()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()

Gets identifier from read attribute status record.

The attribute identifier field is 16 bits in length and shall contain the identifier of the attribute that has been read (or of which an element has been read).

This field shall contain the same value that was included in the corresponding attribute identifier field of the original read attributes or read attributes structured command.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[out]idAttribute identifier
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()

Gets status from read attribute status record.

The status field is 8 bits in length and specifies the status of the read operation on this attribute.

This field shall be set to ZB_ZCL_STATUS_SUCCESS, if the operation was successful, or an error code, as specified in zb_zcl_status_e if the operation was not successful.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[out]statuserror code
See also:
zb_zcl_status_e
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()

Gets type from read attribute status record.

The attribute data type field shall contain the data type of the attribute in the same read attributes status record.

This field shall only be included if the associated status field contains a value of ZB_ZCL_STATUS_SUCCESS.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[out]typeData type
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_value()
int zb_read_attr_status_record_get_value ( zb_zcl_read_attr_status_record_h  handle,
zb_zcl_data_type_e type,
unsigned char **  value,
int *  count 
)

Gets data value from read attribute status record.

The attribute value field is variable in length and shall contain the current value of this attribute.

This field shall only be included if the associated status field contains a value of ZB_ZCL_STATUS_SUCCESS. For an attribute or element of simple type, this field has the format shown in the Table of Data Types .

Since :
5.0
Remarks:
The value should be released using free().
Parameters:
[in]handleThe handle of read attribute status record
[out]typeAttribute data type. The attribute data type shall contain the data type of the attribute in the same read attributes status record (see zb_zcl_data_type_e). This field shall only be included if the status code is ZB_ZCL_STATUS_SUCCESS.
[out]valueAttribute value. The attribute value field is variable in length and shall contain the current value of this attribute. This field shall only be included if the associated status field contains a value of ZB_ZCL_STATUS_SUCCESS. For an attribute or element of simple type (not array, structure, set or bag), this field has the format shown in the Table of Data Types (see zb_zcl_data_type_e).
[out]countThe number of attribute data
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NO_DATANo data available
ZIGBEE_ERROR_OUT_OF_MEMORYOut-of-memory
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()

Sets identifier to read attribute status record.

The attribute identifier field is 16 bits in length and shall contain the identifier of the attribute that has been read (or of which an element has been read).

This field shall contain the same value that was included in the corresponding attribute identifier field of the original read attributes or read attributes structured command.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[in]idAttribute identifier
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()

Sets status to read attribute status record.

The status field is 8 bits in length and specifies the status of the read operation on this attribute.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[in]statuserror code
See also:
zb_zcl_status_e
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()

Sets type to read attribute status record.

The attribute data type field shall contain the data type of the attribute in the same read attributes status record.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[in]typeData type
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_read_attr_status_record_set_value()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()
int zb_read_attr_status_record_set_value ( zb_zcl_read_attr_status_record_h  handle,
zb_zcl_data_type_e  type,
unsigned char *  value,
int  count 
)

Sets data value to read attribute status record.

The attribute value field is variable in length and shall contain the current value of this attribute.

For an attribute or element of simple type, this field has the format shown in the zb_zcl_data_type_e.

Since :
5.0
Parameters:
[in]handleThe handle of read attribute status record
[in]typeAttribute data type
[in]valueAttribute data value
[in]countThe length of attribute data
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NO_DATANo data available
ZIGBEE_ERROR_OUT_OF_MEMORYOut-of-memory
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_read_attr_status_record_create()
zb_read_attr_status_record_destroy()
zb_read_attr_status_record_set_id()
zb_read_attr_status_record_set_status()
zb_zcl_global_attr_read_cb()
zb_read_attr_status_record_get_id()
zb_read_attr_status_record_get_status()
zb_read_attr_status_record_get_type()
zb_read_attr_status_record_get_value()