🛰️Zafer Satılmış - Aviora

AppMeterOperations

File-based meter registry, IEC 62056-21–style readout and load profile jobs, directive storage, and a queued worker task — the protocol layer enqueues work here and waits for completion callbacks.

Directories and files

  • ./meter/meterList — registered meter index
  • ./meter/reg/<serial> — binary MeterData_t record
  • ./meter/directive/<id>.json — directive payload
  • ./meter/meterDataOut/ — job outputs: <taskId>_meterID.txt, _readout.txt, _payload.txt

Readout / load profile job flow

ProtocolZD → MeterOps → file output
sequenceDiagram
  participant PZ as AppProtocolZD
  participant MO as MeterOperations worker
  participant FS as File system
  PZ->>MO: AddReadoutTask / AddProfileTask + callback
  MO->>MO: IEC flow (serial line)
  MO->>FS: taskId_readout.txt / _payload.txt
  MO-->>PZ: callback(taskId, status)
  PZ->>FS: read files
  PZ->>PZ: packetize and send on push
  PZ->>FS: delete output files

Directive API summary

FunctionDescription
appMeterOperationsAddDirectiveWrites a file keyed by id in the JSON.
appMeterOperationsDeleteDirective* deletes all directives.
appMeterOperationsGetDirectiveCount / GetDirectiveByIndexIndexed read for listing (max ~1024-byte buffer).
appMeterOperationsAddReadoutTaskRequest JSON must include METERSERIALNUMBER and a registered meter.

Internal dependencies

MeterOperations building blocks
flowchart TB
  MO[AppMeterOperations]
  MO --> FS[fs_port]
  MO --> ZJ[ZDJson]
  MO --> MIF[MeterCommInterface_t]
  MIF -.->|read/write| SER[RS485 / optical port]