1.4 Meter App

The Meter App is an application example which shows the Meters And More Stack functionality on Meter side, including a very limited application implementation in charge of responding to Read Request commands with fixed data.

The following table shows the available Meter App projects:

Table 1-4. Meter App projects
Bare-Metal / FreeRTOSPathBoards
Bare-Metalsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_meter\pic32cx_mtg_ek_pl460.XPIC32CXMTG-EK + PL460-EK
FreeRTOSsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_meter\pic32cx_mtg_ek_pl460_freertos.XPIC32CXMTG-EK + PL460-EK
Bare-Metalsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_meter\pic32cx_mtsh_db_pl460.XPIC32CXMTSH-DB + PL460-EK
FreeRTOSsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_meter\pic32cx_mtsh_db_pl460_freertos.XPIC32CXMTSH-DB + PL460-EK
Bare-Metalsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_meter\sam_d20_xpro_pl460.X SAMD20-XPRO+ PL460-EK
FreeRTOSsmartenergy_metersandmore_apps\apps\metersandmore_apps\metersandmore_meter\sam_d20_xpro_pl460_freertos.X SAMD20-XPRO+ PL460-EK

The Meter Application interfaces with the AL component, which is the Meters And More Stack API to interact with the PLC protocol.

Documentation of AL component can be found here: onlinedocs.microchip.com/v2/keyword-lookup?keyword=MM_AL_Description&redirect=true

As the Meters And More Stack includes this AL component, it offers the following capabilities without application intervention:
  • Response to Network Management frames such as:
    • Address Request frames, responding with its own address.
    • Request Address Request frames, generating and sending the corresponding Address Request frame and sending back received responses
    • TCT Set frames, setting its TCT value and sending back the corresponding ACK frame
  • Decryption and Authentication of encrypted received frames
  • Encryption and Authentication Tag addition on outgoing frames requiring encryption
  • LMON maintenance for encrypted frames

Application Functionality

The Meter App functionality is very simple as almost all the duties are carried out by the AL Component.

Upon initialization, the Meter App configures the Meters And More Stack by setting the following parameters:
  • MAC Address
  • Write Key
  • Read Key
  • LMON value

Also, registers the required callbacks to be notified by AL upon Data or Event Indications, and Data Confirms.

Then the Application’s State Machine just waits for callbacks from the Stack, and if an Application command is received, it is decoded and responded in some cases.