DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
c37118.h File Reference

IEEE C37.118.2 synchrophasor frame codec (DETWS_ENABLE_C37118) - zero-heap frame builder + parser for the PMU / PDC wide-area-measurement wire protocol. More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

IEEE C37.118.2 synchrophasor frame codec (DETWS_ENABLE_C37118) - zero-heap frame builder + parser for the PMU / PDC wide-area-measurement wire protocol.

A C37.118.2 frame (all fields big-endian / network order):

SYNC(2) FRAMESIZE(2) IDCODE(2) SOC(4) FRACSEC(4) DATA(n) CHK(2)
  • SYNC: byte 0 = 0xAA; byte 1 = (frame_type << 4) | version (bits 6-4 type, 3-0 version).
  • FRAMESIZE: total octets in the frame, the CHK included.
  • SOC: seconds-of-century (Unix epoch seconds); FRACSEC: top 8 bits time quality, low 24 bits the fraction of a second.
  • CHK: CRC-CCITT (poly 0x1021, init 0xFFFF, no reflection, no final mask) over every octet up to but excluding the CHK itself.

Frame types: data / header / config-1 / config-2 / command / config-3. The DATA contents are message-type specific (data frames depend on the configuration); this codec frames any payload and fully builds + parses the fixed Command frame. CRC verified against the canonical CRC-CCITT-FALSE check value.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file c37118.h.