Prepayment Server#

API and Callbacks for the Prepayment Cluster Server Component.

This component implements the server-side functionality of the Smart Energy 1.2 Prepayment cluster.

Modules#

Prepayment Server

API#

void
sl_zigbee_af_prepayment_server_publish_prepay_snapshot(sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint32_t snapshotId, uint32_t snapshotTime, uint8_t totalSnapshotsFound, uint8_t commandIndex, uint8_t totalNumberOfCommands, uint32_t snapshotCause, uint8_t snapshotPayloadType, uint8_t *snapshotPayload)

Send a publish prepay snapshot command sent in response to the get prepay snapshot command.

void
sl_zigbee_af_prepayment_server_publish_top_up_log(sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, sl_zigbee_zcl_top_up_payload_t *topUpPayload)

Send a publish top up log command, sent when a top up is performed or in response to a get top up log command.

void
sl_zigbee_af_prepayment_server_publish_debt_log(sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, sl_zigbee_zcl_debt_payload_t *debtPayload)

Send a publish debt log command.

Enumerations#

enum
SNAPSHOT_PAYLOAD_TYPE_DEBT_OR_CREDIT_STATUS = 0x00
}

Macros#

#define
SNAPSHOT_PAYLOAD_LEN 24

API Documentation#

sl_zigbee_af_prepayment_server_publish_prepay_snapshot#

void sl_zigbee_af_prepayment_server_publish_prepay_snapshot (sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint32_t snapshotId, uint32_t snapshotTime, uint8_t totalSnapshotsFound, uint8_t commandIndex, uint8_t totalNumberOfCommands, uint32_t snapshotCause, uint8_t snapshotPayloadType, uint8_t * snapshotPayload)

Send a publish prepay snapshot command sent in response to the get prepay snapshot command.

Parameters
TypeDirectionArgument NameDescription
sl_802154_short_addr_tN/AnodeId

The short address of the destination device.

uint8_tN/AsrcEndpoint

The source endpoint used in the ZigBee transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the ZigBee transmission.

uint32_tN/AsnapshotId

A unique identifier allocated by the device that created the snapshot.

uint32_tN/AsnapshotTime

The UTC time when the snapshot was taken.

uint8_tN/AtotalSnapshotsFound

The number of snapshots that matched the criteria in the received Get Prepay Snapshot command.

uint8_tN/AcommandIndex

Indicates a fragment number if the entire payload won't fit into 1 message.

uint8_tN/AtotalNumberOfCommands

The total number of subcommands that will be sent.

uint32_tN/AsnapshotCause

A 32-bit bitmap that indicates the cause of the snapshot.

uint8_tN/AsnapshotPayloadType

An 8-bit enumeration that defines the format of the snapshot payload.

uint8_t *N/AsnapshotPayload

Data that was created with the snapshot.


sl_zigbee_af_prepayment_server_publish_top_up_log#

void sl_zigbee_af_prepayment_server_publish_top_up_log (sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, sl_zigbee_zcl_top_up_payload_t * topUpPayload)

Send a publish top up log command, sent when a top up is performed or in response to a get top up log command.

Parameters
TypeDirectionArgument NameDescription
sl_802154_short_addr_tN/AnodeId

The short address of the destination device.

uint8_tN/AsrcEndpoint

The source endpoint used in the ZigBee transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the ZigBee transmission.

uint8_tN/AcommandIndex

Indicates a fragment number if the entire payload won't fit into 1 message.

uint8_tN/AtotalNumberOfCommands

The total number of subcommands that will be sent.

sl_zigbee_zcl_top_up_payload_t *N/AtopUpPayload

Information that is sent from each top up log entry.


sl_zigbee_af_prepayment_server_publish_debt_log#

void sl_zigbee_af_prepayment_server_publish_debt_log (sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, sl_zigbee_zcl_debt_payload_t * debtPayload)

Send a publish debt log command.

Parameters
TypeDirectionArgument NameDescription
sl_802154_short_addr_tN/AnodeId

The short address of the destination device.

uint8_tN/AsrcEndpoint

The source endpoint used in the ZigBee transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the ZigBee transmission.

uint8_tN/AcommandIndex

Indicates a fragment number if the entire payload won't fit into 1 message.

uint8_tN/AtotalNumberOfCommands

The total number of subcommands that will be sent.

sl_zigbee_zcl_debt_payload_t *N/AdebtPayload

Includes the contents of a debt record from the log.


Enumeration Documentation#

SnapshotPayloadType#

SnapshotPayloadType
Enumerator
SNAPSHOT_PAYLOAD_TYPE_DEBT_OR_CREDIT_STATUS