eSE_ReadMeterAttributes

teZCL_Status eSE_ReadMeterAttributes(
    uint8 u8SourceEndPointId,
    uint8 u8DestinationEndPointId,
    tsZCL_Address *psDestinationAddress,
    uint8 *pu8TransactionSequenceNumber);

Description

This function can be used to send a ‘read attributes’ request to the Simple Metering cluster on a remote endpoint. The function requests all Simple Metering attributes to be read - alternatively, the function eZCL_SendReadAttributesRequest() can be used if only specific attributes are required. Note that read access to cluster attributes on the remote node (server) and local node (client) must be enabled at compile-time, as described in Section 1.3.

You must specify the endpoint on the local node from which the request is to be sent. This is also used to identify the instance of the local shared device structure which holds the relevant attributes. The obtained attribute values are written to this shared structure by the function.

You must also specify the address of the destination node and the destination endpoint number. It is possible to use this function to send a request to bound endpoints or to a group of endpoints on remote nodes - in the latter case, a group address must be specified. Note that when sending requests to multiple endpoints through a single call to this function, multiple responses will subsequently be received from the remote endpoints.

You are also required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.

Following the first response to this function call, your application should call the function eSE_HandleReadAttributesResponse() to ensure that all the Simple Metering attributes are received from the remote endpoint.

Parameters

  • u8SourceEndPointId: Number of the local endpoint through which the request is sent

  • u8DestinationEndPointId: Number of the remote endpoint to which the request is sent. Note that this parameter is ignored when sending to address types E_ZCL_AM_BOUND and E_ZCL_AM_GROUP

  • psDestinationAddress: Pointer to a structure containing the address of the remote node to which the request is sent

  • pu8TransactionSequenceNumber: Pointer to a location to store the Transaction Sequence Number (TSN) of the request

Returns

  • E_ZCL_SUCCESS

  • E_ZCL_ERR_CLUSTER_NOT_FOUND

  • E_ZCL_ERR_CLUSTER_ID_RANGE

  • E_ZCL_ERR_EP_UNKNOWN

  • E_ZCL_ERR_EP_RANGE

  • E_ZCL_ERR_ATTRIBUTE_WO

  • E_ZCL_ERR_ATTRIBUTES_ACCESS

  • E_ZCL_ERR_ATTRIBUTE_NOT_FOUND

  • E_ZCL_ERR_PARAMETER_NULL

  • E_ZCL_ERR_PARAMETER_RANGE

Parent topic:Functions