Modules#

EmberAfPriceClientCommonInfo

EmberAfPriceClientBillingPeriod

EmberAfPriceClientBlockPeriod

EmberAfPriceClientBlockThreshold

EmberAfPriceClientCalorificValue

EmberAfPriceClientCo2Value

EmberAfPriceClientConversionFactor

EmberAfPriceClientCppEvent

EmberAfPriceClientCreditPayment

EmberAfPriceClientCurrencyConversion

EmberAfPriceClientTierLabels

EmberAfPriceClientBillingPeriodTable

EmberAfPriceClientBlockPeriodTable

EmberAfPriceClientBlockThresholdTable

EmberAfPriceClientCalorificValueTable

EmberAfPriceClientCo2ValueTable

EmberAfPriceClientConversionFactorTable

EmberAfPriceClientCppEventTable

EmberAfPriceClientCreditPaymentTable

EmberAfPriceClientCurrencyConversionTable

EmberAfPriceClientTierLabelsTable

EmberAfPriceClientInfo

Price Client

Price Client#

API and Callbacks for the Price Cluster Client Component.

This component provides an implementation of a Price client. It simply stores the prices received over-the-air. This component requires extending to act on the price changes.

API#

void

Initialize the consolidated bills table.

uint8_t

Return the index of the currently active CO2 entry, or 0xFF if no active entry can be found.

void
emberAfPricePrintCppEvent(uint8_t endpoint)

Print information about the CPP event.

uint8_t
emberAfPriceClusterCurrencyConversionTableGetIndexByEventId(uint8_t endpoint, uint32_t issuerEventId)

Return the currency conversion table index with a matching eventId.

uint8_t

Return the index of the currently active currency conversion entry, or 0xFF if no active entry can be found.

Functions#

void
void
emAfPluginPriceClientPrintByEventId(uint8_t endpoint, uint32_t issuerEventId)
void
emAfPriceClearPriceTable(uint8_t endpoint)
uint8_t
emAfPriceGetBlockPeriodTableIndexByEventId(uint8_t endpoint, uint32_t issuerEventId)

Return the block period table index with a matching eventId.

void
emAfPricePrintBlockPeriodTableIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the block period table.

uint8_t
emAfPriceGetConversionFactorIndexByEventId(uint8_t endpoint, uint32_t issuerEventId)

Return the conversion factor table index with a matching eventId.

void
emAfPricePrintConversionFactorEntryIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the conversion factor table.

uint8_t
emAfPriceGetCalorificValueIndexByEventId(uint8_t endpoint, uint32_t issuerEventId)

Return the calorific value table index with a matching eventId.

void
emAfPricePrintCalorificValueEntryIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the calorific value table.

uint8_t
emAfPriceGetActiveTierLabelTableIndexByTariffId(uint8_t endpoint, uint32_t tariffId)

Return the index of the currently active tier label table entry, or 0xFF if no active entry can be found.

void
emAfPricePrintTierLabelTableEntryIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the tier label table.

void
emAfPricePrintCo2ValueTablePrintIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the CO2 value table.

uint8_t
emAfPriceConsolidatedBillTableGetIndexWithEventId(uint8_t endpoint, uint32_t issuerEventId)

Print the tier label table.

uint8_t

Return the index of the active consolidated bill table.

void
emAfPricePrintConsolidatedBillTableIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the consolidated bill table.

uint8_t
emAfPriceCreditPaymentTableGetIndexWithEventId(uint8_t endpoint, uint32_t issuerEventId)

Return the credit payment table index with a matching eventId.

void

Print the credit payment table entry data of the index with a valid matching eventId.

void
emAfPricePrintCreditPaymentTableIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the credit payment table.

void
emAfPricePrintCurrencyConversionTableIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the currency conversion table.

uint8_t

Return the index of the currently active billing period entry, or 0xFF if no active entry can be found.

void
emAfPricePrintBillingPeriodTableEntryIndex(uint8_t endpoint, uint8_t index)

Print the information at the specified index of the billing period table.

Macros#

#define
EMBER_AF_PLUGIN_PRICE_CLIENT_TABLE_SIZE 2
#define
ZCL_PRICE_CLUSTER_PRICE_RATIO_NOT_USED 0xFF
#define
ZCL_PRICE_CLUSTER_GENERATION_PRICE_NOT_USED 0xFFFFFFFFUL
#define
ZCL_PRICE_CLUSTER_GENERATION_PRICE_RATIO_NOT_USED 0xFF
#define
ZCL_PRICE_CLUSTER_ALTERNATE_COST_DELIVERED_NOT_USED 0xFFFFFFFFUL
#define
ZCL_PRICE_CLUSTER_ALTERNATE_COST_UNIT_NOT_USED 0xFF
#define
ZCL_PRICE_CLUSTER_ALTERNATE_COST_TRAILING_DIGIT_NOT_USED 0xFF
#define
ZCL_PRICE_CLUSTER_NUMBER_OF_BLOCK_THRESHOLDS_NOT_USED 0xFF
#define
ZCL_PRICE_CLUSTER_PRICE_CONTROL_NOT_USED 0x00
#define
UNSPECIFIED_PROVIDER_ID 0xFFFFFFFF
#define
UNSPECIFIED_DURATION 0xFFFFFFFF
#define
EMBER_AF_PLUGIN_PRICE_CLUSTER_MAX_CREDIT_PAYMENT_REF_LENGTH 20

API Documentation#

emberAfPriceInitConsolidatedBillsTable#

void emberAfPriceInitConsolidatedBillsTable (uint8_t endpoint)

Initialize the consolidated bills table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.


emberAfPriceClusterGetActiveCo2ValueIndex#

uint8_t emberAfPriceClusterGetActiveCo2ValueIndex (uint8_t endpoint)

