Structures
tsCLD_PPCallBackMessage
For a Power Profile event, the eEventType field of the tsZCL_CallBackEvent structure is set to E_ZCL_CBET_CLUSTER_CUSTOM. This event structure also contains an element sClusterCustomMessage, which is itself a structure containing a field pvCustomData. This field is a pointer to the following tsCLD_PPCallBackMessage structure:
typedef struct
{
uint8 u8CommandId;
#ifdef PP_CLIENT
bool bIsInfoAvailable;
#endif
union
{
tsCLD_PP_PowerProfileReqPayload *psPowerProfileReqPayload;
tsCLD_PP_GetPowerProfilePriceExtendedPayload
*psGetPowerProfilePriceExtendedPayload;
} uReqMessage;
union
{ tsCLD_PP_GetPowerProfilePriceRspPayload *psGetPowerProfilePriceRspPayload;
tsCLD_PP_GetOverallSchedulePriceRspPayload
*psGetOverallSchedulePriceRspPayload;
tsCLD_PP_EnergyPhasesSchedulePayload *psEnergyPhasesSchedulePayload;
tsCLD_PP_PowerProfileScheduleConstraintsPayload
*psPowerProfileScheduleConstraintsPayload;
tsCLD_PP_PowerProfilePayload *psPowerProfilePayload;
tsCLD_PP_PowerProfileStatePayload *psPowerProfileStatePayload;
}uRespMessage;
} tsCLD_PPCallBackMessage;
where:
u``8CommandIdindicates the type of Power Profile command that has been received, one of:E_CLD_PP_CMD_POWER_PROFILE_REQ
E_CLD_PP_CMD_ POWER_PROFILE_STATE_REQ
E_CLD_PP_CMD_GET_POWER_PROFILE_PRICE_RSP
E_CLD_PP_CMD_GET_POWER_PROFILE_PRICE_EXTENDED_RSP
E_CLD_PP_CMD_GET_OVERALL_SCHEDULE_PRICE_RSP
E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_NOTIFICATION
E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_RSP
E_CLD_PP_CMD_GET_POWER_PROFILE_SCHEDULE_CONSTRAINTS_REQ
E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_STATE_REQ
E_CLD_PP_CMD_POWER_PROFILE_NOTIFICATION
E_CLD_PP_CMD_POWER_PROFILE_RSP
E_CLD_PP_CMD_POWER_PROFILE_STATE_RSP
E_CLD_PP_CMD_POWER_PROFILE_STATE_NOTIFICATION
E_CLD_PP_CMD_GET_POWER_PROFILE_PRICE
E_CLD_PP_CMD_GET_OVERALL_SCHEDULE_PRICE
E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_REQ
E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_STATE_RSP
E_CLD_PP_CMD_ENERGY_PHASES_SCHEDULE_STATE_NOTIFICATION
E_CLD_PP_CMD_SCHEDULE_CONSTRAINTS_NOTIFICATION
E_CLD_PP_CMD_GET_POWER_PROFILE_SCHEDULE_CONSTRAINTS_RSP
E_CLD_PP_CMD_GET_POWER_PROFILE_PRICE_EXTENDED
bIsInfoAvailableis a client-only boolean field which indicates whether the appropriate type of information (to which the event relates) is held on the client:TRUE if the information type is held on the client, FALSE otherwise
uReqMessageis a union containing the command payload for a request, as one of (depending on the value ofu8CommandId):psPowerProfileReqPayloadis a pointer to the payload of a Power Profile Request, a Get Power Profile Schedule Constraints Request, an Energy Phases Schedule Request, an Energy Phases Schedule State Request or a Get Power Profile Price Request (see Section 21.10.5).psGetPowerProfilePriceExtendedPayloadis a pointer to the payload of a Get Power Profile Price Extended Request (see Section 21.10.8).
uRespMessageis a union containing the command payload for a response or notification, as one of (depending on the value ofu8CommandId):psGetPowerProfilePriceRspPayloadis a pointer to the payload of a Get Power Profile Price Response or a Get Power Profile Price Extended Response (see Section 21.10.9)psGetOverallSchedulePriceRspPayloadis a pointer to the payload of a Get Overall Schedule Price Response (seeSection 21.10.10).psEnergyPhasesSchedulePayloadis a pointer to the payload of an Energy Phases Schedule Response, an Energy Phases Schedule State Response, an Energy Phases Schedule Notification or an Energy Phases Schedule State Notification (see Section 21.6).psPowerProfileScheduleConstraintsPayloadis a pointer to the payload of a Power Profile Schedule Constraints Response or a Power Profile Schedule Constraints Notification (see Section 21.10.10).psPowerProfilePayloadis a pointer to the payload of a Power Profile Response or a Power Profile Notification (see Section 21.10.4).psPowerProfileStatePayloadis a pointer to the payload of a Power Profile State Response or a Power Profile State Notification (see Section 21.10.5).
Note: The command payload for each command type is indicated in Table 30 and Table 31 in Section 21.6.
Parent topic:Structures
tsCLD_PPEntry
This structure contains the data for a power profile table entry.
typedef struct
{
zuint8 u8PowerProfileId;
zuint8 u8NumOfTransferredEnergyPhases;
zuint8 u8NumOfScheduledEnergyPhases;
zuint8 u8ActiveEnergyPhaseId;
tsCLD_PP_EnergyPhaseDelay
asEnergyPhaseDelay[CLD_PP_NUM_OF_ENERGY_PHASES];
tsCLD_PP_EnergyPhaseInfo
asEnergyPhaseInfo[CLD_PP_NUM_OF_ENERGY_PHASES];
zbool bPowerProfileRemoteControl;
zenum8 u8PowerProfileState;
zuint16 u16StartAfter;
zuint16 u16StopBefore;
} tsCLD_PPEntry;
where:
u8PowerProfileIdis the identifier of the power profile in the range 1 to 255 (0 is reserved)u8NumOfTransferredEnergyPhasesis the number of energy phases supported within the power profileu8NumOfScheduledEnergyPhasesis the number of energy phases actually scheduled within the power profile (must be less than or equal to the value ofu8NumOfTransferredEnergyPhases)u8ActiveEnergyPhaseIdis the identifier of the energy phase that is currently active or will be active next (if currently between energy phases)asEnergyPhaseDelay[]is an array containing timing information on the scheduled energy phases, where each array element corresponds to one energy phase of the schedule (see Section 21.10.12)asEnergyPhaseInfo[]is an array containing various information on the supported energy phases, where each array element corresponds to one energy phase of the profile (see Section 21.10.11)bPowerProfileRemoteControlis a boolean indicating whether the power profile can be remotely controlled: TRUE if it can be remotely controlled, FALSE otherwise (this property directly affects the attributebEnergyRemote)u8PowerProfileStateis a value indicating the current state of the power profile (enumerations are provided - see Section 21.9.2)u16StartAfteris the minimum time-delay, in minutes, to be implemented between an instruction to start the power profile schedule and actually starting the scheduleu16StopBeforeis the maximum time-delay, in minutes, to be implemented between an instruction to stop the power profile schedule and actually stopping the schedule
Parent topic:Structures
tsCLD_PP_PowerProfileReqPayload
This structure contains the payload of various power profile requests.
typedef struct
{
zuint8 u8PowerProfileId;
}tsCLD_PP_PowerProfileReqPayload;
where u8PowerProfileId is the identifier of the power profile of interest.
Parent topic:Structures
tsCLD_PP_PowerProfilePayload
This structure contains the payload of a Power Profile Response or of a Power Profile Notification, which reports the details of a power profile.
typedef struct
{
zuint8 u8TotalProfileNum;
zuint8 u8PowerProfileId;
zuint8 u8NumOfTransferredPhases;
tsCLD_PP_EnergyPhaseInfo *psEnergyPhaseInfo;
}tsCLD_PP_PowerProfilePayload;
where:
u8TotalProfileNumis the total number of power profiles supported on the originating deviceu8PowerProfileIdis the identifier of the power profile being reportedu8NumOfTransferredPhasesis the number of energy phases supported within the power profilepsEnergyPhaseInfois a pointer to a structure or an array of structures (see Section 21.10.11) containing information on the supported energy phases, where each array element corresponds to one energy phase of the profile
Parent topic:Structures
tsCLD_PP_PowerProfileStatePayload
This structure contains the payload of a Power Profile State Response or of a Power Profile State Notification.
typedef struct
{
zuint8 u8PowerProfileCount;
tsCLD_PP_PowerProfileRecord *psPowerProfileRecord;
}tsCLD_PP_PowerProfileStatePayload;
where:
u8PowerProfileCountis the number of power profiles in the payloadpsPowerProfileRecordis a pointer to one or more power profile records (see Section 21.10.13):For a Power Profile State Notification, it is a pointer to the power profile record of the currently active power profile on the server
For a Power Profile State Response, it is a pointer to an array of power profile records for all the supported power profiles on the server
Parent topic:Structures
tsCLD_PP_EnergyPhasesSchedulePayload
This structure contains the payload of an Energy Phases Schedule Response, of an Energy Phases Schedule State Response or of an Energy Phases Schedule State Notification.
typedef struct
{
zuint8 u8PowerProfileId;
zuint8 u8NumOfScheduledPhases;
tsCLD_PP_EnergyPhaseDelay
*psEnergyPhaseDelay;
}tsCLD_PP_EnergyPhasesSchedulePayload;
where:
u8PowerProfileIdis the identifier of the power profile being reportedu8NumOfScheduledPhasesis the number of energy phases within the power profile schedulepsEnergyPhaseDelayis a pointer to an array containing timing information on the scheduled energy phases, where each array element corresponds to one energy phase of the schedule (see Section 21.10.12)
Parent topic:Structures
tsCLD_PP_PowerProfileScheduleConstraintsPayload
This structure contains the payload of a Power Profile Schedule Constraints Response or of a Power Profile Schedule Constraints Notification, which reports the schedule restrictions on a particular power profile.
typedef struct
{
zuint8 u8PowerProfileId;
zuint16 u16StartAfter;
zuint16 u16StopBefore;
} tsCLD_PP_PowerProfileScheduleConstraintsPayload;
where:
u8PowerProfileIdis the identifier of the power profile being reportedu16StartAfteris the minimum time-delay, in minutes, to be implemented between an instruction to start the power profile schedule and actually starting the scheduleu16StopBeforeis the maximum time-delay, in minutes, to be implemented between an instruction to stop the power profile schedule and actually stopping the schedule
Parent topic:Structures
tsCLD_PP_GetPowerProfilePriceExtendedPayload
This structure contains the payload of a Get Power Profile Price Extended Request, which requests certain price information relating to a particular power profile.
typedef struct
{
zbmap8 u8Options;
zuint8 u8PowerProfileId;
zuint16 u16PowerProfileStartTime;
}tsCLD_PP_GetPowerProfilePriceExtendedPayload;
where:
u8Optionsis a bitmap indicating the type of request:If bit 0 is set to ‘1’ then the
u16PowerProfileStartTimefield is used, otherwise it is ignoredIf bit 1 is set to ‘0’ then an estimated price is required for contiguous energy phases (with no gaps between them); if bit 1 is set ‘1’ then an estimated price is required for the energy phases as scheduled (with any scheduled gaps between them)
u8PowerProfileIdis the identifier of the power profileu16PowerProfileStartTimeis an optional value (seeu8Optionsabove) which indicates the required start-time for execution of the power profile, in minutes, as measured from the current time
Parent topic:Structures
tsCLD_PP_GetPowerProfilePriceRspPayload
This structure contains the payload of a Get Power Profile Price Response, which is returned in reply to a Get Power Profile Price Request and a Get Power Profile Price Extended Request.
typedef struct
{
zuint8 u8PowerProfileId;
zuint16 u16Currency;
zuint32 u32Price;
zuint8 u8PriceTrailingDigits;
}tsCLD_PP_GetPowerProfilePriceRspPayload;
where:
u8PowerProfileIdis the identifier of the power profileu16Currencyis a value representing the currency in which the price is quotedu32Priceis the price as an integer value (without a decimal point)u8PriceTrailingDigitsspecifies the position of the decimal point in the priceu32Price, by indicating the number of digits after the decimal point
Parent topic:Structures
tsCLD_PP_GetOverallSchedulePriceRspPayload
This structure contains the payload of a Energy Phases Schedule Response, which contains the overall cost of all the power profiles that will be executed over the next 24 hours.
typedef struct
{
zuint16 u16Currency;
zuint32 u32Price;
zuint8 u8PriceTrailingDigits;
}tsCLD_PP_GetOverallSchedulePriceRspPayload;
where:
u16Currencyis a value representing the currency in which the price is quotedu32Pricerepresents the price as an integer value (without a decimal point)u8PriceTrailingDigitsspecifies the position of the decimal point in the priceu32Price, by indicating the number of digits after the decimal point
Parent topic:Structures
tsCLD_PP_EnergyPhaseInfo
This structure contains various pieces of information about a specific energy phase of a power profile.
typedef struct
{
zuint8 u8EnergyPhaseId;
zuint8 u8MacroPhaseId;
zuint16 u16ExpectedDuration;
zuint16 u16PeakPower;
zuint16 u16Energy;
zuint16 u16MaxActivationDelay;
}tsCLD_PP_EnergyPhaseInfo;
where:
u8EnergyPhaseIdis the identifier of the energy phaseu8MacroPhaseIdis a value that may be used to obtain a name/label for the energy phase for display purposes - for example, it may be the index of an entry in a table of ASCII stringsu16ExpectedDurationis the expected duration of the energy phase, in minutesu16PeakPoweris the estimated peak power of the energy phase, in Wattsu16Energyis the estimated total energy consumption, in Joules, during the energy phase (≤u16PeakPowerxu16ExpectedDurationx60)u16MaxActivationDelayis the maximum delay, in minutes, between the end of the previous energy phase and the start of this energy phase - special values are as follows: 0x0000 if no delay possible, 0xFFFF if first energy phase
Note: If u16MaxActivationDelay is non-zero, a delayed start-time for the energy phase can be set through the structure tsCLD_PP_EnergyPhaseDelay (see Section 21.10.12).
Parent topic:Structures
tsCLD_PP_EnergyPhaseDelay
This structure contains the start-time for a particular energy phase of a power profile.
typedef struct
{
zuint8 u8EnergyPhaseId;
zuint16 u16ScheduleTime;
}tsCLD_PP_EnergyPhaseDelay;
where:
u8EnergyPhaseIdis the identifier of the energy phaseu16ScheduleTimeis the start-time of the energy phase expressed as a delay, in minutes, from the end of the previous energy phase (for the first energy phase of a power profile schedule, this delay is measured from the start of the schedule)
Note: A delayed start-time for the energy phase can only be set through this structure if the field u16MaxActivationDelay of the structure tsCLD_PP_EnergyPhaseInfo for this energy phase is non-zero (see Section 21.10.11).
Parent topic:Structures
tsCLD_PP_PowerProfiIeRecord
This structure contains information about the current state of a power profile.
typedef struct
{
zuint8 u8PowerProfileId;
zuint8 u8EnergyPhaseId;
zbool bPowerProfileRemoteControl;
zenum8 u8PowerProfileState;
} tsCLD_PP_PowerProfileRecord;
where:
u8PowerProfileIdis the identifier of the power profileu8EnergyPhaseIdis the identifier of the currently running energy phase or, if currently between energy phases, the next energy phase to be runbPowerProfileRemoteControlis a boolean indicating whether the power profile can be remotely controlled (from a client device): TRUE if it can be remotely controlled, FALSE otherwiseu8PowerProfileStateis an enumeration indicating the current state of the power profile (see Section 21.9.2)
Parent topic:Structures
tsCLD_PPCustomDataStructure
The Power Profile cluster requires extra storage space to be allocated to be used by internal functions. The structure definition for this storage is shown below:
typedef struct
{
#ifdef (CLD_PP) && (PP_SERVER)
bool bOverrideRunning;
uint8 u8ActSchPhaseIndex;
tsCLD_PPEntryasPowerProfileEntry[CLD_PP_NUM_OF_POWER_PROFILES];
#endif
tsZCL_ReceiveEventAddress sReceiveEventAddress;
tsZCL_CallBackEvent sCustomCallBackEvent;
tsCLD_PPCallBackMessage sCallBackMessage;
} tsCLD_PPCustomDataStructure;
The fields are for internal use and no knowledge of them is required.
Parent topic:Structures
Parent topic:Power Profile Cluster