Plugin Commands: Prepayment Server#

The prepayment server handles all implemented commands of the prepayment cluster server.

Macros#

#define

plugin prepayment-server addSnapshotEvent [endpoint:1] [snapshotCause:4]

#define

plugin prepayment-server getTopUpPercent [endpoint:1] [topUpValue:4]

#define

plugin prepayment-server publishPrepaySnapshot [nodeId:2] [srcEndpoint:1] [dstEndpoint:1] [snapshotTableIndex:4]

#define

plugin prepayment-server readDebtAttribs [endpoint:1] [index:1]

#define

plugin prepayment-server schedDebtRepay [endpoint:1] [issuerEvtId:4] [debtType:1] [collectTime:2] [startTime:4] [collectFreq:1]

#define

plugin prepayment-server verifyAttribute [endpoint:1] [attributeId:2] [attributeSize:1] [expectedAttributeValue:4]

#define

plugin prepayment-server verifyPaymentMode [endpoint:1] [expectedPaymentModeValue:2]

#define

plugin prepayment-server writeAttribute [endpoint:1] [attributeId:2] [attributeType:1] [numBytes:1] [value:4]

Macro Definition Documentation#

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_ADD_SNAPSHOT_EVENT#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_ADD_SNAPSHOT_EVENT

plugin prepayment-server addSnapshotEvent [endpoint:1] [snapshotCause:4]

  • Add a snapshot event to the prepayment server.

    • endpoint - INT8U - Endpoint of the device from which the snapshot will be taken

    • snapshotCause - INT32U - A bitmask indicating the cause of the snapshot


Definition at line 4882 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_CHECK_CALENDAR#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_CHECK_CALENDAR

plugin prepayment-server checkCalendar [utcTime:4]

  • Check that UTC time and calendar dates can be interchanged correctly.

    • utcTime - INT32U - The UTC time that should be tested.


Definition at line 4888 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_GET_TOP_UP_PERCENT#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_GET_TOP_UP_PERCENT

plugin prepayment-server getTopUpPercent [endpoint:1] [topUpValue:4]

  • Determine the total top up percentage required for debt reduction.

    • endpoint - INT8U - The endpoint from which the debt attribute set will be read.

    • topUpValue - INT32U - The current top up value from which a percentage may be required for debt reduction


Definition at line 4895 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_GET_WEEKDAY_FROM_UTC#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_GET_WEEKDAY_FROM_UTC

plugin prepayment-server getWeekdayFromUtc [utcTime:4]

  • Read the day of the week for a given UTC time.

    • utcTime - INT32U - The UTC time that should be converted.


Definition at line 4901 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_INIT#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_INIT

plugin prepayment-server init [endpoint:1]

  • Initialize the prepayment server and snapshot table.

    • endpoint - INT8U - Endpoint of the prepayment server.


Definition at line 4907 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_PUBLISH_PREPAY_SNAPSHOT#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_PUBLISH_PREPAY_SNAPSHOT

plugin prepayment-server publishPrepaySnapshot [nodeId:2] [srcEndpoint:1] [dstEndpoint:1] [snapshotTableIndex:4]

  • Send the publish prepay snapshot command.

    • nodeId - INT16U - NodeId of the destination device

    • srcEndpoint - INT8U - The source endpoint of the sending device

    • dstEndpoint - INT8U - The destination endpoint of the receiving device

    • snapshotTableIndex - INT32U - A unique identifier assigned by the device creating the snapshot


Definition at line 4916 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_READ_DEBT_ATTRIBS#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_READ_DEBT_ATTRIBS

plugin prepayment-server readDebtAttribs [endpoint:1] [index:1]

  • Read the values from the debt attribute set for a given index (1,2,3).

    • endpoint - INT8U - The endpoint from which the debt attribute set will be read.

    • index - INT8U - The index of the debt attribute set to read - 1, 2, or 3.


Definition at line 4923 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_READ_DEBT_LOG#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_READ_DEBT_LOG

plugin prepayment-server readDebtLog [index:1]

  • Read the values from the debt log from a specified index.

    • index - INT8U - The index of the debt log to read.


Definition at line 4929 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_SCHED_DEBT_REPAY#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_SCHED_DEBT_REPAY

plugin prepayment-server schedDebtRepay [endpoint:1] [issuerEvtId:4] [debtType:1] [collectTime:2] [startTime:4] [collectFreq:1]

  • Check that debt repayment handling correctly calculates and schedules various attributes.

    • endpoint - INT8U - The endpoint of the prepayment server.

    • issuerEvtId - INT32U - The issuer event ID for the debt.

    • debtType - INT8U - The type of debt (0,1,2) that will be set.

    • collectTime - INT16U - The time in mins from midnight when the debt should be collected.

    • startTime - INT32U - The starting UTC time when debt should be collected.

    • collectFreq - INT8U - The frequency at which debt should be collected. 0=hourly, 1=daily, 2=weekly, 3=monthly, 4=quarterly.


Definition at line 4940 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_VERIFY_ATTRIBUTE#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_VERIFY_ATTRIBUTE

plugin prepayment-server verifyAttribute [endpoint:1] [attributeId:2] [attributeSize:1] [expectedAttributeValue:4]

  • Verify the prepayment attribute value matches an expected value.

    • endpoint - INT8U - Metering endpoint whose payment mode value is being queried.

    • attributeId - INT16U - Attribute ID of the attribute that will be verified.

    • attributeSize - INT8U - Size of the attribute in bytes.

    • expectedAttributeValue - INT32U - Expected payment mode value.


Definition at line 4949 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_VERIFY_PAYMENT_MODE#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_VERIFY_PAYMENT_MODE

plugin prepayment-server verifyPaymentMode [endpoint:1] [expectedPaymentModeValue:2]

  • Verify the payment mode matches an expected payment mode value.

    • endpoint - INT8U - Metering endpoint whose payment mode value is being queried.

    • expectedPaymentModeValue - INT16U - Expected payment mode value.


Definition at line 4956 of file ./app/framework/test/headers/cli.doc

EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_WRITE_ATTRIBUTE#

#define EMBER_AF_DOXYGEN_CLI_COMMAND_PLUGIN_PREPAYMENT_SERVER_PLUGIN_PREPAYMENT_SERVER_WRITE_ATTRIBUTE

plugin prepayment-server writeAttribute [endpoint:1] [attributeId:2] [attributeType:1] [numBytes:1] [value:4]

  • Write the value of a local prepayment attribute (1-4 byte attribute value supported).

    • endpoint - INT8U - Endpoint whose prepayment attribute is being written.

    • attributeId - INT16U - The attribute ID that should be written.

    • attributeType - INT8U - The attribute type (eg 0x23=U32)

    • numBytes - INT8U - The number of bytes (1-4) of data to write.

    • value - INT32U - The data that should be written to the attribute.


Definition at line 4966 of file ./app/framework/test/headers/cli.doc