Return the index of the currently active CO2 entry, or 0xFF if no active entry can be found.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

Returns

  • The index of the active CO2 entry.


emberAfPricePrintCppEvent#

void emberAfPricePrintCppEvent (uint8_t endpoint)

Print information about the CPP event.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

THe relevant endpoint.


emberAfPriceClusterCurrencyConversionTableGetIndexByEventId#

uint8_t emberAfPriceClusterCurrencyConversionTableGetIndexByEventId (uint8_t endpoint, uint32_t issuerEventId)

Return the currency conversion table index with a matching eventId.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerEventId

The eventId that should be searched for in the currency conversion table.

Returns

  • The index with a valid matching event ID.


emberAfPriceClusterGetActiveCurrencyIndex#

uint8_t emberAfPriceClusterGetActiveCurrencyIndex (uint8_t endpoint)

Return the index of the currently active currency conversion entry, or 0xFF if no active entry can be found.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

Returns

  • The index of the active currency conversion entry.


Function Documentation#

emAfPluginPriceClientPrintInfo#

void emAfPluginPriceClientPrintInfo (uint8_t endpoint)
Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

emAfPluginPriceClientPrintByEventId#

void emAfPluginPriceClientPrintByEventId (uint8_t endpoint, uint32_t issuerEventId)
Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint
uint32_tN/AissuerEventId

emAfPriceClearPriceTable#

void emAfPriceClearPriceTable (uint8_t endpoint)
Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

emAfPriceGetBlockPeriodTableIndexByEventId#

uint8_t emAfPriceGetBlockPeriodTableIndexByEventId (uint8_t endpoint, uint32_t issuerEventId)

Return the block period table index with a matching eventId.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerEventId

The eventId that should be searched for in the block period table.

Returns

  • The index with a valid matching event ID.


emAfPricePrintBlockPeriodTableIndex#

void emAfPricePrintBlockPeriodTableIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the block period table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPriceGetConversionFactorIndexByEventId#

uint8_t emAfPriceGetConversionFactorIndexByEventId (uint8_t endpoint, uint32_t issuerEventId)

Return the conversion factor table index with a matching eventId.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerEventId

The eventId that should be searched for in the conversion factor table.

Returns

  • The index with a valid matching event ID.


emAfPricePrintConversionFactorEntryIndex#

void emAfPricePrintConversionFactorEntryIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the conversion factor table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPriceGetCalorificValueIndexByEventId#

uint8_t emAfPriceGetCalorificValueIndexByEventId (uint8_t endpoint, uint32_t issuerEventId)

Return the calorific value table index with a matching eventId.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerEventId

The eventId that should be searched for in the calorific value table.

Returns

  • The index with a valid matching event ID.


emAfPricePrintCalorificValueEntryIndex#

void emAfPricePrintCalorificValueEntryIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the calorific value table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPriceGetActiveTierLabelTableIndexByTariffId#

uint8_t emAfPriceGetActiveTierLabelTableIndexByTariffId (uint8_t endpoint, uint32_t tariffId)

Return the index of the currently active tier label table entry, or 0xFF if no active entry can be found.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AtariffId

Returns

  • The index of the active tier label table entry.


emAfPricePrintTierLabelTableEntryIndex#

void emAfPricePrintTierLabelTableEntryIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the tier label table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPricePrintCo2ValueTablePrintIndex#

void emAfPricePrintCo2ValueTablePrintIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the CO2 value table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPriceConsolidatedBillTableGetIndexWithEventId#

uint8_t emAfPriceConsolidatedBillTableGetIndexWithEventId (uint8_t endpoint, uint32_t issuerEventId)

Print the tier label table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerEventId

The eventId that should be searched for in the consolidated bill table.

Return the consolidated bill table index with a matching eventId.

Returns

  • The index with a valid matching event ID.


emAfPriceConsolidatedBillTableGetCurrentIndex#

uint8_t emAfPriceConsolidatedBillTableGetCurrentIndex (uint8_t endpoint)

Return the index of the active consolidated bill table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

Returns

  • The index of the consolidated bills table with a valid matching event ID, or 0xFF if no valid match is found.


emAfPricePrintConsolidatedBillTableIndex#

void emAfPricePrintConsolidatedBillTableIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the consolidated bill table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPriceCreditPaymentTableGetIndexWithEventId#

uint8_t emAfPriceCreditPaymentTableGetIndexWithEventId (uint8_t endpoint, uint32_t issuerEventId)

Return the credit payment table index with a matching eventId.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The eventId that should be searched for in the credit payment table.

uint32_tN/AissuerEventId

Returns

  • The index with a valid matching event ID.


emAfPricePrintCreditPaymentTableEventId#

void emAfPricePrintCreditPaymentTableEventId (uint32_t issuerEventId, issuerEventId)

Print the credit payment table entry data of the index with a valid matching eventId.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/AissuerEventId

The relevant endpoint.

N/AissuerEventId

The eventId that should be found in the credit payment table.


emAfPricePrintCreditPaymentTableIndex#

void emAfPricePrintCreditPaymentTableIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the credit payment table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPricePrintCurrencyConversionTableIndex#

void emAfPricePrintCurrencyConversionTableIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the currency conversion table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.


emAfPriceGetActiveBillingPeriodIndex#

uint8_t emAfPriceGetActiveBillingPeriodIndex (uint8_t endpoint)

Return the index of the currently active billing period entry, or 0xFF if no active entry can be found.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

Returns

  • The index of the active billing period entry.


emAfPricePrintBillingPeriodTableEntryIndex#

void emAfPricePrintBillingPeriodTableEntryIndex (uint8_t endpoint, uint8_t index)

Print the information at the specified index of the billing period table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index whose data should be printed.