Skip to content

Commit

Permalink
Create example file for all types of raw value (#397)
Browse files Browse the repository at this point in the history
* Create example file for all types of raw value

* Split examples into separate reference values

* Fix syntax errors

* More syntax error fixing

* And more...

* ... and more

* ...

---------

Co-authored-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
andrew-draper and yogeshbdeshpande authored Feb 24, 2025
1 parent 72c7086 commit 48bce36
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions cddl/examples/comid-raw-value.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/ concise-mid-tag / {
/ comid.tag-identity / 1 : {
/ comid.tag-id / 0 : h'3f06af63a93c11e4979700505690773f'
},
/ comid.entity / 2 : [ {
/ comid.entity-name / 0 : "ACME Inc.",
/ comid.reg-id / 1 : 32("https://acme.example"),
/ comid.role / 2 : [ 0 ] / tag-creator /
} ],
/ comid.triples / 4 : {

/ The reference triples below all match against an ACS entry containing a raw value. /
/ The first matches against the complete raw value, the next two match against part of the value /

/ comid.reference-triples / 0 : [ [
/ environment-map / {
/ comid.class / 0 : {
/ comid.class-id / 0 :
/ tagged-uuid-type / 37(
h'67b28b6c34cc40a19117ab5b05911e37'
),
/ comid.vendor / 1 : "ACME Inc.",
/ comid.model / 2 : "ACME RoadRunner",
/ comid.layer / 3 : 1
}
},
[
/ measurement-map / {
/ This version compares the whole 32 bits /
/ comid.mval / 1 : {
/ comid.raw-value / 4 : 560(h'12345678')
}
}
]
], [
/ environment-map / {
/ comid.class / 0 : {
/ comid.class-id / 0 :
/ tagged-uuid-type / 37(
h'67b28b6c34cc40a19117ab5b05911e37'
),
/ comid.vendor / 1 : "ACME Inc.",
/ comid.model / 2 : "ACME RoadRunner",
/ comid.layer / 3 : 1
}
},
[
/ measurement-map / {
/ This version compares the first 16 bits using preferred syntax /
/ comid.mval / 1 : {
/ comid.raw-value / 4 : 563( [ / value / h'12340000', / mask / h'FFFF0000' ] )
}
}
]
], [
/ environment-map / {
/ comid.class / 0 : {
/ comid.class-id / 0 :
/ tagged-uuid-type / 37(
h'67b28b6c34cc40a19117ab5b05911e37'
),
/ comid.vendor / 1 : "ACME Inc.",
/ comid.model / 2 : "ACME RoadRunner",
/ comid.layer / 3 : 1
}
},
[
/ measurement-map / {
/ This version compares the first 16 bits using deprecated syntax /
/ comid.mval / 1 : {
/ comid.raw-value / 4 : 560(h'12340000'),
/ comid.raw-value-mask / 5 : h'FFFF0000'
}
}
]
] ]
}
}

0 comments on commit 48bce36

Please sign in to comment.