Server Functions
The following Power Profile cluster functions can be used on a cluster server only:
eCLD_PPSchedule
teZCL_Status eCLD_PPSchedule(void);
Description
This function can be used on a cluster server to update the state of the currently active power profile and the timings required for scheduling. When called, the function automatically makes any required changes according to the scheduled energy phases for the power profile. If no change is scheduled, the function only updates timing information. If a change is required, it also updates the power profile state and the ID of the energy phase currently being executed.
The function should be called once per second to progress the active power profile schedule and the application should provide a 1-second timer to prompt these function calls.
Parameters
None
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_INVALID_VALUE
Parent topic:Server Functions
eCLD_PPSetPowerProfileState
teZCL_CommandStatus eCLD_PPSetPowerProfileState(
uint8 u8SourceEndPointId,
uint8 u8PowerProfileId,
teCLD_PP_PowerProfileState sPowerProfileState);
Description
This function can be used on a cluster server to move the specified power profile to the specified target state. Enumerations for the possible states are provided, and are listed and described in Section 21.9.2.
The function performs the following checks:
Checks whether the specified Power Profile ID exists (if not, the function returns with the status E_ZCL_CMDS_NOT_FOUND)
Checks whether the specified target state is a valid state (if not, the function returns with the status E_ZCL_CMDS_INVALID_VALUE)
Checks whether the power profile is currently able move to the target state (if not, the function returns with the status E_ZCL_CMDS_INVALID_FIELD)
Note: The power profile state can be changed by this function only if the move from the existing state to the target state is a valid change.
If all the checks are successful, the move is implemented (and the function returns with the status E_ZCL_CMD_SUCCESS).
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster resides
u8PowerProfileId : Identifier of the power profile
sPowerProfileState: Target state to which power profile is to be moved - enumerations are provided (see Section 21.9.2)
Returns
E_ZCL_CMD_SUCCESS
E_ZCL_CMDS_NOT_FOUND
E_ZCL_CMDS_INVALID_VALUE
E_ZCL_CMDS_INVALID_FIELD
Parent topic:Server Functions
eCLD_PPAddPowerProfileEntry
teZCL_Status eCLD_PPAddPowerProfileEntry(
uint8 u8SourceEndPointId,
tsCLD_PPEntry *psPowerProfileEntry);
Description
This function can be used on a cluster server to introduce a new power profile by adding an entry to the local power profile table.
The function checks whether there is sufficient space in the table for the new power profile entry (if not, the function returns with the status E_ZCL_ERR_INSUFFICIENT_SPACE).
An existing power profile entry can be over-written with a new profile by specifying the same Power Profile ID (in the new entry structure).
The function also updates two of the cluster attributes (if needed), as follows.
If a power profile is introduced which has multiple energy phases (as indicated by the
u8NumOfScheduledEnergyPhasesfield of thetsCLD_PPEntrystructure), the attributebMultipleSchedulingis set to TRUE (if not already TRUE)If a power profile is introduced which allows remote control for energy management (as indicated by the
bPowerProfileRemoteControlfield of thetsCLD_PPEntrystructure), the attributebEnergyRemoteis set to TRUE (if not already TRUE)
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster resides:
psPowerProfileEntry : Structure containing the power profile to add (see Section 21.10.2)
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_INSUFFICIENT_SPACE
Parent topic:Server Functions
eCLD_PPRemovePowerProfileEntry
teZCL_Status eCLD_PPRemovePowerProfileEntry(
uint8 u8SourceEndPointId,
uint8 u8PowerProfileId);
Description
This function can be used on a cluster server to remove a power profile by deleting the relevant entry in the local power profile table.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster resides:
u8PowerProfileId : Identifier of power profile to be removed
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
Parent topic:Server Functions
eCLD_PPGetPowerProfileEntry
teZCL_Status eCLD_PPGetPowerProfileEntry(
uint8 u8SourceEndPointId,
uint8 u8PowerProfileId,
tsCLD_PPEntry **ppsPowerProfileEntry);
Description
This function can be used on a cluster server to obtain an entry from the local power profile table. The required entry is specified using the relevant Power Profile ID. The function obtains a pointer to the relevant entry, if it exists - a pointer must be provided to a location to receive the pointer to the entry.
If no entry with the specified Power Profile ID is found, the function returns E_ZCL_ERR_INVALID_VALUE.
Parameters
u8SourceEndPointId: Number of local endpoint on which cluster resides
u8PowerProfileId: Identifier of power profile to be obtained
ppsPowerProfileEntry: Pointer to a location to receive a pointer to the required power profile table entry (see Section 21.10.2)
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_INVALID_VALUE
Parent topic:Server Functions
eCLD_PPPowerProfileNotificationSend
teZCL_Status eCLD_PPPowerProfileNotificationSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfilePayload *psPayload);
Description
This function can be used on the cluster server to send a Power Profile Notification to a cluster client, in order to inform the client about one power profile supported by the server. The notification contains essential information about the power profile, including the energy phases supported by the profile (and certain details about them). If the server supports multiple power profiles, the function must be called for each profile separately.
On receiving the notification on the client, the event E_CLD_PP_CMD_POWER_PROFILE_NOTIFICATION is generated, containing the sent power profile information in a tsCLD_PP_PowerProfilePayload structure (see Section 21.10.4).
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 server resides
u8DestinationEndPointId : Number of remote endpoint on which cluster client resides
psDestinationAddress: Pointer to a structure containing the destination address of the client 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.4), including essential information about the 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:Server Functions
eCLD_PPEnergyPhaseScheduleStateNotificationSend
teZCL_Status eCLD_PPEnergyPhasesScheduleStateNotificationSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_EnergyPhasesSchedulePayload
*psPayload);
Description
This function can be used on the cluster server to send an Energy Phases Schedule State Notification to a cluster client, in order to inform the client of the energy phases that are in the schedule of a particular power profile. The function is used to send an unsolicited command.
On receiving the notification on the client, the event E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_STATE_NOTIFICATION is generated, containing the sent power profile information in a tsCLD_PP_EnergyPhasesSchedulePayload structure (see Section 21.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 server resides
u8DestinationEndPointId: Number of remote endpoint on which cluster client resides
psDestinationAddress: Pointer to a structure containing the destination address of the client node
psDestinationAddress: 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.6), including the identifier of the relevant power profile and the associated schedule of energy phases
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Server Functions
eCLD_PPPowerProfileScheduleConstraintsNotificationSend
teZCL_Status eCLD_PPPowerProfileScheduleConstraintsNotificationSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfileScheduleConstraintsPayload
*psPayload);
Description
This function can be used on the cluster server to send a Power Profile Schedule Constraints Notification to a cluster client, in order to inform the client of the schedule restrictions on a particular power profile. The constraints are specified in a tsCLD_PP_PowerProfileScheduleConstraintsPayload structure (see Section 21.10.7). They can subsequently be used by the client in calculating the schedule for the energy phases of the power profile. The function is used to send an unsolicited command.
On receiving the notification on the client, the event E_CLD_PP_CMD_SCHEDULE_CONSTRAINTS_NOTIFICATION is generated, containing the sent power profile constraint information in a tsCLD_PP_PowerProfileScheduleConstraintsPayload structure.
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 server resides
u8DestinationEndPointId : Number of remote endpoint on which cluster client resides
psDestinationAddress: Pointer to a structure containing the destination address of the client 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.7), including the identifier of the relevant power profile and the associated schedule constraints
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Server Functions
eCLD_PPEnergyPhasesScheduleReqSend
teZCL_Status eCLD_PPEnergyPhasesScheduleReqSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfileReqPayload *psPayload);
Description
This function can be used on the cluster server to send an Energy Phases Schedule Request to a cluster client, in order to obtain the schedule of energy phases for a particular power profile.
The function is non-blocking and will return immediately. On successfully receiving an Energy Phases Schedule Response from the client, an E_CLD_PP_CMD_ENERGY_PHASE_SCHEDULE_RSP event is generated on the server, containing the requested schedule information in a tsCLD_PP_EnergyPhasesSchedulePayload structure (see Section 21.10.6). For full details of handling an Energy Phases Schedule Request, refer to Section21.5.4.1.
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 server resides:
u8DestinationEndPointId: Number of remote endpoint on which cluster client resides
psDestinationAddress: Pointer to a structure containing the destination address of the client 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:Server Functions
eCLD_PPPowerProfileStateNotificationSend
teZCL_Status eCLD_PPEnergyPhasesScheduleStateNotificationSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_EnergyPhasesSchedulePayload
*psPayload);
Description
This function can be used on the cluster server to send a Power Profile State Notification to a cluster client, in order to inform the client of the state of the power profile that is currently active on the server. The function is used to send an unsolicited command.
On receiving the notification on the client, the event E_CLD_PP_CMD_POWER_PROFILE_STATE_NOTIFICATION is generated, containing the sent power profile state information 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 server resides
u8DestinationEndPointId: Number of remote endpoint on which cluster client resides
psDestinationAddress: Pointer to a structure containing the destination address of the client 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.5), including the identifier and state 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:Server Functions
eCLD_PPGetPowerProfilePriceSend
teZCL_Status eCLD_PPGetPowerProfilePriceSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_PowerProfileReqPayload *psPayload);
Description
This function can be used on the cluster server to send a Get Power Profile Price Request to a cluster client, in order to request the cost of executing the schedule of a particular power profile. Use of this function must be enabled in the cluster compile-time options, as described in Section 21.11.
The function is non-blocking and will return immediately. On successfully receiving a Get Power Profile Price Response from the client, an E_CLD_PP_CMD_GET_POWER_PROFILE_PRICE_RSP event is generated on the server, containing the requested price information in a tsCLD_PP_GetPowerProfilePriceRspPayload structure (see Section21.10.9). For full details of handling a Get Power Profile Price Request, refer to Section 21.5.6.1.
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 server resides
u8DestinationEndPointId Number of remote endpoint on which cluster client resides
psDestinationAddress Pointer to a structure containing the destination address of the client 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.5), 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:Server Functions
eCLD_PPGetPowerProfilePriceExtendedSend
teZCL_Status eCLD_PPGetPowerProfilePriceExtendedSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_PP_GetPowerProfilePriceExtendedPayload
*psPayload);
Description
This function can be used on the cluster server to send a Get Power Profile Price Extended Request to a cluster client, in order to request specific cost information about a power profile supported by the server. The cost of executing a power profile can be requested with either scheduled energy phases or contiguous energy phases (no gaps between them). Use of this function must be enabled in the cluster compile-time options, as described in Section 21.11.
The function is non-blocking and will return immediately. On successfully receiving a Get Power Profile Price Extended Response from the client, an E_CLD_PP_CMD_GET_POWER_PROFILE_PRICE_EXTENDED_RSP event is generated on the server, containing the requested price information in a tsCLD_PP_GetPowerProfilePriceRspPayload structure (see Section21.10.9). For full details of handling a Get Power Profile Price Extended Request, refer to Section 21.5.6.1.
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 server resides
u8DestinationEndPointId Number of remote endpoint on which cluster client resides
psDestinationAddress Pointer to a structure containing the destination address of the client 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.8), including the type of price information required
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
Parent topic:Server Functions
eCLD_PPGetOverallSchedulePriceSend
teZCL_Status eCLD_PPGetOverallSchedulePriceSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber);
Description
This function can be used on the cluster server to send a Get Overall Schedule Price Request to a cluster client, in order to obtain the overall cost of all the power profiles that are executed over the next 24 hours. Use of this function must be enabled in the cluster compile-time options, as described in Section 21.11.
The function is non-blocking and will return immediately. On successfully receiving a Get Overall Schedule Price Response from the client, an E_CLD_PP_CMD_GET_OVERALL_SCHEDULE_PRICE_RSP event is generated on the server, containing the required price information in a tsCLD_PP_GetOverallSchedulePriceRspPayload structure (see Section21.10.10). For full details of handling a Get Overall Schedule Price Request, refer to Section 21.5.6.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 server resides
u8DestinationEndPointId: Number of remote endpoint on which cluster client resides
psDestinationAddress: Pointer to a structure containing the destination address of the client 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:Server Functions
Parent topic:Functions