; © Fraunhofer SIT; Michael Eckel (michael.eckel@sit.fraunhofer.de)
; © Fraunhofer SIT; Henk Birkholz (henk.birkholz@sit.fraunhofer.de)
; date: 2023-03-02
; https://hackmd.io/b9rJcX33QfeKXNkp-pcfdw
; Fingerprint -> Digest -> Hash?
; entry has interval, e.g., 10ms
; a measurement is always the duration
; context: OT/IT convergence, migration IT concepts to the OT space, maybe some Gartner ref
Entry = [
versionTag: ????,
start: Time, ; timestamp, claim creation time
MeasurementSeries,
]
; WebCite
; Hallo A:1,H:1,L:2,O:1
MeasurementSeries = (
RegularMeasurementSeries
/ IrregularMeasurementSeries
)
; duration in number of ticks, there is never a guarantee that '1s/interval' is the number of values, can always be less (never be more?)
;can be set or measured; time-span of a tick (no timescale, epoch anchored via measurement timestamp) with unit prefix+second, e.g., femtosecond, potential derived from entries per measurement (after reception)
RegularMeasurementSeries = [ ; constant
; interval ODER measurement-series-duration
measurement-series-duration: Time,
values: [* Value] ; * = zero or more
]
IrregularMeasurementSeries = [ ; variable
start: Time, ;
* [
time: Time, ; duration (no timescale, duration since start of measurement series) with resolution unit prefix+second,
value: Value,
],
]
; https://datatracker.ietf.org/doc/html/draft-ietf-cbor-time-tag
Time = [
seconds: uint / float / CBORTimeTag,
unitMultiple: UnitMultipleSi,
]
Value = &( ; this choice must be extended
ElectricalValue,
Radio
)
; anweiss cddl_gen
; https://github.com/dcSpark/cddl-codegen
ElectricalValue = [
value: int / float,
unit: ElectricalUnitSi,
unitMultiple: UnitMultipleSi,
]
; Weil MCU direkt ADC-Werte lesen könnte und zu schwach ist zur Umrechnung
; sein könnte, gibt es auch 'none', was direkte "raw" ADC-Werte sein könnten.
ElectricalUnitSi = &(
none: 0, ; none
voltage: 1, ; Volt (V or E); unit of electrical potential: V=I*R
current: 2, ; Ampere (I or i); unit of electrical current: I=V/R
resistance: 3, ; Ohm (R or omega); unit of DC resistance R=V/I
conductance: 4, ; Siemens (G or minuscle); reciprocal of resistance G=1/R
capacitance: 5, ; Farad (C) ; unit of capacitance C=Q/V
charge: 6, ; Coulomb (Q) ; unit of electrical charge: Q=C*V
inductance: 7, ; Henry (L or H); unit of inductance: V_L = -L(di/dt)
power: 8, ; Watts (W) ; unit of power: P=V*I or P=I2*R
impedance: 9, ; Ohm (Z) ; unit of AC resistance: Z^2=R^2+X^2
frequency: 10, ; Hertz (Hz) ; unit of frequency f=1/T,
)
UnitMultipleSi = &(
yocto: -24, ; y (10^-24)
zepto: -21, ; z (10^-21)
atto: -12, ; a (10^-18)
femto: -15, ; f (10^-15)
pico: -12, ; p (10^-12)
nano: -9, ; n (10^-9)
micro: -6, ; u (10^-6)
milli: -3, ; m (10^-3)
centi: -2, ; c (10^-2)
deci: -1, ; d (10^-1)
none: 0, ; none (10^0)
deca: 1, ; da (10^1)
hecto: 2, ; h (10^2)
kilo: 3, ; k (10^3)
mega: 6, ; M (10^6)
giga: 9, ; G (10^9)
tera: 12, ; T (10^12)
peta: 15, ; P (10^15)
exa : 18, ; E (10^18)
zetta: 21, ; Z (10^21)
yotta: 24, ; Y (10^24)
)
XX = UnitMultipleSi .within yocto...deci
; measurement_series_t
; Messreihe
; Regelmaessige Zeitreihe
; Unregelmaessige Zeitreihe
; https://datatracker.ietf.org/doc/html/rfc8428#section-12.1
; https://ucum.org/ucum.html
; https://github.com/qudt/qudt-public-repo
; https://www.rfc-editor.org/rfc/rfc8610.html#section-2.1
; https://github.com/cose-wg/Examples/blob/master/examples.cddl
; https://www.electronics-tutorials.ws/dccircuits/dcp_3.html
; https://www.computerwissen.de/software/office/libreoffice/calc-libreoffice/wie-sie-unregelmaessige-und-regelmaessige-zeitreihen-in-calc-erstellen/
; https://en.wikipedia.org/wiki/Physical_quantity
; https://github.com/anweiss/cddl
; https://www.rfc-editor.org/rfc/rfc8428