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``8CommandId indicates 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

  • bIsInfoAvailable is 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

  • uReqMessage is a union containing the command payload for a request, as one of (depending on the value of u8CommandId):

    • psPowerProfileReqPayload is 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).

    • psGetPowerProfilePriceExtendedPayload is a pointer to the payload of a Get Power Profile Price Extended Request (see Section 21.10.8).

  • uRespMessage is a union containing the command payload for a response or notification, as one of (depending on the value of u8CommandId):

    • psGetPowerProfilePriceRspPayload is 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).

    • psEnergyPhasesSchedulePayload is 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).

    • psPowerProfileScheduleConstraintsPayload is a pointer to the payload of a Power Profile Schedule Constraints Response or a Power Profile Schedule Constraints Notification (see Section 21.10.10).

    • psPowerProfilePayload is a pointer to the payload of a Power Profile Response or a Power Profile Notification (see Section 21.10.4).

    • psPowerProfileStatePayload is 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:

  • u8PowerProfileId is the identifier of the power profile in the range 1 to 255 (0 is reserved)

  • u8NumOfTransferredEnergyPhases is the number of energy phases supported within the power profile

  • u8NumOfScheduledEnergyPhases is the number of energy phases actually scheduled within the power profile (must be less than or equal to the value of u8NumOfTransferredEnergyPhases)

  • u8ActiveEnergyPhaseId is 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)

  • bPowerProfileRemoteControl is 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 attribute bEnergyRemote)

  • u8PowerProfileState is a value indicating the current state of the power profile (enumerations are provided - see Section 21.9.2)

  • u16StartAfter is the minimum time-delay, in minutes, to be implemented between an instruction to start the power profile schedule and actually starting the schedule

  • u16StopBefore is 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:

  • u8TotalProfileNum is the total number of power profiles supported on the originating device

  • u8PowerProfileId is the identifier of the power profile being reported

  • u8NumOfTransferredPhases is the number of energy phases supported within the power profile

  • psEnergyPhaseInfo is 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:

  • u8PowerProfileCount is the number of power profiles in the payload

  • psPowerProfileRecord is 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:

  • u8PowerProfileId is the identifier of the power profile being reported

  • u8NumOfScheduledPhases is the number of energy phases within the power profile schedule

  • psEnergyPhaseDelay is 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:

  • u8PowerProfileId is the identifier of the power profile being reported

  • u16StartAfter is the minimum time-delay, in minutes, to be implemented between an instruction to start the power profile schedule and actually starting the schedule

  • u16StopBefore is 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:

  • u8Options is a bitmap indicating the type of request:

    • If bit 0 is set to ‘1’ then the u16PowerProfileStartTime field is used, otherwise it is ignored

    • If 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)

  • u8PowerProfileId is the identifier of the power profile

  • u16PowerProfileStartTime is an optional value (see u8Options above) 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:

  • u8PowerProfileId is the identifier of the power profile

  • u16Currency is a value representing the currency in which the price is quoted

  • u32Price is the price as an integer value (without a decimal point)

  • u8PriceTrailingDigits specifies the position of the decimal point in the price u32Price, 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:

  • u16Currency is a value representing the currency in which the price is quoted

  • u32Price represents the price as an integer value (without a decimal point)

  • u8PriceTrailingDigits specifies the position of the decimal point in the price u32Price, 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:

  • u8EnergyPhaseId is the identifier of the energy phase

  • u8MacroPhaseId is 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 strings

  • u16ExpectedDuration is the expected duration of the energy phase, in minutes

  • u16PeakPower is the estimated peak power of the energy phase, in Watts

  • u16Energy is the estimated total energy consumption, in Joules, during the energy phase (≤ u16PeakPower x u16ExpectedDuration x 60)

  • u16MaxActivationDelay is 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:

  • u8EnergyPhaseId is the identifier of the energy phase

  • u16ScheduleTime is 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:

  • u8PowerProfileId is the identifier of the power profile

  • u8EnergyPhaseId is the identifier of the currently running energy phase or, if currently between energy phases, the next energy phase to be run

  • bPowerProfileRemoteControl is a boolean indicating whether the power profile can be remotely controlled (from a client device): TRUE if it can be remotely controlled, FALSE otherwise

  • u8PowerProfileState is 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