Client Functions
The following Power Profile cluster functions can be used on a cluster client only:
eCLD_PPPowerProfileRequestSend
teZCL_Status eCLD_PPPowerProfileRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfileReqPayload *psPayload);
Description
This function can be used on a cluster client to send a Power Profile Request to the cluster server, in order to obtain one or more power profiles from the server. The function can be used to request a specific power profile (specified using its identifier) or all the power profiles supported by the server (specified using an identifier of zero).
The function is non-blocking and will return immediately. On receiving the server’s response, an E_CLD_PP_CMD_POWER_PROFILE_RSP event is generated on the client, containing a power profile in a tsCLD_PP_PowerProfilePayload structure (see Section 21.10.4).
When a particular Power Profile ID is specified but:
The Power Profile ID is not in the valid range, the server will send a default response of INVALID_VALUE.
The Power Profile ID is in the valid range but no data corresponding to this ID is available, the server will respond with a default response of NOT_FOUND.
When all power profiles on the server are requested, a response is received for each profile separately and, therefore, the above event is generated for each profile reported.
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the message. 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.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster client resides:
u8DestinationEndPointId : Number of remote endpoint on which cluster server resides
psDestinationAddress: Pointer to a structure containing the destination address of the server node
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the message
psPayload: Pointer to structure containing the payload for the request (see Section 21.10.3), including the identifier of the required power profile
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Client Functions
eCLD_PPEnergyPhasesScheduleNotificationSend
teZCL_Status eCLD_PPEnergyPhasesScheduleNotificationSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_EnergyPhasesSchedulePayload
*psPayload);
Description
This function can be used on a cluster client to send an Energy Phases Schedule Notification to the cluster server, in order to start the schedule of energy phases of a power profile on the server. The function is used to send an unsolicited command and should only be called if the server allows itself to be remotely controlled. The command payload specifies the identifiers of the required energy phases and includes the relative start-times of the phases (see Section 21.10.12).
On receiving the notification on the server, the event E_CLD_PP_CMD_ENERGY_PHASE_SCHEDULE_NOTIFICATION is generated, containing the sent energy phase schedule information in a tsCLD_PP_EnergyPhasesSchedulePayload structure (see Section 21.10.6). The subsequent handling of this notification is detailed in Section 21.5.4.2.
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the message. 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.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster client resides:
u8DestinationEndPointId : Number of remote endpoint on which cluster server resides
psDestinationAddress: Pointer to a structure containing the destination address of the server node
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the message
psPayload: Pointer to structure containing the payload for the command (see Section 21.10.6), including the scheduled energy phases and start-times
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Client Functions
eCLD_PPPowerProfileStateReqSend
teZCL_Status eCLD_PPPowerProfileStateReqSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber);
Description
This function can be used on a cluster client to send a Power Profile State Request to the cluster server, in order to obtain the identifier(s) of the power profile(s) currently supported on the server.
The function is non-blocking and returns immediately. On receiving the server’s response, an E_CLD_PP_CMD_POWER_PROFILE_STATE_RSP event is generated on the client, containing the required identifier(s). The response contains the power profile records of all the supported power profiles on the server in a tsCLD_PP_PowerProfileStatePayload structure (see Section 21.10.5).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the message. 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.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster client resides:
u8DestinationEndPointId : Number of remote endpoint on which cluster server resides
psDestinationAddress: Pointer to a structure containing the destination address of the server node
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the message
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Client Functions
eCLD_PPEnergyPhasesScheduleStateReqSend
teZCL_Status eCLD_PPEnergyPhasesScheduleStateReqSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfileReqPayload *psPayload);
Description
This function can be used on a cluster client to send an Energy Phases Schedule State Request to the cluster server, in order to obtain the schedule of energy phases for a particular power profile on the server. The obtained schedule can be used to re-align the schedule information on the client with the information on the server - for example, after a reset of the client device.
The function is non-blocking and returns immediately. On receiving the server’s response, an E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_STATE_RSP event is generated on the client, containing the requested schedule information in a tsCLD_PP_EnergyPhasesSchedulePayload structure (see Section21.10.6).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the message. 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.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster client resides
u8DestinationEndPointId : Number of remote endpoint on which cluster server resides
psDestinationAddress: Pointer to a structure containing the destination address of the server node
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the message
psPayload: Pointer to structure containing the payload for the request (see Section 21.10.3), including the identifier of the relevant power profile
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Client Functions
eCLD_PPPowerProfileScheduleConstraintsReqSend
teZCL_Status eCLD_PPPowerProfileScheduleConstraintsReqSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfileReqPayload *psPayload);
Description
This function can be used on a cluster client to send a Power Profile Schedule Constraints Request to the cluster server, in order to obtain the schedule restrictions on a particular power profile on the server. The obtained constraints can subsequently be used in calculating a schedule of energy phases for the power profile (e.g. before calling eCLD_PPEnergyPhasesScheduleNotificationSend()).
The function is non-blocking and will return immediately. The server will send a response to this request and on receiving this response, an E_CLD_PP_CMD_GET_POWER_PROFILE_SCHEDULE_CONSTRAINTS_RSP event is generated on the client, containing the requested schedule constraints in a tsCLD_PP_PowerProfileScheduleConstraintsPayload structure (see Section 21.10.7).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the message. 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.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster client resides
u8DestinationEndPointId : Number of remote endpoint on which cluster server resides
psDestinationAddress: Pointer to a structure containing the destination address of the server node
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the message
psPayload: Pointer to structure containing the payload for the request (see Section 21.10.3), including the identifier of the relevant power profile
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Client Functions
Parent topic:Functions