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
emberAfPluginPrepaymentServerPublishPrepaySnapshot(EmberNodeId 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
emberAfPluginPrepaymentServerPublishTopUpLog(EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, TopUpPayload *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
emberAfPluginPrepaymentServerPublishDebtLog(EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, DebtPayload *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#

emberAfPluginPrepaymentServerPublishPrepaySnapshot#

void emberAfPluginPrepaymentServerPublishPrepaySnapshot (EmberNodeId 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
EmberNodeIdN/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.


Definition at line 70 of file app/framework/plugin/prepayment-server/prepayment-server.h

emberAfPluginPrepaymentServerPublishTopUpLog#

void emberAfPluginPrepaymentServerPublishTopUpLog (EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, TopUpPayload * 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
EmberNodeIdN/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.

TopUpPayload *N/AtopUpPayload

Information that is sent from each top up log entry.


Definition at line 89 of file app/framework/plugin/prepayment-server/prepayment-server.h

emberAfPluginPrepaymentServerPublishDebtLog#

void emberAfPluginPrepaymentServerPublishDebtLog (EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t commandIndex, uint8_t totalNumberOfCommands, DebtPayload * debtPayload)

Send a publish debt log command.

Parameters
TypeDirectionArgument NameDescription
EmberNodeIdN/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.

DebtPayload *N/AdebtPayload

Includes the contents of a debt record from the log.


Definition at line 103 of file app/framework/plugin/prepayment-server/prepayment-server.h

Enumeration Documentation#

SnapshotPayloadType#

SnapshotPayloadType
Enumerator
SNAPSHOT_PAYLOAD_TYPE_DEBT_OR_CREDIT_STATUS

Definition at line 38 of file app/framework/plugin/prepayment-server/prepayment-server.h